1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dp5gMkNH.js","assets/react-query-DbGahily.js","assets/index-D2w6--me.js","assets/react-vendor-6ULW7vKx.js","assets/notifications-2QZES2T9.js","assets/ui-utils-4YCDwm7v.js","assets/state-management-C8FSCvW-.js","assets/date-fns-core-B257BzXA.js","assets/router-Da9mPixd.js","assets/fontawesome-DBd3jlEg.js","assets/radix-ui-Bm2DdM33.js","assets/api-utils-DeT0SS0P.js","assets/tiptap-complete-BDArfEOb.js","assets/collaboration-protocols-oLklGwa8.js","assets/collaboration-provider-DYKWCpdb.js","assets/lucide-icons-jmdBoKez.js","assets/virtualization-BoefKlzQ.js","assets/react-day-picker-BRaEi7x0.js","assets/index-Dl0MwrGK.css","assets/EntityGuidance-Dq8Y42OA.js","assets/tooltip-zTcPyZNv.js","assets/tooltip-BhZJtRzQ.css","assets/index-Ba8k4fcm.js","assets/useDocumentRegistryQueries-d4J-M7mU.js","assets/DocumentRegistryService-D349cyVH.js"])))=>i.map(i=>d[i]); 2import{a as e,j as t,_ as a}from"./react-query-DbGahily.js";import{t as s,L as l,aG as i,ad as n,ar as r,au as o,aa as c,be as d,b6 as m,c9 as p,ca as u,o as f,G as x,l as h,b8 as g,aV as y,i as v,bb as j,dM as b,ab as w,aW as _}from"./index-D2w6--me.js";import{S}from"./SettingsLoading-CSKhDUHQ.js";import{aY as k,aZ as C,a_ as N,F as T,a$ as E,M as A,C as F,D as R,b0 as L}from"./fontawesome-DBd3jlEg.js";import{P as M}from"./PageHeader-DyNHZ9Ue.js";import{t as P}from"./meetingTemplate--ApNn0eO.js";import{T as I}from"./ToolkitProvenanceBadge-C-yzHoZG.js";import{u as $}from"./useToolkitRowGate-C55nYxiC.js";import{t as z}from"./notifications-2QZES2T9.js";import{u as D}from"./router-Da9mPixd.js";import{t as W}from"./canvasTemplate-cd2OeQAw.js";import"./react-vendor-6ULW7vKx.js";import"./ui-utils-4YCDwm7v.js";import"./state-management-C8FSCvW-.js";import"./date-fns-core-B257BzXA.js";import"./radix-ui-Bm2DdM33.js";import"./api-utils-DeT0SS0P.js";import"./tiptap-complete-BDArfEOb.js";import"./collaboration-protocols-oLklGwa8.js";import"./collaboration-provider-DYKWCpdb.js";import"./lucide-icons-jmdBoKez.js";import"./virtualization-BoefKlzQ.js";import"./react-day-picker-BRaEi7x0.js";import"./tooltip-ka_-ysgt.js"; 3/*! 4 * Font Awesome Pro 7.3.1 by @fontawesome - https://fontawesome.com 5 * License - https://fontawesome.com/license (Commercial License) 6 * Copyright 2026 Fonticons, Inc. 7 */var O={prefix:"fat",iconName:"filter",icon:[512,512,[],"f0b0","M32 80c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l185 185c1.5 1.5 2.3 3.5 2.3 5.7L208 416c0 4.2 1.7 8.3 4.7 11.3l64 64c4.6 4.6 11.5 5.9 17.4 3.5s9.9-8.3 9.9-14.8l0-182.1c0-2.1 .8-4.2 2.3-5.7l185-185c4.6-4.6 5.9-11.5 3.5-17.4S486.5 80 480 80L32 80zM2.4 83.8C7.4 71.8 19.1 64 32 64l448 0c12.9 0 24.6 7.8 29.6 19.8l0 0c5 12 2.2 25.7-6.9 34.9L320 301.3 320 480c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-64-64c-6-6-9.4-14.1-9.4-22.6L192 301.3 9.4 118.6C.2 109.5-2.5 95.7 2.4 83.8z"]};function V(a){const c=s.c(23),{options:d,activeFilters:m,onToggle:p,entityNoun:u}=a,[f,x]=e.useState(!1),h=m.size,g=d.length,y=g>0&&h===g,v=0===h;let j;j=v?k:y?C:h===g-1?N:O;const b=v?`Filter ${u} (no options selected)`:y?`Filter ${u}`:`Filter ${u} (${h} active)`,w=!y,_=y&&"text-purple-contio-600 hover:text-purple-contio-700",S=v&&"text-coral-contio-600 hover:text-coral-contio-700";let A,F,R,L,M,P;if(c[0]!==_||c[1]!==S?(A=l("rounded-sm text-gray-contio-500 hover:text-gray-contio-700",_,S),c[0]=_,c[1]=S,c[2]=A):A=c[2],c[3]!==j?(F=t.jsx(T,{icon:j,size:"lg"}),c[3]=j,c[4]=F):F=c[4],c[5]!==b||c[6]!==w||c[7]!==A||c[8]!==F?(R=t.jsx(i,{asChild:!0,children:t.jsx(n,{variant:"ghost",color:"dark",size:"icon-sm","aria-label":b,"aria-pressed":w,className:A,children:F})}),c[5]=b,c[6]=w,c[7]=A,c[8]=F,c[9]=R):R=c[9],c[10]!==m||c[11]!==p||c[12]!==d){let e;c[14]!==m||c[15]!==p?(e=e=>{const{value:a,label:s}=e,i=m.has(a);return t.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":i,onClick:()=>p(a),className:"flex h-8 w-full cursor-pointer items-center gap-2 rounded-lg px-3 text-md leading-4.5 font-semibold text-gray-contio-700 transition-colors outline-none select-none hover:bg-gray-contio-50",children:[t.jsx(T,{icon:E,className:l("size-4 shrink-0 text-purple-contio-600",!i&&"invisible")}),t.jsx("span",{className:"truncate",children:s})]},a)},c[14]=m,c[15]=p,c[16]=e):e=c[16],L=d.map(e),c[10]=m,c[11]=p,c[12]=d,c[13]=L}else L=c[13];return c[17]!==L?(M=t.jsx(r,{align:"start",className:"w-48 bg-white p-0 pt-1.5 pb-1",children:L}),c[17]=L,c[18]=M):M=c[18],c[19]!==f||c[20]!==R||c[21]!==M?(P=t.jsxs(o,{open:f,onOpenChange:x,children:[R,M]}),c[19]=f,c[20]=R,c[21]=M,c[22]=P):P=c[22],P}const K=e.lazy(()=>a(()=>import("./index-Dp5gMkNH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(e=>({default:e.ToolkitDetailsModal}))),Y=[{value:"mine",label:"Mine"},{value:"shared",label:"Shared With Me"},{value:"workspace",label:"Workspace"},{value:"system",label:"System"},{value:"vertical",label:"Vertical"}],G=new Set(Y.map(e=>e.value)),J="templates:access-filters";function U(){return new Set(Y.map(e=>e.value))}const B={FINADV:"Financial Advisors"},q=e=>{if(!e.toolkit_id)return"USER";switch(e.ownership_type){case"SYSTEM":case"VERTICAL":case"PARTNER":return"SYSTEM";case"WORKSPACE":return"WORKSPACE";default:return"USER"}};const Z=e=>{const a=s.c(36),{template:l,owner:i,canEdit:n,isCopying:r,isWorkspaceAdmin:o,onEdit:c,onCopy:d,onDelete:m,onBadgeDetailsClick:p}=e,{isLocked:u,openToolkitPaywall:f}=$(l);let x;a[0]!==u||a[1]!==c||a[2]!==f||a[3]!==l?(x=()=>{u?f():c(l)},a[0]=u,a[1]=c,a[2]=f,a[3]=l,a[4]=x):x=a[4];const h=x,y=`Duplicate ${l.name||"template"}`;let v,j,b,w;a[5]!==d||a[6]!==l?(v=()=>d(l),a[5]=d,a[6]=l,a[7]=v):v=a[7],a[8]!==y||a[9]!==v?(j={id:"duplicate",label:"Duplicate",icon:L,ariaLabel:y,onClick:v},a[8]=y,a[9]=v,a[10]=j):j=a[10],a[11]!==n||a[12]!==m||a[13]!==l?(b=n?[{id:"delete",label:"Delete",icon:A,destructive:!0,ariaLabel:`Delete ${l.name||"template"}`,onClick:()=>m(l)}
7]:[],a[11]=n,a[12]=m,a[13]=l,a[14]=b):b=a[14],a[15]!==j||a[16]!==b?(w=[j,...b],a[15]=j,a[16]=b,a[17]=w):w=a[17];const _=w,S=u?`${l.name} - Requires Elite plan to edit`:n?`Edit template ${l.name}`:`View template ${l.name}`;let k;a[18]!==l?(k=function(e){return"VERTICAL"===e.ownership_type&&e.vertical_abbrev?`${B[e.vertical_abbrev]??e.vertical_abbrev}: ${e.name}`:e.name}(l),a[18]=l,a[19]=k):k=a[19];const C=`template-item-${l.id}`;let N,T;return a[20]!==o||a[21]!==p||a[22]!==l?(N=l.toolkit_id?t.jsx(I,{className:"shrink-0",ownershipType:q(l),toolkitId:l.toolkit_id,toolkitSlug:l.toolkit_slug,toolkitName:l.toolkit_name,toolkitVersion:l.toolkit_version,usageGuidance:l.usage_guidance,showLabel:!1,clickable:o,onDetailsClick:o?()=>p(l.toolkit_id):void 0,size:"sm"}):void 0,a[20]=o,a[21]=p,a[22]=l,a[23]=N):N=a[23],a[24]!==_||a[25]!==S||a[26]!==h||a[27]!==r||a[28]!==u||a[29]!==i||a[30]!==k||a[31]!==C||a[32]!==N||a[33]!==l.description||a[34]!==l.updated_at?(T=t.jsx(g,{title:k,description:l.description,updatedAt:l.updated_at,owner:i,actionItems:_,actionsLoading:r,onClick:h,locked:u,ariaLabel:S,testId:C,badge:N}),a[24]=_,a[25]=S,a[26]=h,a[27]=r,a[28]=u,a[29]=i,a[30]=k,a[31]=C,a[32]=N,a[33]=l.description,a[34]=l.updated_at,a[35]=T):T=a[35],T},H=({embedded:a=!1})=>{const s=D(),{featureFlagKeys:l,flagsLoading:i}=c(),{data:r}=d(),[o,g]=e.useState([]),[v,j]=e.useState(!0),[b,w]=e.useState(!1),[_,k]=e.useState(null),[C,N]=e.useState(null),[E,A]=e.useState(null),L=e.useRef(null),[I,$]=e.useState(""),[W]=m(I,250),[O,B]=e.useState(()=>function(){if("undefined"==typeof window)return U();try{const e=window.localStorage.getItem(J);if(null===e)return U();const t=JSON.parse(e);if(!Array.isArray(t))return U();const a=t.filter(e=>"string"==typeof e&&G.has(e));
7return new Set(a)}catch{return U()}}());e.useEffect(()=>{if("undefined"!=typeof window)try{window.localStorage.setItem(J,JSON.stringify(Array.from(O)))}catch{}},[O]);const q=!!r&&p("edit_workspace_settings",u(r)).hasPermission,H=e.useCallback(e=>function(e,t){return!t.flagsLoading&&(!e||("SYSTEM"===e?t.featureFlagKeys.includes("meeting_templates_can_edit_system"):"VERTICAL"===e?t.featureFlagKeys.includes("meeting_templates_can_edit_verticals"):"WORKSPACE"===e&&t.isWorkspaceAdmin))}(e,{isWorkspaceAdmin:q,featureFlagKeys:l??[],flagsLoading:i}),[q,l,i]),X=async()=>{j(!0),k(null);try{const e=await h.getApiMeetingTemplates(100);g((e.items??[]).map(P))}catch(e){const t=e instanceof Error?e.message:"Failed to load templates";k(t),x.error("Failed to fetch templates:",e)}finally{j(!1)}};e.useEffect(()=>{X()},[]);const ee=e.useCallback(async e=>{L.current||(L.current=f.getToolkitsInstalled().then(e=>e.items??[]).catch(e=>{throw L.current=null,x.error("Failed to fetch installed toolkits:",e),z.error("Failed to load toolkit details."),e}));try{const t=(await L.current).find(t=>t.id===e);t&&A(t)}catch{}},[]),te=e.useMemo(()=>r?.id?{user_id:r.id,name:r.name,email:r.email,profile_image_url:r.profile_image_url}:null,[r]),ae=e.useCallback(e=>{switch(e.ownership_type){case"SYSTEM":case"VERTICAL":case"PARTNER":return{kind:"system"};case"WORKSPACE":return{kind:"none"};default:return te&&e.owned_by_user_id===te.user_id?{kind:"user",user:te}:{kind:"none"}}},[te]),se=e.useMemo(()=>{const e=W.trim().toLowerCase();return o.filter(t=>{const a=function(e,t){switch(e.ownership_type){case"WORKSPACE":return"workspace";case"SYSTEM":case"PARTNER":return"system";case"VERTICAL":return"vertical";default:return t&&e.owned_by_user_id===t?"mine":"VIEWER"===e.workspace_template_role?"workspace":"shared"}}(t,r?.id);if(!a||!O.has(a))return!1;if(0===e.length)return!0;const s=(t.name??"").toLowerCase(),l=(t.description??"").toLowerCase();return s.includes(e)||l.includes(e)})},[o,O,W,r?.id]),le=e=>{s(`/templates/${e.id}`)},ie=async e=>{N(e.id);try{await h.postApiMeetingTemplatesCopy(e.id,{}),B(e=>{if(e.has("mine"))return e;const t=new Set(e);return t.add("mine"),t}),X()}catch(t){x.error("[TemplatesPage] Failed to copy template:",t),z.error("Failed to duplicate template")}finally{N(null)}},ne=async e=>{const t=o;g(t=>t.filter(t=>t.id!==e.id));try{await h.deleteApiMeetingTemplates(e.id),z.success("Template deleted")}catch(a){x.error("[TemplatesPage] Failed to delete template:",a),g(t),z.error("Failed to delete template")}},re=H(void 0),oe=O.size>0,ce=O.size===Y.length,de=O.size>0&&!ce||I.trim().length>0,me=t.jsxs(t.Fragment,{children:[t.jsx(V,{options:Y,activeFilters:O,onToggle:e=>{B(t=>{const a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},entityNoun:"templates"}),t.jsx(y,{type:"text",placeholder:"Search templates...",value:I,onChange:e=>$(e.target.value),size:"sm",leftIcon:t.jsx(T,{icon:F}),containerClassName:"w-[12.5rem]","aria-label":"Search templates"}),t.jsx(n,{variant:"solid",color:"brand",icon:t.jsx(T,{icon:R}),className:re?void 0:"invisible",onClick:()=>{(async()=>{w(!0);try{const e=await h.postApiMeetingTemplates({name:"Untitled Template"}),t=P(e);s(`/templates/${t.id}`)}catch(e){x.error("[TemplatesPage] Failed to create template:",e)}finally{w(!1)}})()},loading:b,disabled:!re,"data-testid":"create-template-button",children:"New Template"})]}),pe=oe?v?t.jsx(S,{}):_?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx("p",{className:"mb-2 text-xl text-red-500",children:_}),t.jsx(n,{variant:"outline",color:"secondary",onClick:X,"data-testid":"retry-button",children:"Retry"})]}):0===se.length?t.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:t.jsx("p",{className:"text-xl text-gray-contio-500",children:de?"No templates match the current filters":"No templates yet"})}):se.map(e=>t.jsx(Z,{template:e,owner:ae(e),canEdit:H(e.ownership_type),isCopying:C===e.id,isWorkspaceAdmin:q,onEdit:le,onCopy:ie,onDelete:ne,onBadgeDetailsClick:ee},e.id)):t.jsx(Q,{}),ue=E&&t.jsx(e.Suspense,{fallback:null,children:t.jsx(K,{toolkit:E,open:!!E,onOpenChange:e=>{e||A(null)}})});return a?t.jsxs("div",{"data-testid":"templates-page",className:"flex h-full flex-col",children:[t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-gray-contio-50 p-4 pb-22",children:v?t.jsx(S,{}):t.jsxs("div",{className:"flex max-w-2xl flex-col gap-4 overflow-visible",children:[t.jsx("div",{className:"flex flex-wrap items-center justify-end gap-3",children:me}),t.jsx("div",{className:"flex flex-col gap-2",children:pe})]})}),ue]}):t.jsxs("div",{"data-testid":"templates-page",className:"inline-flex min-h-full w-full flex-col self-stretch border-l border-gray-contio-200 bg-gray-contio-50",children:[t.jsx(M,{title:"Meeting Templates",actions:me}),t.jsx("div",{className:"flex flex-1 flex-col gap-2 overflow-y-auto p-4",children:pe}),ue]})},Q=()=>{const e=s.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[t.jsx(T,{icon:k,className:"mb-4 text-coral-contio-600",size:"2x"}),t.jsx("h3",{className:"mb-2 text-xl font-medium text-foreground",children:"No filters selected"}),t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:"Please select one or more filters above to see your templates."})]}),e[0]=a):a=e[0],a},X=e=>`/canvas-templates/${e}`,ee=[{value:"mine",label:"Mine"},{value:"shared",label:"Shared With Me"},{value:"workspace",label:"Workspace"},{value:"system",label:"System"}],te=new Set(ee.map(e=>e.value)),ae="canvas-templates:access-filters";function se(){return new Set(ee.map(e=>e.value))}const le=e=>{const a=s.c(25),{template:l,owner:i,isCopying:n,onEdit:r,onCopy:o,onDelete:c}=e,d=`Duplicate ${l.name||"canvas template"}`;let m,p,u,f;a[0]!==o||a[1]!==l?(m=()=>o(l),a[0]=o,a[1]=l,a[2]=m):m=a[2],a[3]!==d||a[4]!==m?(p={id:"duplicate",label:"Duplicate",icon:L,ariaLabel:d,onClick:m},a[3]=d,a[4]=m,a[5]=p):p=a[5],a[6]!==c||a[7]!==l?(u=l.can_edit?[{id:"delete",label:"Delete",icon:A,destructive:!0,ariaLabel:`Delete ${l.name||"canvas template"}`,onClick:()=>c(l)}]:[],a[6]=c,a[7]=l,a[8]=u):u=a[8],a[9]!==p||a[10]!==u?(f=[p,...u],a[9]=p,a[10]=u,a[11]=f):f=a[
711];const x=f,h=l.can_edit?`Edit canvas template ${l.name}`:`View canvas template ${l.name}`;let y;a[12]!==r||a[13]!==l?(y=()=>r(l),a[12]=r,a[13]=l,a[14]=y):y=a[14];const v=`canvas-template-item-${l.id}`;let j;return a[15]!==x||a[16]!==h||a[17]!==n||a[18]!==i||a[19]!==y||a[20]!==v||a[21]!==l.description||a[22]!==l.name||a[23]!==l.updated_at?(j=t.jsx(g,{title:l.name,description:l.description,updatedAt:l.updated_at,owner:i,actionItems:x,actionsLoading:n,onClick:y,ariaLabel:h,testId:v}),a[15]=x,a[16]=h,a[17]=n,a[18]=i,a[19]=y,a[20]=v,a[21]=l.description,a[22]=l.name,a[23]=l.updated_at,a[24]=j):j=a[24],j},ie=({embedded:a=!1})=>{const s=D(),{data:l}=d(),[i,r]=e.useState([]),[o,c]=e.useState(!0),[p,u]=e.useState(!1),[f,h]=e.useState(null),[g,b]=e.useState(null),[w,_]=e.useState(""),[k]=m(w,250),[C,N]=e.useState(()=>function(){if("undefined"==typeof window)return se();try{const e=window.localStorage.getItem(ae);if(null===e)return se();const t=JSON.parse(e);if(!Array.isArray(t))return se();const a=t.filter(e=>"string"==typeof e&&te.has(e));
7return new Set(a)}catch{return se()}}());e.useEffect(()=>{if("undefined"!=typeof window)try{window.localStorage.setItem(ae,JSON.stringify(Array.from(C)))}catch{}},[C]);const E=async()=>{c(!0),h(null);try{const e=await v.getCanvasTemplates(100);r((e.items??[]).map(W))}catch(e){const t=e instanceof Error?e.message:"Failed to load canvas templates";h(t),x.error("Failed to fetch canvas templates:",e)}finally{c(!1)}};e.useEffect(()=>{E()},[]);const A=e.useMemo(()=>l?.id?{user_id:l.id,name:l.name,email:l.email,profile_image_url:l.profile_image_url}:null,[l]),L=e.useCallback(e=>{switch(e.ownership_type){case"SYSTEM":case"PARTNER":return{kind:"system"};case"WORKSPACE":return{kind:"none"};default:return A&&e.owned_by_user_id===A.user_id?{kind:"user",user:A}:{kind:"none"}}},[A]),P=e.useMemo(()=>{const e=k.trim().toLowerCase();return i.filter(t=>{const a=function(e,t){switch(e.ownership_type){case"SYSTEM":case"PARTNER":return"system";case"WORKSPACE":return"workspace";default:return t&&e.owned_by_user_id===t?"mine":"VIEWER"===e.workspace_canvas_template_role?"workspace":"shared"}}(t,l?.id);if(!C.has(a))return!1;if(0===e.length)return!0;const s=(t.name??"").toLowerCase(),i=(t.description??"").toLowerCase();return s.includes(e)||i.includes(e)})},[i,C,k,l?.id]),I=e=>{s(X(e.id))},$=async e=>{b(e.id);try{await v.postCanvasTemplatesCopy(e.id),N(e=>{if(e.has("mine"))return e;const t=new Set(e);return t.add("mine"),t}),E()}catch(t){x.error("[CanvasTemplatesTab] Failed to copy canvas template:",t),z.error("Failed to duplicate canvas template")}finally{b(null)}},O=async e=>{if(!(await j({operation:"delete",entity:"canvas template",entityName:e.name})))return;const t=i;r(t=>t.filter(t=>t.id!==e.id));try{await v.deleteCanvasTemplates(e.id),z.success("Canvas template deleted")}catch(a){x.error("[CanvasTemplatesTab] Failed to delete canvas template:",a),r(t),z.error("Failed to delete canvas template")}},K=C.size>0,Y=C.size===ee.length,G=C.size>0&&!Y||w.trim().length>0,J=t.jsxs(t.Fragment,{children:[t.jsx(V,{options:ee,activeFilters:C,onToggle:e=>{N(t=>{const a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},entityNoun:"canvas templates"}),t.jsx(y,{type:"text",placeholder:"Search canvas templates...",value:w,onChange:e=>_(e.target.value),size:"sm",leftIcon:t.jsx(T,{icon:F}),containerClassName:"w-[12.5rem]","aria-label":"Search canvas templates"}),t.jsx(n,{variant:"solid",color:"brand",size:"sm",icon:t.jsx(T,{icon:R}),onClick:()=>{(async()=>{u(!0);try{const e=await v.postCanvasTemplates({name:"Untitled Canvas Template"}),t=W(e);s(X(t.id))}catch(e){x.error("[CanvasTemplatesTab] Failed to create canvas template:",e),z.error("Failed to create canvas template")}finally{u(!1)}})()},loading:p,"data-testid":"create-canvas-template-button",children:"New Template"})]}),U=K?o?t.jsx(S,{}):f?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx("p",{className:"mb-2 text-xl text-red-500",children:f}),t.jsx(n,{variant:"outline",color:"secondary",onClick:E,"data-testid":"retry-button",children:"Retry"})]}):0===P.length?t.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:t.jsx("p",{className:"text-xl text-gray-contio-500",children:G?"No canvas templates match the current filters":"No canvas templates yet"})}):P.map(e=>t.jsx(le,{template:e,owner:L(e),isCopying:g===e.id,onEdit:I,onCopy:$,onDelete:O},e.id)):t.jsx(ne,{});return a?t.jsx("div",{"data-testid":"canvas-templates-page",className:"flex h-full flex-col",children:t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-gray-contio-50 p-4 pb-22",children:o?t.jsx(S,{}):t.jsxs("div",{className:"flex max-w-2xl flex-col gap-4 overflow-visible",children:[t.jsx("div",{className:"flex flex-wrap items-center justify-end gap-3",children:J}),t.jsx("div",{className:"flex flex-col gap-2",children:U})]})})}):t.jsxs("div",{"data-testid":"canvas-templates-page",className:"inline-flex min-h-full w-full flex-col self-stretch border-l border-gray-contio-200 bg-gray-contio-50",children:[t.jsx(M,{title:"Canvas Templates",actions:J}),t.jsx("div",{className:"flex flex-1 flex-col gap-2 overflow-y-auto p-4",children:U})]})},ne=()=>{const e=s.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[t.jsx(T,{icon:k,className:"mb-4 text-coral-contio-600",size:"2x"}),t.jsx("h3",{className:"mb-2 text-xl font-medium text-foreground",children:"No filters selected"}),t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:"Please select one or more filters above to see your canvas templates."})]}),e[0]=a):a=e[0],a},re=e.lazy(()=>a(()=>import("./index-Ba8k4fcm.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,23,24]))),oe=a=>{const l=s.c(31),{activeTab:i}=a,n=D(),{featureFlagKeys:r}=c();let o;l[0]!==r?(o=void 0===r?[]:r,l[0]=r,l[1]=o):o=l[1];const d=o;let m;l[2]!==d?(m=b(d),l[2]=d,l[3]=m):m=l[3];const p=m;let u,f,x,h;l[4]!==p.meetings?(u=p.meetings?[{id:"meetings",label:"Meetings"}
7]:[],l[4]=p.meetings,l[5]=u):u=l[5],l[6]!==p.canvases?(f=p.canvases?[{id:"canvases",label:"Canvases"}]:[],l[6]=p.canvases,l[7]=f):f=l[7],l[8]!==p.pdfs?(x=p.pdfs?[{id:"pdfs",label:"PDFs"}]:[],l[8]=p.pdfs,l[9]=x):x=l[9],l[10]!==u||l[11]!==f||l[12]!==x?(h=[...u,...f,...x],l[10]=u,l[11]=f,l[12]=x,l[13]=h):h=l[13];const g=h;let y;l[14]!==i||l[15]!==g?(y=g.some(e=>e.id===i)?i:g[0]?.id,l[14]=i,l[15]=g,l[16]=y):y=l[16];const v=y,j=v??"";let k,C;l[17]!==n?(k=e=>{n(`/settings/templates/${e}`)},l[17]=n,l[18]=k):k=l[18],l[19]!==k||l[20]!==j||l[21]!==g?(C=t.jsx(w,{title:"Templates",tabs:t.jsx(_,{tabs:g,activeTabId:j,onTabChange:k})}),l[19]=k,l[20]=j,l[21]=g,l[22]=C):C=l[22];const N=`templates-${v}-panel`;let T,E,A;return l[23]!==v?(T="meetings"===v?t.jsx(H,{embedded:!0}):"pdfs"===v?t.jsx(e.Suspense,{fallback:t.jsx(S,{}),children:t.jsx(re,{})}):"canvases"===v?t.jsx(ie,{embedded:!0}):null,l[23]=v,l[24]=T):T=l[24],l[25]!==N||l[26]!==T?(E=t.jsx("div",{className:"min-h-0 flex-1 bg-gray-contio-50","data-testid":N,children:T}),l[25]=N,l[26]=T,l[27]=E):E=l[27],l[28]!==C||l[29]!==E?(A=t.jsxs("div",{className:"flex h-full flex-col",children:[C,E]}),l[28]=C,l[29]=E,l[30]=A):A=l[30],A};export{oe as default};
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.