1import{g as re,a as ie,r as g,u as le,j as e,s as D,c as Pe,b as de,d as M,T as y,t as Z,e as K,f as I,D as ce,h as ue,i as U,k as he,l as xe,m as Y,n as pe,B as k,o as me,F as N,p as R,E as L,S as E,q,v as S,K as ke,w as F,I as P,x as je,y as ge,z as J,A as Q,C as G,G as Ae,H as ze,J as Le,L as Me,M as Ne,N as X,O as Re,P as Ee,U as ee,Q as $,R as He,V as W,W as B,X as Oe,Y as We,Z as Be,_ as _e,$ as Ue,a0 as Ge,a1 as fe,a2 as $e,a3 as Ve,a4 as Ke,a5 as Ye,a6 as qe,a7 as Je,a8 as Qe,a9 as Xe,aa as H,ab as Ze,ac as et,ad as tt,ae as st,af as te,ag as se,ah as nt,ai as ot,aj as at,ak as rt,al as ne,am as it,an as lt,ao as dt,ap as ct,aq as ut,ar as ht,as as xt}from"./index-C0XdXte6.js";import{K as pt}from"./KeyboardArrowUp-BgJze4eh.js";import{T as O}from"./TableSortLabel-mxN9aXEU.js";import{C as mt}from"./Clear-CzgxghYK.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="95eded28-78a9-4709-97a5-cbcd6e1d032f",t._sentryDebugIdIdentifier="sentry-dbid-95eded28-78a9-4709-97a5-cbcd6e1d032f")}catch{}function jt(t){return re("MuiCardContent",t)}ie("MuiCardContent",["root"]);const gt=t=>{const{classes:s}=t;return de({root:["root"]},jt,s)},ft=D("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,s)=>s.root})({padding:16,"&:last-child":{paddingBottom:24}}),Ct=g.forwardRef(function(s,o){const n=le({props:s,name:"MuiCardContent"}),{className:a,component:i="div",...r}=n,d={...n,component:i},l=gt(d);return e.jsx(ft,{as:i,className:Pe(l.root,a),ownerState:d,ref:o,...r})});function yt(t){return re("MuiCardHeader",t)}const _=ie("MuiCardHeader",["root","avatar","action","content","title","subheader"]),bt=t=>{const{classes:s}=t;return de({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},yt,s)},St=D("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,s)=>[{[`& .${_.title}`]:s.title},{[`& .${_.subheader}`]:s.subheader},s.root]})({display:"flex",alignItems:"center",padding:16}),vt=D("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,s)=>s.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),wt=D("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,s)=>s.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),Tt=D("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,s)=>s.content})({flex:"1 1 auto",[`.${Z.root}:where(& .${_.title})`]:{display:"block"},[`.${Z.root}:where(& .${_.subheader})`]:{display:"block"}}),Ft=g.forwardRef(function(s,o){const n=le({props:s,name:"MuiCardHeader"}),{action:a,avatar:i,component:r="div",disableTypography:d=!1,subheader:l,subheaderTypographyProps:c,title:h,titleTypographyProps:u,slots:j={},slotProps:x={},...v}=n,f={...n,component:r,disableTypography:d},C=bt(f),b={slots:j,slotProps:{title:u,subheader:c,...x}};let p=h;const[w,m]=M("title",{className:C.title,elementType:y,externalForwardedProps:b,ownerState:f,additionalProps:{variant:i?"body2":"h5",component:"span"}});p!=null&&p.type!==y&&!d&&(p=e.jsx(w,{...m,children:p}));let T=l;const[Ce,ye]=M("subheader",{className:C.subheader,elementType:y,externalForwardedProps:b,ownerState:f,additionalProps:{variant:i?"body2":"body1",color:"textSecondary",component:"span"}});T!=null&&T.type!==y&&!d&&(T=e.jsx(Ce,{...ye,children:T}));const[be,Se]=M("root",{ref:o,className:C.root,elementType:St,externalForwardedProps:{...b,...v,component:r},ownerState:f}),[ve,we]=M("avatar",{className:C.avatar,elementType:vt,externalForwardedProps:b,ownerState:f}),[Te,Fe]=M("content",{className:C.content,elementType:Tt,externalForwardedProps:b,ownerState:f}),[Ie,De]=M("action",{className:C.action,elementType:wt,externalForwardedProps:b,ownerState:f});return e.jsxs(be,{...Se,children:[i&&e.jsx(ve,{...we,children:i}),e.jsxs(Te,{...Fe,children:[p,T]}),a&&e.jsx(Ie,{...De,children:a})]})}),It=K(e.jsx("path",{d:"M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-1 8h-3v3h-2v-3h-3v-2h3V9h2v3h3z"}),"CreateNewFolder"),Dt=K(e.jsx("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"Folder"),Pt=K(e.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen");function kt({open:t,currentName:s,handleClose:o,handleCreate:n,...a}){const{t:i}=I("common"),[r,d]=g.useState(s);return e.jsxs(ce,{open:t,onClose:o,"aria-labelledby":"edit-folder-name-dialog",maxWidth:"sm",...a,children:[e.jsx(ue,{onClose:o,children:i("editFolderName")}),e.jsx(U,{}),e.jsxs(he,{children:[e.jsx(xe,{pb:2,children:i("editFolderNameDialogText")}),e.jsx(Y,{variant:"outlined",autoFocus:!0,margin:"dense",id:"name",label:i("folderName"),type:"text",fullWidth:!0,defaultValue:r,onChange:l=>{d(l.target.value)},error:r==="",helperText:r===""?i("emptyFolderName"):""})]}),e.jsxs(pe,{children:[e.jsx(k,{onClick:o,color:"primary",size:"small",children:i("cancel")}),e.jsx(k,{onClick:()=>{n(r),o()},type:"submit",color:"primary",variant:"contained",size:"small",disabled:!r,children:i("save")})]})]})}const At=({children:t,name:s,folderId:o})=>{const{t:n}
1=I("common"),[a,i]=g.useState(!1),[r,d]=g.useState(!1),[l,c]=g.useState(!1),[h,u]=g.useState(!1),j=()=>{u(!0)},x=()=>{u(!1)},v=f=>{o&&J.updateFolder(o,f).then(()=>{R([L,E.GET_PLAN_FOLDERS])}).catch(C=>{Q.error(C)})};return e.jsxs(e.Fragment,{children:[l&&e.jsx(me,{open:l,setOpen:c,id:o??"",type:N.folder,handleCommunicationSucces:()=>{R([L,E.GET_PLAN_FOLDERS])}}),h&&e.jsx(kt,{open:h,currentName:s,handleCreate:f=>{v(f)},handleClose:x}),e.jsx(q,{hover:!0,onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},style:{cursor:"pointer"},children:e.jsx(zt,{colSpan:8,display:r,children:e.jsxs(S,{spacing:1.3,direction:"row",alignItems:"center",flexGrow:1,children:[a?e.jsxs(S,{spacing:1,p:"6px 16px",direction:"row",alignItems:"center",flexGrow:1,onClick:()=>{i(!a)},children:[e.jsx(pt,{}),e.jsx(Pt,{fontSize:"small"}),e.jsx(y,{sx:{userSelect:"none"},children:String(s)})]}):e.jsxs(S,{spacing:1,p:"6px 16px",direction:"row",alignItems:"center",flexGrow:1,onClick:()=>{i(!a)},children:[e.jsx(ke,{}),e.jsx(Dt,{fontSize:"small"}),e.jsx(y,{sx:{userSelect:"none"},children:String(s)})]}),r&&e.jsxs(S,{spacing:1.3,direction:"row",alignItems:"center",justifyContent:"right",width:50,paddingRight:2,children:[e.jsx(F,{title:n("edit")??"",children:e.jsx(P,{sx:{padding:0},onClick:j,"data-testid":"plans-table-edit-button",size:"small",color:"secondary",children:e.jsx(je,{fontSize:"inherit"})})}),e.jsx(F,{title:n("delete")??"",children:e.jsx(P,{sx:{padding:0},onClick:()=>{c(!0)},"data-testid":"plans-table-delete-button",size:"small",color:"secondary",children:e.jsx(ge,{fontSize:"inherit"})})})]})]})})}),a&&e.jsx(e.Fragment,{children:t})]})},zt=D(G)(({theme:t,display:s})=>({padding:0,backgroundColor:s?Ae(t.palette.action.hover,t.palette.action.hoverOpacity/4):t.palette.background.default})),Lt=t=>e.jsx(S,{spacing:1,direction:"row",alignItems:"center",children:t.map((s,o)=>e.jsx(ze,{label:e.jsx(y,{fontSize:"small",children:s}),variant:"filled",size:"small"},`tag-${s}-${o}`))}),V=({plan:t,navigate:s,nested:o=!1})=>{var C;const{t:n}=I("common"),{publishToExternalApi:a}=Le(),{openModalWindow:i}=Me(),{dateFormatter:r}=Ne(),[d,l]=g.useState(!1),[c,h]=g.useState(!1),u=(C=X())==null?void 0:C.dispatch,j=Re(),[x,v]=g.useState(!1);function f(){h(!0),J.exportPlan(t.id).then(b=>{h(!1),j.current&&_e(JSON.stringify(b.data),`${t.name}.json`)}).catch(b=>{h(!1),j.current&&Q.error(b)})}return e.jsxs(e.Fragment,{children:[x&&e.jsx(me,{open:x,setOpen:v,id:t.id,type:N.plan,handleCommunicationSucces:()=>{R([L,E.GET_PLANS])}}),e.jsxs(q,{hover:!0,onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},style:{cursor:"pointer"},children:[e.jsx(Mt,{sx:{paddingLeft:o?6:2},component:"th",scope:"row",onClick:()=>{s(t.id)},"data-testid":t.name,children:e.jsxs(S,{spacing:1,direction:"row",alignItems:"center",children:[e.jsx(Ee,{fontSize:"small",color:"primary"}),e.jsx(y,{sx:{display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:3},children:t.name})]})}),e.jsx(z,{onClick:()=>{s(t.id)},children:e.jsx(y,{sx:{display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:3},children:t.description})}),e.jsx(z,{onClick:()=>{s(t.id)},children:e.jsx(y,{noWrap:!0,children:r.toDateString(t.startDate)})}),e.jsx(z,{onClick:()=>{s(t.id)},children:e.jsxs(y,{noWrap:!0,children:[" ",r.toDateString(t.endDate)]})}),e.jsx(z,{onClick:()=>{s(t.id)},children:e.jsx(y,{noWrap:!0,children:t.updatedAt&&r.toLimitedTimeAgo(t.updatedAt)})}),e.jsx(z,{onClick:()=>{s(t.id)},children:e.jsxs(S,{spacing:.5,direction:"row",alignItems:"center",children:[t!=null&&t.hasInventoryConnection?e.jsx(F,{title:e.jsxs("span",{children:[n("hasInventoryConnection"),e.jsx("br",{}),(t==null?void 0:t.lastSynced)&&r.toLimitedTimeAgo(t.lastSynced)]}),children:e.jsx(ee,{fontSize:"small",color:t.lastSynced?"secondary":"disabled"})}):e.jsx(F,{title:n("noInventoryConnection")??"",children:e.jsx(ee,{fontSize:"small",color:"disabled"})}),a&&(t!=null&&t.publishedAt)?e.jsx(F,{title:e.jsxs("span",{children:[t.changedSincePublished?n("hasUnpublishedChanges"):n("hasBeenPublished"),e.jsx("br",{}),t.publishedAt&&r.toLimitedTimeAgo(t.publishedAt)]}),children:e.jsx($,{fontSize:"small",color:t.changedSincePublished?"primary":"secondary"})}):e.jsx(F,{title:n("hasNotBeenPublished")??"",children:e.jsx($,{fontSize:"small",color:"disabled"})})]})}),e.jsx(z,{onClick:()=>{s(t.id)},children:(t==null?void 0:t.tags)&&Lt(t==null?void 0:t.tags)}),e.jsx(z,{sx:{width:164},size:"small",children:d&&e.jsxs(S,{spacing:1.3,direction:"row",alignItems:"center",justifyContent:"right",children:[e.jsx(F,{title:n("copyAction")??"",children:e.jsx(P,{sx:{padding:0},onClick:()=>u&&u({type:B.setFormData,form:N.plan,method:W.copy,formData:{planId:t.id}}),size:"small",color:"secondary",children:e.jsx(He,{fontSize:"inherit"})})}),e.jsx(F,{title:n("edit")??"",children:e.jsx(P,{sx:{padding:0},onClick:()=>u&&u({type:B.setFormData,form:N.plan,method:W.edit,formData:{planId:t.id}}),"data-testid":"plans-table-edit-button",size:"small",color:"secondary",children:e.jsx(je,{fontSize:"inherit"})})}),a&&e.jsx(F,{title:n("publishToAPI")??"",children:e.jsx(P,{sx:{padding:0},onClick:()=>{i(Oe,{payload:{id:t.id}})},"data-testid":"plans-table-publish-button",size:"small",color:"secondary",children:e.jsx($,{fontSize:"inherit"})})}),e.jsx(F,{title:n("download")??"",children:c?e.jsx(We,{size:18}):e.jsx(P,{sx:{padding:0},onClick:()=>{f()},"data-testid":"plans-table-download-button",size:"small",color:"secondary",children:e.jsx(Be,{fontSize:"inherit"})})}),e.jsx(F,{title:n("delete")??"",children:e.jsx(P,{sx:{padding:0},onClick:()=>{v(!0)},"data-testid":"plans-table-delete-button",size:"small",color:"secondary",children:e.jsx(ge,{fontSize:"inherit"})})})]})})]})]})},Mt=D(G)(({theme:t})=>({minWidth:t.spacing(20),height:t.spacing(5),borderBottomColor:t.palette.divider})),z=D(G)(({theme:t})=>({borderBottomColor:t.palette.divider,maxWidth:"50vw"}));function oe({plans:t,folders:s,showFolders:o}){const{t:n}=I("common"),{navigate:a,urlSearchParams:i,state:r}=Ue(),d=Ge(),l=p=>{i.append(qe.plan,p);const w=Je.planOverview,m=r&&r.from?r.from.concat(w):[w];a({pathname:w,search:i.toString()},{state:{from:m}})},[c,h]=g.useState("updatedAt"),[u,j]=g.useState(!1),x=p=>p?"asc":"desc",v=ae(c,x(u),d),f=ae(c,x(u),d),C=[...t].sort(v),b=s&&[...s].sort(f);
1return e.jsx(fe,{component:$e,elevation:0,children:e.jsxs(Ve,{stickyHeader:!0,"data-testid":"plans-table",size:"small",children:[e.jsx(Ke,{children:e.jsxs(q,{children:[e.jsx(A,{onClick:()=>{j(!u),h("name")},children:e.jsx(O,{active:c==="name",direction:x(u),children:n("name")})},"table-head-name"),e.jsx(A,{onClick:()=>{j(!u),h("description")},children:e.jsx(O,{active:c==="description",direction:x(u),children:n("description")})},"table-head-description"),e.jsx(A,{onClick:()=>{j(!u),h("startDate")},children:e.jsx(O,{active:c==="startDate",direction:x(u),sx:{whiteSpace:"nowrap"},children:n("startDate")})},"table-head-startdate"),e.jsx(A,{onClick:()=>{j(!u),h("endDate")},children:e.jsx(O,{active:c==="endDate",direction:x(u),sx:{whiteSpace:"nowrap"},children:n("endDate")})},"table-head-enddate"),e.jsx(A,{onClick:()=>{j(!u),h("updatedAt")},children:e.jsx(O,{active:c==="updatedAt",direction:x(u),children:n("lastUpdated")})},"table-head-lastupdated"),e.jsx(A,{children:n("sync")},"table-head-inventory"),e.jsx(A,{children:n("tags")},"table-head-tags"),e.jsx(A,{})]})}),e.jsx(Ye,{children:o?e.jsxs(e.Fragment,{children:[b&&b.map(p=>e.jsx(At,{name:p.name,folderId:p.id,children:C.map(w=>p.id===w.folderId&&e.jsx(V,{plan:w,navigate:l,nested:!0},w.id))},p.id)),C.map(p=>!p.folderId&&e.jsx(V,{plan:p,navigate:l,nested:!1},p.id))]}):e.jsx(e.Fragment,{children:C.map(p=>e.jsx(V,{plan:p,navigate:l,nested:!1},p.id))})})]})})}const A=D(G)(({theme:t})=>({backgroundColor:t.palette.background.default})),ae=(t,s,o)=>{const n=s==="desc";return(a,i)=>{const r=t in a,d=t in i;if(!r&&!d)return 0;if(!r)return n?1:-1;if(!d)return n?-1:1;const l=a[t],c=i[t];if(l==null&&c==null)return 0;if(l==null)return n?1:-1;if(c==null)return n?-1:1;if(typeof l=="number"&&typeof c=="number")return n?c-l:l-c;if(typeof l=="string"&&typeof c=="string"){const h=Date.parse(l),u=Date.parse(c);if(!isNaN(h)&&!isNaN(u))return n?u-h:h-u;const j=o(l,c);return n?-j:j}return 0}};function Nt({allPlans:t,setSelectedPlans:s}){const[o,n]=g.useState(null),a=!!o,{t:i}=I("common"),[r,d]=g.useState([]),l=Et(t);if(!t||!l.length)return null;const c=r&&r.length,h=a?"checkbox-filter-popover":void 0,u=x=>{n(x.currentTarget)},j=()=>{n(null)};return e.jsxs(S,{direction:"row",justifyContent:"center",children:[e.jsx(k,{"aria-haspopup":"true","aria-expanded":a?"true":void 0,variant:"text",color:"inherit",onClick:u,sx:{whiteSpace:"nowrap",minWidth:"auto",paddingRight:0},"data-testid":"filter-site-menu",children:e.jsxs(S,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(y,{variant:"body2",color:"secondary",children:i("filterTags")}),e.jsxs(S,{direction:"row",width:44,children:[c>0&&e.jsx(Rt,{mr:.5,variant:"body2",width:20,align:"center",children:c}),e.jsx(Qe,{fontSize:"small",color:"secondary"})]})]})}
1),e.jsxs(Xe,{id:h,anchorEl:o,open:a,onClose:j,style:{zIndex:3e3},children:[e.jsx(H,{sx:{maxHeight:296,overflowY:"auto"},children:r&&l&&(l==null?void 0:l.map((x,v)=>e.jsxs(Ze,{dense:!0,onClick:()=>{const f=te(r,String(x));d(f),s(Ht(te(r,String(x)),t))},"data-testid":`filter-site-menu-item-${x}`,children:[e.jsx(et,{children:e.jsx(tt,{disableRipple:!0,checked:r.includes(String(x)),sx:{p:0}})}),e.jsx(st,{children:e.jsx(y,{fontSize:"small",children:String(x).toLocaleUpperCase()})})]},v)))}),e.jsx(U,{variant:"middle"}),e.jsx(S,{direction:"row",mx:1,marginTop:1,children:e.jsx(k,{variant:"text",color:"primary",onClick:()=>{r&&d([]),s(t),j()},size:"small","data-testid":"clear",children:i("clear")})})]})]})}const Rt=D(y)(({theme:t})=>({backgroundColor:t.palette.primary.main,borderRadius:40,color:t.palette.background.paper,width:20})),Et=t=>{const s=t.flatMap(o=>(o==null?void 0:o.tags)??[]);return[...new Set(s)]},Ht=(t,s)=>{if(t.length===0||!s)return s;const o=s.filter(n=>(n==null?void 0:n.tags)&&Ot(n==null?void 0:n.tags,t));return o.length===0?s:o},Ot=(t,s)=>{const o=t.map(a=>a.toLowerCase()),n=new Set(s.map(a=>a.toLowerCase()));return o.some(a=>n.has(a))};function Wt({allPlans:t,setSelectedPlans:s,allFolders:o,setSelectedFolders:n}){const{t:a}=I("common"),[i,r]=g.useState(""),d=()=>{r(""),s(t),n(o)};return t?e.jsx(S,{direction:"row",justifyContent:"center",width:220,m:1.5,children:e.jsx(Y,{id:"search-plan-filter",onChange:l=>{r(l.target.value),s(Bt(l.target.value,t)),o&&n(_t(l.target.value,o))},fullWidth:!0,variant:"outlined",size:"small",value:i,placeholder:a("search")??"",InputProps:{endAdornment:i?e.jsx(se,{position:"end",children:e.jsx(P,{size:"small",edge:"end",onClick:d,children:e.jsx(mt,{color:"secondary"})})}):e.jsx(se,{position:"end",children:e.jsx(P,{size:"small",edge:"end",children:e.jsx(nt,{color:"disabled"})})}),style:{paddingRight:8}}})}):null}const Bt=(t,s)=>s?s.filter(n=>{var d,l;const a=n.name.toLowerCase().includes(t.toLowerCase()),i=(d=n.description)==null?void 0:d.toLowerCase().includes(t.toLowerCase()),r=(l=n.tags)==null?void 0:l.map(c=>c.toLowerCase()).join().includes(t.toLowerCase());return a||(i??!1)||r}):[],_t=(t,s)=>s?s.filter(n=>n.name.toLowerCase().includes(t.toLowerCase())):[];function Ut({open:t,handleClose:s,handleCreate:o,...n}){const{t:a}=I("common"),[i,r]=g.useState();return e.jsxs(ce,{open:t,onClose:s,"aria-labelledby":"add-folder-dialog",maxWidth:"sm",...n,children:[e.jsx(ue,{onClose:s,children:a("addFolder")}),e.jsx(U,{}),e.jsxs(he,{children:[e.jsx(xe,{pb:2,children:a("addFolderDialogText")}),e.jsx(Y,{variant:"outlined",autoFocus:!0,margin:"dense",id:"name",label:a("folderName"),type:"text",fullWidth:!0,onChange:d=>{r(d.target.value)},error:i==="",helperText:i===""?a("emptyFolderName"):""})]}),e.jsxs(pe,{children:[e.jsx(k,{onClick:s,color:"primary",size:"small",children:a("cancel")}),e.jsx(k,{onClick:()=>{o(i),s()},type:"submit",color:"primary",variant:"contained",size:"small",disabled:!i,children:a("save")})]})]})}const Qt=()=>{const{t}=I("common"),s=ot({resourceId:L}),{user:o}=at(),n=o&&s.data,{plans:a,userPlans:i}=rt(),[r,d]=g.useState(),[l,c]=g.useState(),[h,u]=g.useState(!0),[j,x]=g.useState(!1),v=()=>{x(!0)},f=()=>{x(!1)},C=m=>{J.createFolder(m).then(()=>{R([L,E.GET_PLAN_FOLDERS])}).catch(T=>{Q.error(T)})},b=m=>{d(m.map(({id:T})=>T))},p=m=>{c(m.map(({id:T})=>T))},w=m=>{b(m),R([L,E.GET_PLAN_FOLDERS])};return a?n?e.jsx(H,{p:1,children:a.length===0?e.jsx(Gt,{}):e.jsxs(it,{children:[e.jsxs(H,{sx:{display:"flex"},justifyContent:"space-between",alignItems:"center",children:[e.jsx(lt,{title:t("planList"),p:2}),e.jsxs(S,{spacing:1,direction:"row",alignItems:"center",pr:2,children:[e.jsx(Wt,{allPlans:a,setSelectedPlans:m=>{w(m)},allFolders:n,setSelectedFolders:m=>{p(m),R([L,E.GET_PLAN_FOLDERS])}}),e.jsx(Nt,{allPlans:a,setSelectedPlans:b}),e.jsx(dt,{label:e.jsx(y,{variant:"body2",color:"secondary",sx:{userSelect:"none"},children:t(h?"showFolders":"hideFolders")}),control:e.jsx(ct,{sx:{m:1},size:"small",checked:h,onChange:()=>{u(!h)}})}),e.jsx(ut,{userPlans:i})]})]}
1),e.jsxs(H,{children:[e.jsx(fe,{sx:{maxHeight:"calc(100vh - 194px)"},children:r?e.jsx(oe,{plans:a.filter(({id:m})=>r.includes(m)),folders:l?n.filter(({id:m})=>l.includes(m)):n,showFolders:h}):e.jsx(oe,{plans:a,folders:n,showFolders:h})}),e.jsx(U,{}),e.jsxs(S,{direction:"row",spacing:2,p:2,justifyContent:"flex-end",children:[e.jsx($t,{}),e.jsx(Vt,{handleDialogOpen:v})]})]}),e.jsx(Ut,{open:j,handleCreate:m=>{C(m)},handleClose:f})]})}):e.jsx(ne,{}):e.jsx(ne,{})},Gt=()=>{const{t}=I("common"),s=X(),o=()=>{const n=s==null?void 0:s.dispatch;n&&n({type:B.openInputMenu,method:W.add,form:N.plan})};return e.jsxs(ht,{variant:"outlined",children:[e.jsx(Ft,{title:t("welcomeDialogTitle")}),e.jsx(Ct,{children:e.jsxs(H,{px:4,children:[e.jsx(y,{component:"p",children:t("welcomeDialogContent")}),e.jsx(H,{mx:10,my:5,children:e.jsx(k,{type:"submit",size:"large",fullWidth:!0,disableElevation:!0,variant:"contained",color:"primary",onClick:o,"data-testid":"plan-add-button",children:t("welcomeDialogCTAButtonText")})})]})})]})},$t=()=>{var o;const t=(o=X())==null?void 0:o.dispatch,{t:s}=I("common");return e.jsx(k,{variant:"contained",size:"small",color:"primary",style:{textTransform:"capitalize"},onClick:()=>{t&&t({type:B.openInputMenu,form:N.plan,method:W.add})},endIcon:e.jsx(xt,{}),"data-testid":"plan-add-button",children:s("addPlan")})},Vt=({handleDialogOpen:t})=>{const{t:s}=I("common");return e.jsx(k,{variant:"contained",size:"small",color:"primary",style:{textTransform:"capitalize"},onClick:t,endIcon:e.jsx(It,{}),"data-testid":"folder-add-button",children:s("addFolder")})};export{Qt as default}; 2//# sourceMappingURL=PlanListView-CGp5EwFA.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.