@shumai-one/shumai 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{g as B}from"./chunk-qgq96tbp.js";import"./chunk-vt4zpasm.js";import"./chunk-8yz1expv.js";import"./chunk-nzy3pjjm.js";import"./chunk-h270n69j.js";import"./chunk-mqbxagfd.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import"./chunk-5e1xqaj4.js";import"./chunk-ejfmxjw6.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-pgae67hk.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import"./chunk-nr89225z.js";import{Ah as w,ih as q}from"./chunk-b1e3tec3.js";import"./chunk-ws07a9kv.js";function O(){let{shareId:C,fileId:D}=k.useParams(),{start:E,version:G,compare:H,cmpLeft:J,cmpRight:K,cmpActive:N}=k.useSearch();return q(B,{shareId:C,initialFileId:D,startTime:E,versionId:G,compare:H,compareLeftId:J,compareRightId:K,compareActiveSide:N})}var k=w("/share/$shareId/files/$fileId")({component:O});export{k as Route};
1
+ import{g as B}from"./chunk-jstc7pka.js";import"./chunk-rrxjvewm.js";import"./chunk-8e5zvy88.js";import"./chunk-nzy3pjjm.js";import"./chunk-mm1j72a8.js";import"./chunk-9c7fxjej.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import"./chunk-6t3gdd7e.js";import"./chunk-ejfmxjw6.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-z0ej44ak.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import"./chunk-nr89225z.js";import{Ah as w,ih as q}from"./chunk-b1e3tec3.js";import"./chunk-ws07a9kv.js";function O(){let{shareId:C,fileId:D}=k.useParams(),{start:E,version:G,compare:H,cmpLeft:J,cmpRight:K,cmpActive:N}=k.useSearch();return q(B,{shareId:C,initialFileId:D,startTime:E,versionId:G,compare:H,compareLeftId:J,compareRightId:K,compareActiveSide:N})}var k=w("/share/$shareId/files/$fileId")({component:O});export{k as Route};
@@ -1 +1 @@
1
- import{j as V}from"./chunk-0ed7h2xm.js";import"./chunk-bmqw3j2d.js";import"./chunk-zx9cv3t8.js";import"./chunk-8yz1expv.js";import"./chunk-nzy3pjjm.js";import"./chunk-h270n69j.js";import"./chunk-mqbxagfd.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import{jf as U}from"./chunk-ph3e1bpp.js";import"./chunk-qc6dmzn0.js";import{Bf as N}from"./chunk-ve7v8wtv.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-pgae67hk.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import{bh as K}from"./chunk-nr89225z.js";import{Ah as H,Mh as J,gh as Z,ih as q,nh as B,oh as G}from"./chunk-b1e3tec3.js";import{Xk as Y}from"./chunk-ws07a9kv.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await J.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:"recently-deleted",rootFolderId:b})}var $=H("/projects/$projectId/recently-deleted")({component:_});export{$ as Route};
1
+ import{j as V}from"./chunk-k0a35mg9.js";import"./chunk-qn96vbke.js";import"./chunk-d3s00sn0.js";import"./chunk-8e5zvy88.js";import"./chunk-nzy3pjjm.js";import"./chunk-mm1j72a8.js";import"./chunk-9c7fxjej.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import{jf as U}from"./chunk-ph3e1bpp.js";import"./chunk-qc6dmzn0.js";import{Bf as N}from"./chunk-ve7v8wtv.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-z0ej44ak.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import{bh as K}from"./chunk-nr89225z.js";import{Ah as H,Mh as J,gh as Z,ih as q,nh as B,oh as G}from"./chunk-b1e3tec3.js";import{Xk as Y}from"./chunk-ws07a9kv.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await J.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:"recently-deleted",rootFolderId:b})}var $=H("/projects/$projectId/recently-deleted")({component:_});export{$ as Route};
@@ -1,2 +1,2 @@
1
- import{$f as Qf,Qf as Rf,Rf as Lf,Sf as Vf,Tf as Cf,Yf as Hf,Zf as Jf,_f as Kf,ag as Wf,dg as _f}from"./chunk-7y8dng8t.js";import{jg as Zf,kg as Gf}from"./chunk-pgae67hk.js";import{pg as zf}from"./chunk-h2wsm7h3.js";import{qg as $f}from"./chunk-etces6ff.js";import{$g as l,Rg as Sf,Sg as a,Tg as Nf,Ug as Uf,Vg as W,Yg as qf,Zg as g,_g as p,ah as c,ch as Xf}from"./chunk-nr89225z.js";import{Gi as n,Mh as i,Ni as o,Qi as s,Th as x,Ui as ff,ak as D,hh as O,ih as f,ik as X,jh as V,ki as e,pi as j,qi as r,vh as u,xh as d}from"./chunk-b1e3tec3.js";function Yf({teamId:K,projectId:L,projectName:_,ancestorFolders:B,currentAsset:U,isRootFolder:Y,displayStyle:E,onDisplayStyleChange:h,isLeftSidebarCollapsed:P,onLeftSidebarToggle:T,isRightSidebarCollapsed:$,onRightSidebarToggle:v,isChatbotOpen:Z=!1,onChatbotToggle:N,isPublic:Q=!1,onFolderClick:w,fileId:q,shareId:G,downloadInfo:z,versions:S,compareMode:J=!1,canCompareVersions:b=!1,onCompareVersions:A}){let k=u(),{canEdit:y}=Xf(L),I=!1,m=(R)=>{if(!q)return;if(Q&&G){k({to:"/share/$shareId/files/$fileId",params:{shareId:G,fileId:q},search:(C)=>({...C,version:R})});return}if(!L)return;k({to:"/projects/$projectId/files/$fileId",params:{projectId:L,fileId:q},search:(C)=>({...C,version:R})})},M=async(R)=>{if(!q)return;try{let C=G?await i.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:G,fileId:q},json:{key:R}}):await i.api.files["download-url"].$post({json:{key:R,assetId:q}});if(!C.ok)return;let{url:H}=await C.json(),F=document.createElement("a");F.href=H,F.download="",document.body.appendChild(F),F.click(),document.body.removeChild(F)}catch{}},Bf=U.proxyType!=="audio"&&z?.videoTranscodes&&z.videoTranscodes.filter((R)=>!R.isRaw).length>0,Ef=Q?[{name:_,id:"root"},...B.slice().reverse().map((R)=>({name:R.name||"",id:R.id}))]:[{name:X.all_projects(),path:`/teams/${K}`,isMuted:!0},{name:_,path:`/projects/${L}`},...B.slice().reverse().map((R)=>({name:R.name||"",path:`/projects/${L}/folders/${R.id}`}))];return V("div",{className:"flex h-14 flex-wrap items-center justify-between gap-2 border-b border-border bg-card px-4 py-2",children:[V("div",{className:"flex min-w-0 flex-shrink items-center gap-1",children:[Ef.map((R,C)=>V("div",{className:"flex items-center gap-1",children:[C>0&&f("span",{className:"text-muted-foreground",children:"/"}),R.path?f(d,{to:R.path,className:D("truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground",R.isMuted?"text-muted-foreground":"text-foreground"),children:R.name}):f("button",{onClick:()=>R.id&&w?.(R.id),className:"truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground text-foreground",children:R.name})]},C)),!Y&&!J&&V("div",{className:"flex items-center gap-1",children:[f("span",{className:"text-muted-foreground",children:"/"}),U.type==="folder"?f("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:U.name}):V(Sf,{children:[V(Nf,{className:"flex items-center gap-1 truncate rounded px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:[f("span",{children:U.name}),U.version!==void 0&&V(zf,{variant:"outline",className:"px-1 py-0 text-xs",children:["v",U.version]}),f(r,{className:"h-4 w-4"})]}),V(Uf,{className:"w-56",children:[Bf?V(p,{children:[f(l,{className:"flex items-center gap-2",children:f("span",{children:X.download()})}),f(a,{children:V(c,{className:"w-48",children:[f(qf,{children:X.download()}),z?.videoTranscodes?.filter((R)=>!R.isRaw).map((R)=>{let C=Math.max(R.width,R.height),H=`${R.height}p`;if(C>=3840)H="2160p";else if(C>=1920)H="1080p";else if(C>=1280)H="720p";else if(C>=960)H="540p";else if(C>=640)H="360p";else if(C>=320)H="180p";return V(W,{onClick:()=>M(R.key),className:"flex items-center justify-between",children:[f("span",{children:H}),f("span",{className:"text-xs text-muted-foreground",children:"MP4"})]},H)}),z?.originalKey&&V(O,{children:[f(g,{}),V(W,{onClick:()=>M(z.originalKey),className:"flex items-center justify-between",children:[f("span",{children:"Original"}),f("span",{className:"text-xs text-muted-foreground",children:U.name?.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):f(W,{onClick:()=>z?.originalKey&&M(z.originalKey),disabled:!z?.originalKey,children:X.download()}),y&&f(W,{onClick:()=>console.log("Rename"),children:"Rename"}),y&&f(W,{onClick:()=>console.log("Delete"),children:"Delete"}),b&&A&&V(O,{children:[f(g,{}),V(W,{onClick:()=>A(),children:[f(x,{className:"h-4 w-4"}),f("span",{children:X.compare_versions()})]})]}),S&&S.length>0&&V(O,{children:[f(g,{}),V(p,{children:[V(l,{className:"flex items-center gap-2",children:[f(o,{className:"h-4 w-4"}),f("span",{children:"Versions"})]}),f(a,{children:V(c,{className:"w-80 p-1",children:[f("div",{className:"flex flex-col gap-1 max-h-96 overflow-y-auto",children:S.map((R)=>{let C=U.version===R.version;return V(W,{onClick:()=>m(R.id),className:"flex items-center gap-3 py-2 px-3 rounded-md cursor-pointer focus:bg-accent focus:text-accent-foreground",children:[V("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted dark:bg-muted-foreground/20 text-muted-foreground dark:text-muted-foreground rounded-full px-2 py-0.5 text-xs font-semibold select-none min-w-[2rem]",children:["v",R.version]}),f("div",{className:"h-10 w-16 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:R.previewUrl?f("img",{src:R.previewUrl,alt:R.name||void 0,className:"h-full w-full object-cover"}):f(n,{className:"h-4 w-4 text-muted-foreground"})}),V("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[f("span",{className:"truncate text-sm font-semibold text-foreground",children:R.name}),f("span",{className:"truncate text-xs text-muted-foreground",children:R.creator?.name||"Unknown"})]}),C&&f(j,{className:"h-4 w-4 text-primary ml-auto flex-shrink-0"})]},R.id)})}),f(g,{}),f("div",{className:"p-1",children:f("button",{className:"w-full text-center text-xs font-medium py-2 px-3 rounded-md bg-muted/80 hover:bg-muted text-foreground transition-colors",onClick:()=>console.log("Manage versions"),children:"Manage versions..."})})]})})]})]})]})]})]})]}),V("div",{className:"flex items-center gap-2",children:[V("div",{className:"flex flex-shrink-0 items-center gap-1 rounded-md border border-border bg-background p-1",children:[!q&&!Q&&T&&f("button",{onClick:T,className:"rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",title:P?"Show Left Sidebar":"Hide Left Sidebar",children:P?f(Hf,{className:"h-4 w-4"}):f(Kf,{className:"h-4 w-4 fill-primary stroke-0"})}),!q&&!Q&&E&&h&&V(O,{children:[f("button",{onClick:()=>h("card"),className:`rounded p-1.5 transition-colors ${E==="card"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"Card View",children:f(s,{className:"h-4 w-4"})}),f("button",{onClick:()=>h("list"),className:`rounded p-1.5 transition-colors ${E==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"List View",children:f(ff,{className:"h-4 w-4"})})]}),f("button",{onClick:v,className:`rounded p-1.5 transition-colors ${!$&&!Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:$?"Show Right Sidebar":"Hide Right Sidebar",children:!$&&!Z?f(Qf,{className:"h-4 w-4 fill-primary stroke-0"}):f(Jf,{className:"h-4 w-4"})})]}),!Q&&N&&f(Rf,{children:V(Lf,{children:[f(Vf,{asChild:!0,children:f("span",{children:f("button",{disabled:!1,onClick:N,className:D("h-9 w-9 flex items-center justify-center rounded-full border border-border bg-background transition-colors",Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground",!1),children:Z?f(Wf,{className:"h-6 w-6 text-primary transition-colors"}):f(e,{className:"h-6 w-6 text-muted-foreground transition-colors"})})})}),f(Cf,{children:f("p",{children:Z?X.hide_chatbot():X.show_chatbot()})})]})})]})]})}function cf(){let{projectState:K}=Zf(),L=$f(),{isChatbotOpen:_,setIsChatbotOpen:B}=Gf();if(!K)return f(hf,{});let{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,fileId:$,downloadInfo:v,versions:Z,isPublic:N,shareId:Q,onFolderClick:w,compareMode:q,canCompareVersions:G,onCompareVersions:z}=K,S=!!$,J=!!Q&&!S,b=S?L.fileViewLeftSidebarCollapsed:J?L.shareConfigLeftSidebarCollapsed:L.fileListLeftSidebarCollapsed,A=N?void 0:()=>S?L.setFileViewLeftSidebarCollapsed(!L.fileViewLeftSidebarCollapsed):J?L.setShareConfigLeftSidebarCollapsed(!L.shareConfigLeftSidebarCollapsed):L.setFileListLeftSidebarCollapsed(!L.fileListLeftSidebarCollapsed),k=N&&K.isRightSidebarCollapsed!==void 0?K.isRightSidebarCollapsed:S?L.fileViewRightSidebarCollapsed:J?L.shareConfigRightSidebarCollapsed:L.fileListRightSidebarCollapsed,y=N&&K.onRightSidebarToggle?K.onRightSidebarToggle:()=>{if(!N&&_)if(B(!1),S)L.setFileViewRightSidebarCollapsed(!1);else if(J)L.setShareConfigRightSidebarCollapsed(!1);else L.setFileListRightSidebarCollapsed(!1);else if(S)L.setFileViewRightSidebarCollapsed(!L.fileViewRightSidebarCollapsed);else if(J)L.setShareConfigRightSidebarCollapsed(!L.shareConfigRightSidebarCollapsed);else L.setFileListRightSidebarCollapsed(!L.fileListRightSidebarCollapsed)},I=N?void 0:()=>{B(!_)},m=Y?L.viewModes[Y]??"card":"card";return f(Yf,{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,displayStyle:S||J?void 0:m,onDisplayStyleChange:S||J?void 0:N?void 0:(t)=>{if(Y)L.setViewMode(Y,t)},isLeftSidebarCollapsed:b,onLeftSidebarToggle:A,isRightSidebarCollapsed:k,onRightSidebarToggle:y,isChatbotOpen:!N&&_,onChatbotToggle:I,isPublic:N,shareId:Q,fileId:$,downloadInfo:v,versions:Z,onFolderClick:w,compareMode:q,canCompareVersions:G,onCompareVersions:z})}function hf(){return f("div",{className:"flex h-14 flex-wrap items-center justify-center gap-2 border-b border-border bg-card px-4 py-2 flex-shrink-0",children:f(_f,{className:"w-10 h-10 text-orange-600"})})}
1
+ import{$f as Qf,Qf as Rf,Rf as Lf,Sf as Vf,Tf as Cf,Yf as Hf,Zf as Jf,_f as Kf,ag as Wf,dg as _f}from"./chunk-7y8dng8t.js";import{jg as Zf,kg as Gf}from"./chunk-z0ej44ak.js";import{pg as zf}from"./chunk-h2wsm7h3.js";import{qg as $f}from"./chunk-etces6ff.js";import{$g as l,Rg as Sf,Sg as a,Tg as Nf,Ug as Uf,Vg as W,Yg as qf,Zg as g,_g as p,ah as c,ch as Xf}from"./chunk-nr89225z.js";import{Gi as n,Mh as i,Ni as o,Qi as s,Th as x,Ui as ff,ak as D,hh as O,ih as f,ik as X,jh as V,ki as e,pi as j,qi as r,vh as u,xh as d}from"./chunk-b1e3tec3.js";function Yf({teamId:K,projectId:L,projectName:_,ancestorFolders:B,currentAsset:U,isRootFolder:Y,displayStyle:E,onDisplayStyleChange:h,isLeftSidebarCollapsed:P,onLeftSidebarToggle:T,isRightSidebarCollapsed:$,onRightSidebarToggle:v,isChatbotOpen:Z=!1,onChatbotToggle:N,isPublic:Q=!1,onFolderClick:w,fileId:q,shareId:G,downloadInfo:z,versions:S,compareMode:J=!1,canCompareVersions:b=!1,onCompareVersions:A}){let k=u(),{canEdit:y}=Xf(L),I=!1,m=(R)=>{if(!q)return;if(Q&&G){k({to:"/share/$shareId/files/$fileId",params:{shareId:G,fileId:q},search:(C)=>({...C,version:R})});return}if(!L)return;k({to:"/projects/$projectId/files/$fileId",params:{projectId:L,fileId:q},search:(C)=>({...C,version:R})})},M=async(R)=>{if(!q)return;try{let C=G?await i.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:G,fileId:q},json:{key:R}}):await i.api.files["download-url"].$post({json:{key:R,assetId:q}});if(!C.ok)return;let{url:H}=await C.json(),F=document.createElement("a");F.href=H,F.download="",document.body.appendChild(F),F.click(),document.body.removeChild(F)}catch{}},Bf=U.proxyType!=="audio"&&z?.videoTranscodes&&z.videoTranscodes.filter((R)=>!R.isRaw).length>0,Ef=Q?[{name:_,id:"root"},...B.slice().reverse().map((R)=>({name:R.name||"",id:R.id}))]:[{name:X.all_projects(),path:`/teams/${K}`,isMuted:!0},{name:_,path:`/projects/${L}`},...B.slice().reverse().map((R)=>({name:R.name||"",path:`/projects/${L}/folders/${R.id}`}))];return V("div",{className:"flex h-14 flex-wrap items-center justify-between gap-2 border-b border-border bg-card px-4 py-2",children:[V("div",{className:"flex min-w-0 flex-shrink items-center gap-1",children:[Ef.map((R,C)=>V("div",{className:"flex items-center gap-1",children:[C>0&&f("span",{className:"text-muted-foreground",children:"/"}),R.path?f(d,{to:R.path,className:D("truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground",R.isMuted?"text-muted-foreground":"text-foreground"),children:R.name}):f("button",{onClick:()=>R.id&&w?.(R.id),className:"truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground text-foreground",children:R.name})]},C)),!Y&&!J&&V("div",{className:"flex items-center gap-1",children:[f("span",{className:"text-muted-foreground",children:"/"}),U.type==="folder"?f("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:U.name}):V(Sf,{children:[V(Nf,{className:"flex items-center gap-1 truncate rounded px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:[f("span",{children:U.name}),U.version!==void 0&&V(zf,{variant:"outline",className:"px-1 py-0 text-xs",children:["v",U.version]}),f(r,{className:"h-4 w-4"})]}),V(Uf,{className:"w-56",children:[Bf?V(p,{children:[f(l,{className:"flex items-center gap-2",children:f("span",{children:X.download()})}),f(a,{children:V(c,{className:"w-48",children:[f(qf,{children:X.download()}),z?.videoTranscodes?.filter((R)=>!R.isRaw).map((R)=>{let C=Math.max(R.width,R.height),H=`${R.height}p`;if(C>=3840)H="2160p";else if(C>=1920)H="1080p";else if(C>=1280)H="720p";else if(C>=960)H="540p";else if(C>=640)H="360p";else if(C>=320)H="180p";return V(W,{onClick:()=>M(R.key),className:"flex items-center justify-between",children:[f("span",{children:H}),f("span",{className:"text-xs text-muted-foreground",children:"MP4"})]},H)}),z?.originalKey&&V(O,{children:[f(g,{}),V(W,{onClick:()=>M(z.originalKey),className:"flex items-center justify-between",children:[f("span",{children:"Original"}),f("span",{className:"text-xs text-muted-foreground",children:U.name?.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):f(W,{onClick:()=>z?.originalKey&&M(z.originalKey),disabled:!z?.originalKey,children:X.download()}),y&&f(W,{onClick:()=>console.log("Rename"),children:"Rename"}),y&&f(W,{onClick:()=>console.log("Delete"),children:"Delete"}),b&&A&&V(O,{children:[f(g,{}),V(W,{onClick:()=>A(),children:[f(x,{className:"h-4 w-4"}),f("span",{children:X.compare_versions()})]})]}),S&&S.length>0&&V(O,{children:[f(g,{}),V(p,{children:[V(l,{className:"flex items-center gap-2",children:[f(o,{className:"h-4 w-4"}),f("span",{children:"Versions"})]}),f(a,{children:V(c,{className:"w-80 p-1",children:[f("div",{className:"flex flex-col gap-1 max-h-96 overflow-y-auto",children:S.map((R)=>{let C=U.version===R.version;return V(W,{onClick:()=>m(R.id),className:"flex items-center gap-3 py-2 px-3 rounded-md cursor-pointer focus:bg-accent focus:text-accent-foreground",children:[V("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted dark:bg-muted-foreground/20 text-muted-foreground dark:text-muted-foreground rounded-full px-2 py-0.5 text-xs font-semibold select-none min-w-[2rem]",children:["v",R.version]}),f("div",{className:"h-10 w-16 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:R.previewUrl?f("img",{src:R.previewUrl,alt:R.name||void 0,className:"h-full w-full object-cover"}):f(n,{className:"h-4 w-4 text-muted-foreground"})}),V("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[f("span",{className:"truncate text-sm font-semibold text-foreground",children:R.name}),f("span",{className:"truncate text-xs text-muted-foreground",children:R.creator?.name||"Unknown"})]}),C&&f(j,{className:"h-4 w-4 text-primary ml-auto flex-shrink-0"})]},R.id)})}),f(g,{}),f("div",{className:"p-1",children:f("button",{className:"w-full text-center text-xs font-medium py-2 px-3 rounded-md bg-muted/80 hover:bg-muted text-foreground transition-colors",onClick:()=>console.log("Manage versions"),children:"Manage versions..."})})]})})]})]})]})]})]})]}),V("div",{className:"flex items-center gap-2",children:[V("div",{className:"flex flex-shrink-0 items-center gap-1 rounded-md border border-border bg-background p-1",children:[!q&&!Q&&T&&f("button",{onClick:T,className:"rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",title:P?"Show Left Sidebar":"Hide Left Sidebar",children:P?f(Hf,{className:"h-4 w-4"}):f(Kf,{className:"h-4 w-4 fill-primary stroke-0"})}),!q&&!Q&&E&&h&&V(O,{children:[f("button",{onClick:()=>h("card"),className:`rounded p-1.5 transition-colors ${E==="card"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"Card View",children:f(s,{className:"h-4 w-4"})}),f("button",{onClick:()=>h("list"),className:`rounded p-1.5 transition-colors ${E==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"List View",children:f(ff,{className:"h-4 w-4"})})]}),f("button",{onClick:v,className:`rounded p-1.5 transition-colors ${!$&&!Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:$?"Show Right Sidebar":"Hide Right Sidebar",children:!$&&!Z?f(Qf,{className:"h-4 w-4 fill-primary stroke-0"}):f(Jf,{className:"h-4 w-4"})})]}),!Q&&N&&f(Rf,{children:V(Lf,{children:[f(Vf,{asChild:!0,children:f("span",{children:f("button",{disabled:!1,onClick:N,className:D("h-9 w-9 flex items-center justify-center rounded-full border border-border bg-background transition-colors",Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground",!1),children:Z?f(Wf,{className:"h-6 w-6 text-primary transition-colors"}):f(e,{className:"h-6 w-6 text-muted-foreground transition-colors"})})})}),f(Cf,{children:f("p",{children:Z?X.hide_chatbot():X.show_chatbot()})})]})})]})]})}function cf(){let{projectState:K}=Zf(),L=$f(),{isChatbotOpen:_,setIsChatbotOpen:B}=Gf();if(!K)return f(hf,{});let{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,fileId:$,downloadInfo:v,versions:Z,isPublic:N,shareId:Q,onFolderClick:w,compareMode:q,canCompareVersions:G,onCompareVersions:z}=K,S=!!$,J=!!Q&&!S,b=S?L.fileViewLeftSidebarCollapsed:J?L.shareConfigLeftSidebarCollapsed:L.fileListLeftSidebarCollapsed,A=N?void 0:()=>S?L.setFileViewLeftSidebarCollapsed(!L.fileViewLeftSidebarCollapsed):J?L.setShareConfigLeftSidebarCollapsed(!L.shareConfigLeftSidebarCollapsed):L.setFileListLeftSidebarCollapsed(!L.fileListLeftSidebarCollapsed),k=N&&K.isRightSidebarCollapsed!==void 0?K.isRightSidebarCollapsed:S?L.fileViewRightSidebarCollapsed:J?L.shareConfigRightSidebarCollapsed:L.fileListRightSidebarCollapsed,y=N&&K.onRightSidebarToggle?K.onRightSidebarToggle:()=>{if(!N&&_)if(B(!1),S)L.setFileViewRightSidebarCollapsed(!1);else if(J)L.setShareConfigRightSidebarCollapsed(!1);else L.setFileListRightSidebarCollapsed(!1);else if(S)L.setFileViewRightSidebarCollapsed(!L.fileViewRightSidebarCollapsed);else if(J)L.setShareConfigRightSidebarCollapsed(!L.shareConfigRightSidebarCollapsed);else L.setFileListRightSidebarCollapsed(!L.fileListRightSidebarCollapsed)},I=N?void 0:()=>{B(!_)},m=Y?L.viewModes[Y]??"card":"card";return f(Yf,{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,displayStyle:S||J?void 0:m,onDisplayStyleChange:S||J?void 0:N?void 0:(t)=>{if(Y)L.setViewMode(Y,t)},isLeftSidebarCollapsed:b,onLeftSidebarToggle:A,isRightSidebarCollapsed:k,onRightSidebarToggle:y,isChatbotOpen:!N&&_,onChatbotToggle:I,isPublic:N,shareId:Q,fileId:$,downloadInfo:v,versions:Z,onFolderClick:w,compareMode:q,canCompareVersions:G,onCompareVersions:z})}function hf(){return f("div",{className:"flex h-14 flex-wrap items-center justify-center gap-2 border-b border-border bg-card px-4 py-2 flex-shrink-0",children:f(_f,{className:"w-10 h-10 text-orange-600"})})}
2
2
  export{cf as rf};
@@ -1 +1 @@
1
- import{j as U}from"./chunk-0ed7h2xm.js";import"./chunk-bmqw3j2d.js";import"./chunk-zx9cv3t8.js";import"./chunk-8yz1expv.js";import"./chunk-nzy3pjjm.js";import"./chunk-h270n69j.js";import"./chunk-mqbxagfd.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import{ef as N}from"./chunk-xawwxdq9.js";import"./chunk-qc6dmzn0.js";import{Bf as K}from"./chunk-ve7v8wtv.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-pgae67hk.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import{bh as J}from"./chunk-nr89225z.js";import{Ah as G,Mh as H,gh as Z,ih as q,nh as B,oh as D}from"./chunk-b1e3tec3.js";import{Xk as Y}from"./chunk-ws07a9kv.js";var V=Y(Z(),1);function _(){let{projectId:h,folderId:W}=z.useParams(),{teamId:v,ensureTeamIdForProject:w}=J();V.useEffect(()=>{w(h)},[h,w]);let{data:A}=D(N(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await H.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(K,{});return q(U,{teamId:v,projectId:h,projectName:A.name??"",assetId:W,rootFolderId:b})}var z=G("/projects/$projectId/folders/$folderId")({component:_});export{z as Route};
1
+ import{j as U}from"./chunk-k0a35mg9.js";import"./chunk-qn96vbke.js";import"./chunk-d3s00sn0.js";import"./chunk-8e5zvy88.js";import"./chunk-nzy3pjjm.js";import"./chunk-mm1j72a8.js";import"./chunk-9c7fxjej.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import{ef as N}from"./chunk-xawwxdq9.js";import"./chunk-qc6dmzn0.js";import{Bf as K}from"./chunk-ve7v8wtv.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-z0ej44ak.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import{bh as J}from"./chunk-nr89225z.js";import{Ah as G,Mh as H,gh as Z,ih as q,nh as B,oh as D}from"./chunk-b1e3tec3.js";import{Xk as Y}from"./chunk-ws07a9kv.js";var V=Y(Z(),1);function _(){let{projectId:h,folderId:W}=z.useParams(),{teamId:v,ensureTeamIdForProject:w}=J();V.useEffect(()=>{w(h)},[h,w]);let{data:A}=D(N(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await H.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(K,{});return q(U,{teamId:v,projectId:h,projectName:A.name??"",assetId:W,rootFolderId:b})}var z=G("/projects/$projectId/folders/$folderId")({component:_});export{z as Route};
@@ -1 +1 @@
1
- import{g as q}from"./chunk-qgq96tbp.js";import"./chunk-vt4zpasm.js";import"./chunk-8yz1expv.js";import"./chunk-nzy3pjjm.js";import"./chunk-h270n69j.js";import"./chunk-mqbxagfd.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import"./chunk-5e1xqaj4.js";import"./chunk-ejfmxjw6.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-pgae67hk.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import"./chunk-nr89225z.js";import{Ah as k,ih as f}from"./chunk-b1e3tec3.js";import"./chunk-ws07a9kv.js";function w(){let{shareId:v}=A.useParams();return f(q,{shareId:v})}var A=k("/share/$shareId/")({component:w});export{A as Route};
1
+ import{g as q}from"./chunk-jstc7pka.js";import"./chunk-rrxjvewm.js";import"./chunk-8e5zvy88.js";import"./chunk-nzy3pjjm.js";import"./chunk-mm1j72a8.js";import"./chunk-9c7fxjej.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import"./chunk-6t3gdd7e.js";import"./chunk-ejfmxjw6.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-z0ej44ak.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import"./chunk-nr89225z.js";import{Ah as k,ih as f}from"./chunk-b1e3tec3.js";import"./chunk-ws07a9kv.js";function w(){let{shareId:v}=A.useParams();return f(q,{shareId:v})}var A=k("/share/$shareId/")({component:w});export{A as Route};
@@ -1,4 +1,4 @@
1
- import{s as Xp,t as Kp}from"./chunk-nzy3pjjm.js";import{C as qS,E as e7,G as U2,H as G2,I as X2,P as t7,Q as vS,R as nv,S as zl,T as b9,U as ug,V as K9}from"./chunk-mqbxagfd.js";import{Xa as I8}from"./chunk-hfp4hpca.js";import{ab as Dp,bb as Rp,cb as Np,db as zp,eb as Ep,fb as Ip,gb as Up,hb as Gp}from"./chunk-20y3wte3.js";import{Df as E9,Ef as I9,Ff as Fk,Hf as zg,If as Ok,Jf as Bk,Lf as Tk,Mf as zk,Nf as Eg,Of as Mk,Pf as Hk,Qf as Fp,Rf as Op,Sf as Bp,Tf as Tp,Uf as bS,Vf as wS,Wf as z8,Xf as E8,cg as E2}from"./chunk-7y8dng8t.js";import{qg as So}from"./chunk-etces6ff.js";import{rg as dS,sg as hs}from"./chunk-yahb7wan.js";import{tg as y3}from"./chunk-mahxw48e.js";import{Rg as Pf,Tg as er,Ug as tr,Vg as z0,Yg as d9,bh as Pp,ch as jS,dh as A3}from"./chunk-nr89225z.js";import{Ai as nA,Di as Ci,Ej as tv,Fh as Lp,Fj as av,Gi as z2,Hj as _o,Mh as Bt,Vh as Cp,Wh as a7,Xj as Fh,Zi as j9,ak as jn,cj as q9,ck as Si,di as Vp,dj as El,dk as Mp,ek as Hp,fi as v3,fk as xp,gh as Za,gj as Qp,hh as I2,hi as X9,hj as Wq,ih as I,ij as w1,ik as Le,jh as he,jj as d1,kh as N2,lj as Zp,mi as Yp,mj as Pq,nh as Ec,oj as ev,ph as Wf,pi as b1,qh as pS,qi as Co,ri as rS,si as oS,sj as $p,xj as _p,yi as Jp,zj as Wp}from"./chunk-b1e3tec3.js";import{Xk as Mt,Yk as Tt,Zk as HR}from"./chunk-ws07a9kv.js";var Ki=Tt((XE,s7)=>{var Uc;if(typeof window<"u")Uc=window;else if(typeof global<"u")Uc=global;else if(typeof self<"u")Uc=self;else Uc={};s7.exports=Uc});var S3=Tt((KE,l7)=>{var i7=Array.prototype.slice;l7.exports=w_;function w_(e,t){if(!("length"in e))e=[e];e=i7.call(e);while(e.length){var a=e.shift(),n=t(a);if(n)return n;if(a.childNodes&&a.childNodes.length)e=i7.call(a.childNodes).concat(e)}}});var r7=Tt((LE,f7)=>{f7.exports=Fo;function Fo(e,t){if(!(this instanceof Fo))return new Fo(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}Fo.prototype.nodeType=8;Fo.prototype.nodeName="#comment";Fo.prototype.toString=function(){return"[object Comment]"}});var c7=Tt((VE,o7)=>{o7.exports=Il;function Il(e,t){if(!(this instanceof Il))return new Il(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}Il.prototype.type="DOMTextNode";Il.prototype.nodeType=3;Il.prototype.nodeName="#text";Il.prototype.toString=function(){return this.data};Il.prototype.replaceData=function(t,a,n){var s=this.data,i=s.substring(0,t),l=s.substring(t+a,s.length);this.data=i+n+l,this.length=this.data.length}});var C3=Tt((YE,h7)=>{h7.exports=d_;function d_(e){var t=this,a=e.type;if(!e.target)e.target=t;if(!t.listeners)t.listeners={};var n=t.listeners[a];if(n)return n.forEach(function(s){if(e.currentTarget=t,typeof s==="function")s(e);else s.handleEvent(e)});if(t.parentNode)t.parentNode.dispatchEvent(e)}});var _3=Tt((JE,u7)=>{u7.exports=j_;function j_(e,t){var a=this;if(!a.listeners)a.listeners={};if(!a.listeners[e])a.listeners[e]=[];if(a.listeners[e].indexOf(t)===-1)a.listeners[e].push(t)}});var F3=Tt((QE,m7)=>{m7.exports=q_;function q_(e,t){var a=this;if(!a.listeners)return;if(!a.listeners[e])return;var n=a.listeners[e],s=n.indexOf(t);if(s!==-1)n.splice(s,1)}});var w7=Tt((ZE,b7)=>{b7.exports=g7;var v_=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function g7(e){switch(e.nodeType){case 3:return O3(e.data);case 8:return"<!--"+e.data+"-->";default:return k_(e)}}function k_(e){var t=[],a=e.tagName;if(e.namespaceURI==="http://www.w3.org/1999/xhtml")a=a.toLowerCase();if(t.push("<"+a+C_(e)+S_(e)),v_.indexOf(a)>-1)t.push(" />");else{if(t.push(">"),e.childNodes.length)t.push.apply(t,e.childNodes.map(g7));else if(e.textContent||e.innerText)t.push(O3(e.textContent||e.innerText));else if(e.innerHTML)t.push(e.innerHTML);t.push("</"+a+">")}return t.join("")}function A_(e,t){var a=typeof e[t];if(t==="style"&&Object.keys(e.style).length>0)return!0;return e.hasOwnProperty(t)&&(a==="string"||a==="boolean"||a==="number")&&t!=="nodeName"&&t!=="className"&&t!=="tagName"&&t!=="textContent"&&t!=="innerText"&&t!=="namespaceURI"&&t!=="innerHTML"}function y_(e){if(typeof e==="string")return e;var t="";return Object.keys(e).forEach(function(a){var n=e[a];a=a.replace(/[A-Z]/g,function(s){return"-"+s.toLowerCase()}),t+=a+":"+n+";"}),t}function S_(e){var t=e.dataset,a=[];for(var n in t)a.push({name:"data-"+n,value:t[n]});return a.length?p7(a):""}function p7(e){var t=[];return e.forEach(function(a){var{name:n,value:s}=a;if(n==="style")s=y_(s);t.push(n+'="'+__(s)+'"')}),t.length?" "+t.join(" "):""}function C_(e){var t=[];for(var a in e)if(A_(e,a))t.push({name:a,value:e[a]});for(var n in e._attributes)for(var s in e._attributes[n]){var i=e._attributes[n][s],l=(i.prefix?i.prefix+":":"")+s;t.push({name:l,value:i.value})}if(e.className)t.push({name:"class",value:e.className});return t.length?p7(t):""}function O3(e){var t="";if(typeof e==="string")t=e;else if(e)t=e.toString();return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function __(e){return O3(e).replace(/"/g,"&quot;")}});var T3=Tt(($E,j7)=>{var B3=S3(),F_=C3(),O_=_3(),B_=F3(),T_=w7(),d7="http://www.w3.org/1999/xhtml";j7.exports=ca;function ca(e,t,a){if(!(this instanceof ca))return new ca(e);var n=a===void 0?d7:a||null;if(this.tagName=n===d7?String(e).toUpperCase():e,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=t||null,this.namespaceURI=n,this._attributes={},this.tagName==="INPUT")this.type="text"}ca.prototype.type="DOMElement";ca.prototype.nodeType=1;ca.prototype.appendChild=function(t){if(t.parentNode)t.parentNode.removeChild(t);return this.childNodes.push(t),t.parentNode=this,t};ca.prototype.replaceChild=function(t,a){if(t.parentNode)t.parentNode.removeChild(t);var n=this.childNodes.indexOf(a);return a.parentNode=null,this.childNodes[n]=t,t.parentNode=this,a};ca.prototype.removeChild=function(t){var a=this.childNodes.indexOf(t);return this.childNodes.splice(a,1),t.parentNode=null,t};ca.prototype.insertBefore=function(t,a){if(t.parentNode)t.parentNode.removeChild(t);var n=a===null||a===void 0?-1:this.childNodes.indexOf(a);if(n>-1)this.childNodes.splice(n,0,t);else this.childNodes.push(t);return t.parentNode=this,t};ca.prototype.setAttributeNS=function(t,a,n){var s=null,i=a,l=a.indexOf(":");if(l>-1)s=a.substr(0,l),i=a.substr(l+1);if(this.tagName==="INPUT"&&a==="type")this.type=n;else{var f=this._attributes[t]||(this._attributes[t]={});f[i]={value:n,prefix:s}}};ca.prototype.getAttributeNS=function(t,a){var n=this._attributes[t],s=n&&n[a]&&n[a].value;if(this.tagName==="INPUT"&&a==="type")return this.type;if(typeof s!=="string")return null;return s};ca.prototype.removeAttributeNS=function(t,a){if(!Object.prototype.hasOwnProperty.call(this._attributes,t))return;var n=this._attributes[t];if(n&&Object.prototype.hasOwnProperty.call(n,a))delete n[a]};ca.prototype.hasAttributeNS=function(t,a){var n=this._attributes[t];return!!n&&a in n};ca.prototype.setAttribute=function(t,a){return this.setAttributeNS(null,t,a)};ca.prototype.getAttribute=function(t){return this.getAttributeNS(null,t)};ca.prototype.removeAttribute=function(t){return this.removeAttributeNS(null,t)};ca.prototype.hasAttribute=function(t){return this.hasAttributeNS(null,t)};ca.prototype.removeEventListener=B_;ca.prototype.addEventListener=O_;ca.prototype.dispatchEvent=F_;ca.prototype.focus=function(){return};ca.prototype.toString=function(){return T_(this)};ca.prototype.getElementsByClassName=function(t){var a=t.split(" "),n=[];return B3(this,function(s){if(s.nodeType===1){var i=s.className||"",l=i.split(" ");if(a.every(function(f){return l.indexOf(f)!==-1}))n.push(s)}}),n};ca.prototype.getElementsByTagName=function(t){t=t.toLowerCase();var a=[];return B3(this.childNodes,function(n){if(n.nodeType===1&&(t==="*"||n.tagName.toLowerCase()===t))a.push(n)}),a};ca.prototype.contains=function(t){return B3(this,function(a){return t===a})||!1}});var v7=Tt((WE,q7)=>{var M3=T3();q7.exports=Li;function Li(e){if(!(this instanceof Li))return new Li;this.childNodes=[],this.parentNode=null,this.ownerDocument=e||null}Li.prototype.type="DocumentFragment";Li.prototype.nodeType=11;Li.prototype.nodeName="#document-fragment";Li.prototype.appendChild=M3.prototype.appendChild;Li.prototype.replaceChild=M3.prototype.replaceChild;Li.prototype.removeChild=M3.prototype.removeChild;Li.prototype.toString=function(){return this.childNodes.map(function(t){return String(t)}).join("")}});var A7=Tt((PE,k7)=>{k7.exports=H3;function H3(e){}H3.prototype.initEvent=function(t,a,n){this.type=t,this.bubbles=a,this.cancelable=n};H3.prototype.preventDefault=function(){}});var S7=Tt((eI,y7)=>{var M_=S3(),H_=r7(),x_=c7(),Gc=T3(),D_=v7(),R_=A7(),N_=C3(),z_=_3(),E_=F3();y7.exports=K2;function K2(){if(!(this instanceof K2))return new K2;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}var Rs=K2.prototype;Rs.createTextNode=function(t){return new x_(t,this)};Rs.createElementNS=function(t,a){var n=t===null?null:String(t);return new Gc(a,this,n)};Rs.createElement=function(t){return new Gc(t,this)};Rs.createDocumentFragment=function(){return new D_(this)};Rs.createEvent=function(t){return new R_(t)};Rs.createComment=function(t){return new H_(t,this)};Rs.getElementById=function(t){t=String(t);var a=M_(this.childNodes,function(n){if(String(n.id)===t)return n});return a||null};Rs.getElementsByClassName=Gc.prototype.getElementsByClassName;Rs.getElementsByTagName=Gc.prototype.getElementsByTagName;Rs.contains=Gc.prototype.contains;Rs.removeEventListener=E_;Rs.addEventListener=z_;Rs.dispatchEvent=N_});var _7=Tt((tI,C7)=>{var I_=S7();C7.exports=new I_});var x3=Tt((aI,O7)=>{var F7=typeof global<"u"?global:typeof window<"u"?window:{},U_=_7(),Xc;if(typeof document<"u")Xc=document;else if(Xc=F7["__GLOBAL_DOCUMENT_CACHE@4"],!Xc)Xc=F7["__GLOBAL_DOCUMENT_CACHE@4"]=U_;O7.exports=Xc});var B7=Tt((nI,E0)=>{function D3(){return E0.exports=D3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},E0.exports.__esModule=!0,E0.exports.default=E0.exports,D3.apply(null,arguments)}E0.exports=D3,E0.exports.__esModule=!0,E0.exports.default=E0.exports});var M7=Tt((sI,T7)=>{T7.exports=X_;var G_=Object.prototype.toString;function X_(e){if(!e)return!1;var t=G_.call(e);return t==="[object Function]"||typeof e==="function"&&t!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}});var D7=Tt((iI,x7)=>{function K_(e,t){var a=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a)return(a=a.call(e)).next.bind(a);if(Array.isArray(e)||(a=L_(e))||t&&e&&typeof e.length==="number"){if(a)e=a;var n=0;return function(){if(n>=e.length)return{done:!0};return{done:!1,value:e[n++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ import{s as Xp,t as Kp}from"./chunk-nzy3pjjm.js";import{C as qS,E as e7,G as U2,H as G2,I as X2,P as t7,Q as vS,R as nv,S as zl,T as b9,U as ug,V as K9}from"./chunk-9c7fxjej.js";import{Xa as I8}from"./chunk-hfp4hpca.js";import{ab as Dp,bb as Rp,cb as Np,db as zp,eb as Ep,fb as Ip,gb as Up,hb as Gp}from"./chunk-20y3wte3.js";import{Df as E9,Ef as I9,Ff as Fk,Hf as zg,If as Ok,Jf as Bk,Lf as Tk,Mf as zk,Nf as Eg,Of as Mk,Pf as Hk,Qf as Fp,Rf as Op,Sf as Bp,Tf as Tp,Uf as bS,Vf as wS,Wf as z8,Xf as E8,cg as E2}from"./chunk-7y8dng8t.js";import{qg as So}from"./chunk-etces6ff.js";import{rg as dS,sg as hs}from"./chunk-yahb7wan.js";import{tg as y3}from"./chunk-mahxw48e.js";import{Rg as Pf,Tg as er,Ug as tr,Vg as z0,Yg as d9,bh as Pp,ch as jS,dh as A3}from"./chunk-nr89225z.js";import{Ai as nA,Di as Ci,Ej as tv,Fh as Lp,Fj as av,Gi as z2,Hj as _o,Mh as Bt,Vh as Cp,Wh as a7,Xj as Fh,Zi as j9,ak as jn,cj as q9,ck as Si,di as Vp,dj as El,dk as Mp,ek as Hp,fi as v3,fk as xp,gh as Za,gj as Qp,hh as I2,hi as X9,hj as Wq,ih as I,ij as w1,ik as Le,jh as he,jj as d1,kh as N2,lj as Zp,mi as Yp,mj as Pq,nh as Ec,oj as ev,ph as Wf,pi as b1,qh as pS,qi as Co,ri as rS,si as oS,sj as $p,xj as _p,yi as Jp,zj as Wp}from"./chunk-b1e3tec3.js";import{Xk as Mt,Yk as Tt,Zk as HR}from"./chunk-ws07a9kv.js";var Ki=Tt((XE,s7)=>{var Uc;if(typeof window<"u")Uc=window;else if(typeof global<"u")Uc=global;else if(typeof self<"u")Uc=self;else Uc={};s7.exports=Uc});var S3=Tt((KE,l7)=>{var i7=Array.prototype.slice;l7.exports=w_;function w_(e,t){if(!("length"in e))e=[e];e=i7.call(e);while(e.length){var a=e.shift(),n=t(a);if(n)return n;if(a.childNodes&&a.childNodes.length)e=i7.call(a.childNodes).concat(e)}}});var r7=Tt((LE,f7)=>{f7.exports=Fo;function Fo(e,t){if(!(this instanceof Fo))return new Fo(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}Fo.prototype.nodeType=8;Fo.prototype.nodeName="#comment";Fo.prototype.toString=function(){return"[object Comment]"}});var c7=Tt((VE,o7)=>{o7.exports=Il;function Il(e,t){if(!(this instanceof Il))return new Il(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}Il.prototype.type="DOMTextNode";Il.prototype.nodeType=3;Il.prototype.nodeName="#text";Il.prototype.toString=function(){return this.data};Il.prototype.replaceData=function(t,a,n){var s=this.data,i=s.substring(0,t),l=s.substring(t+a,s.length);this.data=i+n+l,this.length=this.data.length}});var C3=Tt((YE,h7)=>{h7.exports=d_;function d_(e){var t=this,a=e.type;if(!e.target)e.target=t;if(!t.listeners)t.listeners={};var n=t.listeners[a];if(n)return n.forEach(function(s){if(e.currentTarget=t,typeof s==="function")s(e);else s.handleEvent(e)});if(t.parentNode)t.parentNode.dispatchEvent(e)}});var _3=Tt((JE,u7)=>{u7.exports=j_;function j_(e,t){var a=this;if(!a.listeners)a.listeners={};if(!a.listeners[e])a.listeners[e]=[];if(a.listeners[e].indexOf(t)===-1)a.listeners[e].push(t)}});var F3=Tt((QE,m7)=>{m7.exports=q_;function q_(e,t){var a=this;if(!a.listeners)return;if(!a.listeners[e])return;var n=a.listeners[e],s=n.indexOf(t);if(s!==-1)n.splice(s,1)}});var w7=Tt((ZE,b7)=>{b7.exports=g7;var v_=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function g7(e){switch(e.nodeType){case 3:return O3(e.data);case 8:return"<!--"+e.data+"-->";default:return k_(e)}}function k_(e){var t=[],a=e.tagName;if(e.namespaceURI==="http://www.w3.org/1999/xhtml")a=a.toLowerCase();if(t.push("<"+a+C_(e)+S_(e)),v_.indexOf(a)>-1)t.push(" />");else{if(t.push(">"),e.childNodes.length)t.push.apply(t,e.childNodes.map(g7));else if(e.textContent||e.innerText)t.push(O3(e.textContent||e.innerText));else if(e.innerHTML)t.push(e.innerHTML);t.push("</"+a+">")}return t.join("")}function A_(e,t){var a=typeof e[t];if(t==="style"&&Object.keys(e.style).length>0)return!0;return e.hasOwnProperty(t)&&(a==="string"||a==="boolean"||a==="number")&&t!=="nodeName"&&t!=="className"&&t!=="tagName"&&t!=="textContent"&&t!=="innerText"&&t!=="namespaceURI"&&t!=="innerHTML"}function y_(e){if(typeof e==="string")return e;var t="";return Object.keys(e).forEach(function(a){var n=e[a];a=a.replace(/[A-Z]/g,function(s){return"-"+s.toLowerCase()}),t+=a+":"+n+";"}),t}function S_(e){var t=e.dataset,a=[];for(var n in t)a.push({name:"data-"+n,value:t[n]});return a.length?p7(a):""}function p7(e){var t=[];return e.forEach(function(a){var{name:n,value:s}=a;if(n==="style")s=y_(s);t.push(n+'="'+__(s)+'"')}),t.length?" "+t.join(" "):""}function C_(e){var t=[];for(var a in e)if(A_(e,a))t.push({name:a,value:e[a]});for(var n in e._attributes)for(var s in e._attributes[n]){var i=e._attributes[n][s],l=(i.prefix?i.prefix+":":"")+s;t.push({name:l,value:i.value})}if(e.className)t.push({name:"class",value:e.className});return t.length?p7(t):""}function O3(e){var t="";if(typeof e==="string")t=e;else if(e)t=e.toString();return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function __(e){return O3(e).replace(/"/g,"&quot;")}});var T3=Tt(($E,j7)=>{var B3=S3(),F_=C3(),O_=_3(),B_=F3(),T_=w7(),d7="http://www.w3.org/1999/xhtml";j7.exports=ca;function ca(e,t,a){if(!(this instanceof ca))return new ca(e);var n=a===void 0?d7:a||null;if(this.tagName=n===d7?String(e).toUpperCase():e,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=t||null,this.namespaceURI=n,this._attributes={},this.tagName==="INPUT")this.type="text"}ca.prototype.type="DOMElement";ca.prototype.nodeType=1;ca.prototype.appendChild=function(t){if(t.parentNode)t.parentNode.removeChild(t);return this.childNodes.push(t),t.parentNode=this,t};ca.prototype.replaceChild=function(t,a){if(t.parentNode)t.parentNode.removeChild(t);var n=this.childNodes.indexOf(a);return a.parentNode=null,this.childNodes[n]=t,t.parentNode=this,a};ca.prototype.removeChild=function(t){var a=this.childNodes.indexOf(t);return this.childNodes.splice(a,1),t.parentNode=null,t};ca.prototype.insertBefore=function(t,a){if(t.parentNode)t.parentNode.removeChild(t);var n=a===null||a===void 0?-1:this.childNodes.indexOf(a);if(n>-1)this.childNodes.splice(n,0,t);else this.childNodes.push(t);return t.parentNode=this,t};ca.prototype.setAttributeNS=function(t,a,n){var s=null,i=a,l=a.indexOf(":");if(l>-1)s=a.substr(0,l),i=a.substr(l+1);if(this.tagName==="INPUT"&&a==="type")this.type=n;else{var f=this._attributes[t]||(this._attributes[t]={});f[i]={value:n,prefix:s}}};ca.prototype.getAttributeNS=function(t,a){var n=this._attributes[t],s=n&&n[a]&&n[a].value;if(this.tagName==="INPUT"&&a==="type")return this.type;if(typeof s!=="string")return null;return s};ca.prototype.removeAttributeNS=function(t,a){if(!Object.prototype.hasOwnProperty.call(this._attributes,t))return;var n=this._attributes[t];if(n&&Object.prototype.hasOwnProperty.call(n,a))delete n[a]};ca.prototype.hasAttributeNS=function(t,a){var n=this._attributes[t];return!!n&&a in n};ca.prototype.setAttribute=function(t,a){return this.setAttributeNS(null,t,a)};ca.prototype.getAttribute=function(t){return this.getAttributeNS(null,t)};ca.prototype.removeAttribute=function(t){return this.removeAttributeNS(null,t)};ca.prototype.hasAttribute=function(t){return this.hasAttributeNS(null,t)};ca.prototype.removeEventListener=B_;ca.prototype.addEventListener=O_;ca.prototype.dispatchEvent=F_;ca.prototype.focus=function(){return};ca.prototype.toString=function(){return T_(this)};ca.prototype.getElementsByClassName=function(t){var a=t.split(" "),n=[];return B3(this,function(s){if(s.nodeType===1){var i=s.className||"",l=i.split(" ");if(a.every(function(f){return l.indexOf(f)!==-1}))n.push(s)}}),n};ca.prototype.getElementsByTagName=function(t){t=t.toLowerCase();var a=[];return B3(this.childNodes,function(n){if(n.nodeType===1&&(t==="*"||n.tagName.toLowerCase()===t))a.push(n)}),a};ca.prototype.contains=function(t){return B3(this,function(a){return t===a})||!1}});var v7=Tt((WE,q7)=>{var M3=T3();q7.exports=Li;function Li(e){if(!(this instanceof Li))return new Li;this.childNodes=[],this.parentNode=null,this.ownerDocument=e||null}Li.prototype.type="DocumentFragment";Li.prototype.nodeType=11;Li.prototype.nodeName="#document-fragment";Li.prototype.appendChild=M3.prototype.appendChild;Li.prototype.replaceChild=M3.prototype.replaceChild;Li.prototype.removeChild=M3.prototype.removeChild;Li.prototype.toString=function(){return this.childNodes.map(function(t){return String(t)}).join("")}});var A7=Tt((PE,k7)=>{k7.exports=H3;function H3(e){}H3.prototype.initEvent=function(t,a,n){this.type=t,this.bubbles=a,this.cancelable=n};H3.prototype.preventDefault=function(){}});var S7=Tt((eI,y7)=>{var M_=S3(),H_=r7(),x_=c7(),Gc=T3(),D_=v7(),R_=A7(),N_=C3(),z_=_3(),E_=F3();y7.exports=K2;function K2(){if(!(this instanceof K2))return new K2;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}var Rs=K2.prototype;Rs.createTextNode=function(t){return new x_(t,this)};Rs.createElementNS=function(t,a){var n=t===null?null:String(t);return new Gc(a,this,n)};Rs.createElement=function(t){return new Gc(t,this)};Rs.createDocumentFragment=function(){return new D_(this)};Rs.createEvent=function(t){return new R_(t)};Rs.createComment=function(t){return new H_(t,this)};Rs.getElementById=function(t){t=String(t);var a=M_(this.childNodes,function(n){if(String(n.id)===t)return n});return a||null};Rs.getElementsByClassName=Gc.prototype.getElementsByClassName;Rs.getElementsByTagName=Gc.prototype.getElementsByTagName;Rs.contains=Gc.prototype.contains;Rs.removeEventListener=E_;Rs.addEventListener=z_;Rs.dispatchEvent=N_});var _7=Tt((tI,C7)=>{var I_=S7();C7.exports=new I_});var x3=Tt((aI,O7)=>{var F7=typeof global<"u"?global:typeof window<"u"?window:{},U_=_7(),Xc;if(typeof document<"u")Xc=document;else if(Xc=F7["__GLOBAL_DOCUMENT_CACHE@4"],!Xc)Xc=F7["__GLOBAL_DOCUMENT_CACHE@4"]=U_;O7.exports=Xc});var B7=Tt((nI,E0)=>{function D3(){return E0.exports=D3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},E0.exports.__esModule=!0,E0.exports.default=E0.exports,D3.apply(null,arguments)}E0.exports=D3,E0.exports.__esModule=!0,E0.exports.default=E0.exports});var M7=Tt((sI,T7)=>{T7.exports=X_;var G_=Object.prototype.toString;function X_(e){if(!e)return!1;var t=G_.call(e);return t==="[object Function]"||typeof e==="function"&&t!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}});var D7=Tt((iI,x7)=>{function K_(e,t){var a=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a)return(a=a.call(e)).next.bind(a);if(Array.isArray(e)||(a=L_(e))||t&&e&&typeof e.length==="number"){if(a)e=a;var n=0;return function(){if(n>=e.length)return{done:!0};return{done:!1,value:e[n++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L_(e,t){if(!e)return;if(typeof e==="string")return H7(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor)a=e.constructor.name;if(a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return H7(e,t)}function H7(e,t){if(t==null||t>e.length)t=e.length;for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}var V_=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(n,s){if(!this.typeToInterceptorsMap_.has(n))this.typeToInterceptorsMap_.set(n,new Set);var i=this.typeToInterceptorsMap_.get(n);if(i.has(s))return!1;return i.add(s),!0},t.removeInterceptor=function(n,s){var i=this.typeToInterceptorsMap_.get(n);if(i&&i.has(s))return i.delete(s),!0;return!1},t.clearInterceptorsByType=function(n){var s=this.typeToInterceptorsMap_.get(n);if(!s)return!1;return this.typeToInterceptorsMap_.delete(n),this.typeToInterceptorsMap_.set(n,new Set),!0},t.clear=function(){if(!this.typeToInterceptorsMap_.size)return!1;return this.typeToInterceptorsMap_=new Map,!0},t.getForType=function(n){return this.typeToInterceptorsMap_.get(n)||new Set},t.execute=function(n,s){var i=this.getForType(n);for(var l=K_(i),f;!(f=l()).done;){var c=f.value;try{s=c(s)}catch(h){}}return s},e}();x7.exports=V_});var N7=Tt((lI,R7)=>{var Y_=function(){function e(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1000,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1000,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(n){this.maxAttempts_=n},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(n){this.delayFactor_=n},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(n){this.fuzzFactor_=n},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(n){this.initialDelay_=n},t.createRetry=function(n){var s=n===void 0?{}:n,i=s.maxAttempts,l=s.delayFactor,f=s.fuzzFactor,c=s.initialDelay;return new J_({maxAttempts:i||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:f||this.fuzzFactor_,initialDelay:c||this.initialDelay_})},e}(),J_=function(){function e(a){this.maxAttempts_=a.maxAttempts,this.delayFactor_=a.delayFactor,this.fuzzFactor_=a.fuzzFactor,this.currentDelay_=a.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var n=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+n},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var n=this.getCurrentMinPossibleDelay(),s=this.getCurrentMaxPossibleDelay();return n+Math.random()*(s-n)},e}();R7.exports=Y_});var E7=Tt((fI,z7)=>{var Q_=Ki(),Z_=function(t,a){if(a===void 0)a=!1;return function(n,s,i){if(n){t(n);return}if(s.statusCode>=400&&s.statusCode<=599){var l=i;if(a)if(Q_.TextDecoder){var f=$_(s.headers&&s.headers["content-type"]);try{l=new TextDecoder(f).decode(i)}catch(c){}}else l=String.fromCharCode.apply(null,new Uint8Array(i));t({cause:l});return}t(null,i)}};function $_(e){if(e===void 0)e="";return e.toLowerCase().split(";").reduce(function(t,a){var n=a.split("="),s=n[0],i=n[1];if(s.trim()==="charset")return i.trim();return t},"utf-8")}z7.exports=Z_});var X7=Tt((rI,N3)=>{var I7=Ki(),W_=B7(),P_=M7(),U7=D7(),eF=N7();Ua.httpHandler=E7();Ua.requestInterceptorsStorage=new U7;Ua.responseInterceptorsStorage=new U7;Ua.retryManager=new eF;var tF=function(t){var a={};if(!t)return a;return t.trim().split(`
3
3
  `).forEach(function(n){var s=n.indexOf(":"),i=n.slice(0,s).trim().toLowerCase(),l=n.slice(s+1).trim();if(typeof a[i]>"u")a[i]=l;else if(Array.isArray(a[i]))a[i].push(l);else a[i]=[a[i],l]}),a};N3.exports=Ua;N3.exports.default=Ua;Ua.XMLHttpRequest=I7.XMLHttpRequest||iF;Ua.XDomainRequest="withCredentials"in new Ua.XMLHttpRequest?Ua.XMLHttpRequest:I7.XDomainRequest;aF(["get","put","post","patch","head","delete"],function(e){Ua[e==="delete"?"del":e]=function(t,a,n){return a=G7(t,a,n),a.method=e.toUpperCase(),R3(a)}});function aF(e,t){for(var a=0;a<e.length;a++)t(e[a])}function nF(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function G7(e,t,a){var n=e;if(P_(t)){if(a=t,typeof e==="string")n={uri:e}}else n=W_({},t,{uri:e});return n.callback=a,n}function Ua(e,t,a){return t=G7(e,t,a),R3(t)}function R3(e){if(typeof e.callback>"u")throw Error("callback argument missing");if(e.requestType&&Ua.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},a=Ua.requestInterceptorsStorage.execute(e.requestType,t);e.uri=a.uri,e.headers=a.headers,e.body=a.body,e.metadata=a.metadata,e.retry=a.retry,e.timeout=a.timeout}var n=!1,s=function(H,D,N){if(!n)n=!0,e.callback(H,D,N)};function i(){if(h.readyState===4&&!Ua.responseInterceptorsStorage.getIsEnabled())setTimeout(c,0)}function l(){var M=void 0;if(h.response)M=h.response;else M=h.responseText||sF(h);if(C)try{M=JSON.parse(M)}catch(H){}return M}function f(M){if(clearTimeout(O),clearTimeout(e.retryTimeout),!(M instanceof Error))M=Error(""+(M||"Unknown XMLHttpRequest Error"));if(M.statusCode=0,!g&&Ua.retryManager.getIsEnabled()&&e.retry&&e.retry.shouldRetry()){e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=h,R3(e)},e.retry.getCurrentFuzzedDelay());return}if(e.requestType&&Ua.responseInterceptorsStorage.getIsEnabled()){var H={headers:T.headers||{},body:T.body,responseUrl:h.responseURL,responseType:h.responseType},D=Ua.responseInterceptorsStorage.execute(e.requestType,H);T.body=D.body,T.headers=D.headers}return s(M,T)}function c(){if(g)return;var M;if(clearTimeout(O),clearTimeout(e.retryTimeout),e.useXDR&&h.status===void 0)M=200;else M=h.status===1223?204:h.status;var H=T,D=null;if(M!==0){if(H={body:l(),statusCode:M,method:d,headers:{},url:b,rawRequest:h},h.getAllResponseHeaders)H.headers=tF(h.getAllResponseHeaders())}else D=Error("Internal XMLHttpRequest Error");if(e.requestType&&Ua.responseInterceptorsStorage.getIsEnabled()){var N={headers:H.headers||{},body:H.body,responseUrl:h.responseURL,responseType:h.responseType},z=Ua.responseInterceptorsStorage.execute(e.requestType,N);H.body=z.body,H.headers=z.headers}return s(D,H,H.body)}var h=e.xhr||null;if(!h)if(e.cors||e.useXDR)h=new Ua.XDomainRequest;else h=new Ua.XMLHttpRequest;var u,g,b=h.url=e.uri||e.url,d=h.method=e.method||"GET",j=e.body||e.data,A=h.headers=e.headers||{},S=!!e.sync,C=!1,O,T={body:void 0,headers:{},statusCode:0,method:d,url:b,rawRequest:h};if("json"in e&&e.json!==!1){if(C=!0,A.accept||A.Accept||(A.Accept="application/json"),d!=="GET"&&d!=="HEAD")A["content-type"]||A["Content-Type"]||(A["Content-Type"]="application/json"),j=JSON.stringify(e.json===!0?j:e.json)}if(h.onreadystatechange=i,h.onload=c,h.onerror=f,h.onprogress=function(){},h.onabort=function(){g=!0,clearTimeout(e.retryTimeout)},h.ontimeout=f,h.open(d,b,!S,e.username,e.password),!S)h.withCredentials=!!e.withCredentials;if(!S&&e.timeout>0)O=setTimeout(function(){if(g)return;g=!0,h.abort("timeout");var M=Error("XMLHttpRequest timeout");M.code="ETIMEDOUT",f(M)},e.timeout);if(h.setRequestHeader){for(u in A)if(A.hasOwnProperty(u))h.setRequestHeader(u,A[u])}else if(e.headers&&!nF(e.headers))throw Error("Headers cannot be set on an XDomainRequest object");if("responseType"in e)h.responseType=e.responseType;if("beforeSend"in e&&typeof e.beforeSend==="function")e.beforeSend(h);return h.send(j||null),h}function sF(e){try{if(e.responseType==="document")return e.responseXML;var t=e.responseXML&&e.responseXML.documentElement.nodeName==="parsererror";if(e.responseType===""&&!t)return e.responseXML}catch(a){}return null}function iF(){}});var Z7=Tt((oI,Q7)=>{var K7=x3(),E3=Object.create||function(){function e(){}return function(t){if(arguments.length!==1)throw Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function Ns(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}Ns.prototype=E3(Error.prototype);Ns.prototype.constructor=Ns;Ns.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function I3(e){function t(n,s,i,l){return(n|0)*3600+(s|0)*60+(i|0)+(l|0)/1000}var a=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!a)return null;if(a[3])return t(a[1],a[2],a[3].replace(":",""),a[4]);else if(a[1]>59)return t(a[1],a[2],0,a[4]);else return t(0,a[1],a[2],a[4])}function Lc(){this.values=E3(null)}Lc.prototype={set:function(e,t){if(!this.get(e)&&t!=="")this.values[e]=t},get:function(e,t,a){if(a)return this.has(e)?this.values[e]:t[a];return this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,a){for(var n=0;n<a.length;++n)if(t===a[n]){this.set(e,t);break}},integer:function(e,t){if(/^-?\d+$/.test(t))this.set(e,parseInt(t,10))},percent:function(e,t){var a;if(a=t.match(/^([\d]{1,3})(\.[\d]*)?%$/)){if(t=parseFloat(t),t>=0&&t<=100)return this.set(e,t),!0}return!1}};function Kc(e,t,a,n){var s=n?e.split(n):[e];for(var i in s){if(typeof s[i]!=="string")continue;var l=s[i].split(a);if(l.length!==2)continue;var f=l[0].trim(),c=l[1].trim();t(f,c)}}function lF(e,t,a){var n=e;function s(){var f=I3(e);if(f===null)throw new Ns(Ns.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),f}function i(f,c){var h=new Lc;Kc(f,function(u,g){switch(u){case"region":for(var b=a.length-1;b>=0;b--)if(a[b].id===g){h.set(u,a[b].region);break}break;case"vertical":h.alt(u,g,["rl","lr"]);break;case"line":var d=g.split(","),j=d[0];if(h.integer(u,j),h.percent(u,j)&&h.set("snapToLines",!1),h.alt(u,j,["auto"]),d.length===2)h.alt("lineAlign",d[1],["start","center","end"]);break;case"position":if(d=g.split(","),h.percent(u,d[0]),d.length===2)h.alt("positionAlign",d[1],["start","center","end"]);break;case"size":h.percent(u,g);break;case"align":h.alt(u,g,["start","center","end","left","right"]);break}},/:/,/\s/),c.region=h.get("region",null),c.vertical=h.get("vertical","");try{c.line=h.get("line","auto")}catch(u){}c.lineAlign=h.get("lineAlign","start"),c.snapToLines=h.get("snapToLines",!0),c.size=h.get("size",100);try{c.align=h.get("align","center")}catch(u){c.align=h.get("align","middle")}try{c.position=h.get("position","auto")}catch(u){c.position=h.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},c.align)}c.positionAlign=h.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},c.align)}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=s(),l(),e.substr(0,3)!=="-->")throw new Ns(Ns.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+n);e=e.substr(3),l(),t.endTime=s(),l(),i(e,t)}var z3=K7.createElement&&K7.createElement("textarea"),fF={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},L7={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},rF={v:"title",lang:"lang"},V7={rt:"ruby"};function J7(e,t){function a(){if(!t)return null;function j(S){return t=t.substr(S.length),S}var A=t.match(/^([^<]*)(<[^>]*>?)?/);return j(A[1]?A[1]:A[2])}function n(j){return z3.innerHTML=j,j=z3.textContent,z3.textContent="",j}function s(j,A){return!V7[A.localName]||V7[A.localName]===j.localName}function i(j,A){var S=fF[j];if(!S)return null;var C=e.document.createElement(S),O=rF[j];if(O&&A)C[O]=A.trim();return C}var l=e.document.createElement("div"),f=l,c,h=[];while((c=a())!==null){if(c[0]==="<"){if(c[1]==="/"){if(h.length&&h[h.length-1]===c.substr(2).replace(">",""))h.pop(),f=f.parentNode;continue}var u=I3(c.substr(1,c.length-2)),g;if(u){g=e.document.createProcessingInstruction("timestamp",u),f.appendChild(g);continue}var b=c.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!b)continue;if(g=i(b[1],b[3]),!g)continue;if(!s(f,g))continue;if(b[2]){var d=b[2].split(".");d.forEach(function(j){var A=/^bg_/.test(j),S=A?j.slice(3):j;if(L7.hasOwnProperty(S)){var C=A?"background-color":"color",O=L7[S];g.style[C]=O}}),g.className=d.join(" ")}h.push(b[1]),f.appendChild(g),f=g;continue}f.appendChild(e.document.createTextNode(n(c)))}return l}var Y7=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function oF(e){for(var t=0;t<Y7.length;t++){var a=Y7[t];if(e>=a[0]&&e<=a[1])return!0}return!1}function cF(e){var t=[],a="",n;if(!e||!e.childNodes)return"ltr";function s(f,c){for(var h=c.childNodes.length-1;h>=0;h--)f.push(c.childNodes[h])}function i(f){if(!f||!f.length)return null;var c=f.pop(),h=c.textContent||c.innerText;if(h){var u=h.match(/^.*(\n|\r)/);if(u)return f.length=0,u[0];return h}if(c.tagName==="ruby")return i(f);if(c.childNodes)return s(f,c),i(f)}s(t,e);while(a=i(t))for(var l=0;l<a.length;l++)if(n=a.charCodeAt(l),oF(n))return"rtl";return"ltr"}function hF(e){if(typeof e.line==="number"&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;var t=e.track,a=t.textTrackList,n=0;for(var s=0;s<a.length&&a[s]!==t;s++)if(a[s].mode==="showing")n++;return++n*-1}function V2(){}V2.prototype.applyStyles=function(e,t){t=t||this.div;for(var a in e)if(e.hasOwnProperty(a))t.style[a]=e[a]};V2.prototype.formatStyle=function(e,t){return e===0?0:e+t};function L2(e,t,a){V2.call(this),this.cue=t,this.cueDiv=J7(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:t.vertical===""?"horizontal-tb":t.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:cF(this.cueDiv),writingMode:t.vertical===""?"horizontal-tb":t.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:t.align==="middle"?"center":t.align,font:a.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var s=0;switch(t.positionAlign){case"start":case"line-left":s=t.position;break;case"center":s=t.position-t.size/2;break;case"end":case"line-right":s=t.position-t.size;break}if(t.vertical==="")this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(t.size,"%")});else this.applyStyles({top:this.formatStyle(s,"%"),height:this.formatStyle(t.size,"%")});this.move=function(i){this.applyStyles({top:this.formatStyle(i.top,"px"),bottom:this.formatStyle(i.bottom,"px"),left:this.formatStyle(i.left,"px"),right:this.formatStyle(i.right,"px"),height:this.formatStyle(i.height,"px"),width:this.formatStyle(i.width,"px")})}}L2.prototype=E3(V2.prototype);L2.prototype.constructor=L2;function Jn(e){var t,a,n,s;if(e.div){a=e.div.offsetHeight,n=e.div.offsetWidth,s=e.div.offsetTop;var i=(i=e.div.childNodes)&&(i=i[0])&&i.getClientRects&&i.getClientRects();e=e.div.getBoundingClientRect(),t=i?Math.max(i[0]&&i[0].height||0,e.height/i.length):0}this.left=e.left,this.right=e.right,this.top=e.top||s,this.height=e.height||a,this.bottom=e.bottom||s+(e.height||a),this.width=e.width||n,this.lineHeight=t!==void 0?t:e.lineHeight}Jn.prototype.move=function(e,t){switch(t=t!==void 0?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;break}};Jn.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top};Jn.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1};Jn.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right};Jn.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}};Jn.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),a=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),n=t*a;return n/(this.height*this.width)};Jn.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}};Jn.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,a=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var s={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||a};return s};function uF(e,t,a,n){function s(S,C){var O,T=new Jn(S),M=1;for(var H=0;H<C.length;H++){while(S.overlapsOppositeAxis(a,C[H])||S.within(a)&&S.overlapsAny(n))S.move(C[H]);if(S.within(a))return S;var D=S.intersectPercentage(a);if(M>D)O=new Jn(S),M=D;S=new Jn(T)}return O||T}var i=new Jn(t),l=t.cue,f=hF(l),c=[];if(l.snapToLines){var h;switch(l.vertical){case"":c=["+y","-y"],h="height";break;case"rl":c=["+x","-x"],h="width";break;case"lr":c=["-x","+x"],h="width";break}var u=i.lineHeight,g=u*Math.round(f),b=a[h]+u,d=c[0];if(Math.abs(g)>b)g=g<0?-1:1,g*=Math.ceil(b/u)*u;if(f<0)g+=l.vertical===""?a.height:a.width,c=c.reverse();i.move(d,g)}else{var j=i.lineHeight/a.height*100;switch(l.lineAlign){case"center":f-=j/2;break;case"end":f-=j;break}switch(l.vertical){case"":t.applyStyles({top:t.formatStyle(f,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(f,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(f,"%")});break}c=["+y","-x","+x","-y"],i=new Jn(t)}var A=s(i,c);t.move(A.toCSSCompatValues(a))}function Oo(){}Oo.StringDecoder=function(){return{decode:function(e){if(!e)return"";if(typeof e!=="string")throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}};Oo.convertCueToDOMTree=function(e,t){if(!e||!t)return null;return J7(e,t)};var mF=0.05,gF="sans-serif",pF="1.5%";Oo.processCues=function(e,t,a){if(!e||!t||!a)return null;while(a.firstChild)a.removeChild(a.firstChild);var n=e.document.createElement("div");n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin=pF,a.appendChild(n);function s(u){for(var g=0;g<u.length;g++)if(u[g].hasBeenReset||!u[g].displayState)return!0;return!1}if(!s(t)){for(var i=0;i<t.length;i++)n.appendChild(t[i].displayState);return}var l=[],f=Jn.getSimpleBoxPosition(n),c=Math.round(f.height*mF*100)/100,h={font:c+"px "+gF};(function(){var u,g;for(var b=0;b<t.length;b++)g=t[b],u=new L2(e,g,h),n.appendChild(u.div),uF(e,u,f,l),g.displayState=u.div,l.push(Jn.getSimpleBoxPosition(u))})()};Oo.Parser=function(e,t,a){if(!a)a=t,t={};if(!t)t={};this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=a||new TextDecoder("utf8"),this.regionList=[]};Oo.Parser.prototype={reportOrThrowError:function(e){if(e instanceof Ns)this.onparsingerror&&this.onparsingerror(e);else throw e},parse:function(e){var t=this;if(e)t.buffer+=t.decoder.decode(e,{stream:!0});function a(){var u=t.buffer,g=0;while(g<u.length&&u[g]!=="\r"&&u[g]!==`
4
4
  `)++g;var b=u.substr(0,g);if(u[g]==="\r")++g;if(u[g]===`
@@ -1,2 +1,2 @@
1
- import{aa as v}from"./chunk-zhd2mkbr.js";import{Aa as D2,Ba as x2,Ca as _5,Da as h5,Ea as g5,Fa as m5,Ga as k1,Ha as P1,Ia as O1,Ja as b5,Ka as c5,La as X2,Ma as e5,Na as $1,Oa as J1,Pa as h,Qa as Y2,Ra as T1,Sa as Z1,ha as _,ia as T2,ja as S5,ka as _0,la as S2,ma as f5,na as f2,pa as y2,ra as E2,sa as E5,ta as I5,ua as D5,va as x5,wa as j5,xa as y5,ya as v5,za as I2}from"./chunk-31mjcykb.js";import{$a as m0}from"./chunk-3rcc5s99.js";import{ig as K2}from"./chunk-pgae67hk.js";import{tg as F0}from"./chunk-mahxw48e.js";import{Bg as K5,Gg as W0,Lg as P2,vg as S0,wg as y}from"./chunk-wap08p4j.js";import{Rg as L1,Tg as R1,Ug as A1,Vg as C1,dh as g0}from"./chunk-nr89225z.js";import{$h as K1,Cj as w1,Dj as V1,Fh as n0,Gh as Y5,Hj as V0,Li as q1,Mh as T0,Mi as B1,Sj as f0,Ui as W1,Zh as H1,ak as a0,ck as e,dk as L0,ek as R0,fk as A0,gh as l,hh as Q2,ih as H,ik as I,jh as R,jj as c2,kh as Q1,ni as N1,nj as z1,oj as G1,ph as b2,pi as H2,qi as w0,ri as W5,si as z5,tj as r0,uj as M1,wj as U1,yi as G5,yj as F1}from"./chunk-b1e3tec3.js";import{Xk as d}from"./chunk-ws07a9kv.js";var r2=Symbol.for("immer-nothing"),l2=Symbol.for("immer-draftable"),b=Symbol.for("immer-state");function u($,...J){throw Error(`[Immer] minified error nr: ${$}. Full error at: https://bit.ly/3cXEKWf`)}var C0=Object.getPrototypeOf;function B0($){return!!$&&!!$[b]}function X0($){if(!$)return!1;return a2($)||Array.isArray($)||!!$[l2]||!!$.constructor?.[l2]||O0($)||p0($)}var v1=Object.prototype.constructor.toString(),p2=new WeakMap;function a2($){if(!$||typeof $!=="object")return!1;let J=Object.getPrototypeOf($);if(J===null||J===Object.prototype)return!0;let Z=Object.hasOwnProperty.call(J,"constructor")&&J.constructor;if(Z===Object)return!0;if(typeof Z!=="function")return!1;let X=p2.get(Z);if(X===void 0)X=Function.toString.call(Z),p2.set(Z,X);return X===v1}function c0($,J,Z=!0){if(l0($)===0)(Z?Reflect.ownKeys($):Object.keys($)).forEach((Y)=>{J(Y,$[Y],$)});else $.forEach((X,Y)=>J(Y,X,$))}function l0($){let J=$[b];return J?J.type_:Array.isArray($)?1:O0($)?2:p0($)?3:0}function W2($,J){return l0($)===2?$.has(J):Object.prototype.hasOwnProperty.call($,J)}function t2($,J,Z){let X=l0($);if(X===2)$.set(J,Z);else if(X===3)$.add(Z);else $[J]=Z}function _1($,J){if($===J)return $!==0||1/$===1/J;else return $!==$&&J!==J}function O0($){return $ instanceof Map}function p0($){return $ instanceof Set}function Z0($){return $.copy_||$.base_}function z2($,J){if(O0($))return new Map($);if(p0($))return new Set($);if(Array.isArray($))return Array.prototype.slice.call($);let Z=a2($);if(J===!0||J==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors($);delete X[b];let Y=Reflect.ownKeys(X);for(let N=0;N<Y.length;N++){let Q=Y[N],K=X[Q];if(K.writable===!1)K.writable=!0,K.configurable=!0;if(K.get||K.set)X[Q]={configurable:!0,writable:!0,enumerable:K.enumerable,value:$[Q]}}return Object.create(C0($),X)}else{let X=C0($);if(X!==null&&Z)return{...$};let Y=Object.create(X);return Object.assign(Y,$)}}function w2($,J=!1){if(i0($)||B0($)||!X0($))return $;if(l0($)>1)Object.defineProperties($,{set:b0,add:b0,clear:b0,delete:b0});if(Object.freeze($),J)Object.values($).forEach((Z)=>w2(Z,!0));return $}function h1(){u(2)}var b0={value:h1};function i0($){if($===null||typeof $!=="object")return!0;return Object.isFrozen($)}var g1={};function Y0($){let J=g1[$];if(!J)u(0,$);return J}var k0;function e2(){return k0}function m1($,J){return{drafts_:[],parent_:$,immer_:J,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function i2($,J){if(J)Y0("Patches"),$.patches_=[],$.inversePatches_=[],$.patchListener_=J}function G2($){M2($),$.drafts_.forEach(b1),$.drafts_=null}function M2($){if($===k0)k0=$.parent_}function n2($){return k0=m1(k0,$)}function b1($){let J=$[b];if(J.type_===0||J.type_===1)J.revoke_();else J.revoked_=!0}function o2($,J){J.unfinalizedDrafts_=J.drafts_.length;let Z=J.drafts_[0];if($!==void 0&&$!==Z){if(Z[b].modified_)G2(J),u(4);if(X0($)){if($=u0(J,$),!J.parent_)d0(J,$)}if(J.patches_)Y0("Patches").generateReplacementPatches_(Z[b].base_,$,J.patches_,J.inversePatches_)}else $=u0(J,Z,[]);if(G2(J),J.patches_)J.patchListener_(J.patches_,J.inversePatches_);return $!==r2?$:void 0}function u0($,J,Z){if(i0(J))return J;let X=$.immer_.shouldUseStrictIteration(),Y=J[b];if(!Y)return c0(J,(N,Q)=>s2($,Y,J,N,Q,Z),X),J;if(Y.scope_!==$)return J;if(!Y.modified_)return d0($,Y.base_,!0),Y.base_;if(!Y.finalized_){Y.finalized_=!0,Y.scope_.unfinalizedDrafts_--;let N=Y.copy_,Q=N,K=!1;if(Y.type_===3)Q=new Set(N),N.clear(),K=!0;if(c0(Q,(G,z)=>s2($,Y,N,G,z,Z,K),X),d0($,N,!1),Z&&$.patches_)Y0("Patches").generatePatches_(Y,Z,$.patches_,$.inversePatches_)}return Y.copy_}function s2($,J,Z,X,Y,N,Q){if(Y==null)return;if(typeof Y!=="object"&&!Q)return;let K=i0(Y);if(K&&!Q)return;if(B0(Y)){let G=N&&J&&J.type_!==3&&!W2(J.assigned_,X)?N.concat(X):void 0,z=u0($,Y,G);if(t2(Z,X,z),B0(z))$.canAutoFreeze_=!1;else return}else if(Q)Z.add(Y);if(X0(Y)&&!K){if(!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1)return;if(J&&J.base_&&J.base_[X]===Y&&K)return;if(u0($,Y),(!J||!J.scope_.parent_)&&typeof X!=="symbol"&&(O0(Z)?Z.has(X):Object.prototype.propertyIsEnumerable.call(Z,X)))d0($,Y)}}function d0($,J,Z=!1){if(!$.parent_&&$.immer_.autoFreeze_&&$.canAutoFreeze_)w2(J,Z)}function c1($,J){let Z=Array.isArray($),X={type_:Z?1:0,scope_:J?J.scope_:e2(),modified_:!1,finalized_:!1,assigned_:{},parent_:J,base_:$,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,N=V2;if(Z)Y=[X],N=P0;let{revoke:Q,proxy:K}=Proxy.revocable(Y,N);return X.draft_=K,X.revoke_=Q,K}var V2={get($,J){if(J===b)return $;let Z=Z0($);if(!W2(Z,J))return u1($,Z,J);let X=Z[J];if($.finalized_||!X0(X))return X;if(X===q2($.base_,J))return B2($),$.copy_[J]=F2(X,$);return X},has($,J){return J in Z0($)},ownKeys($){return Reflect.ownKeys(Z0($))},set($,J,Z){let X=$5(Z0($),J);if(X?.set)return X.set.call($.draft_,Z),!0;if(!$.modified_){let Y=q2(Z0($),J),N=Y?.[b];if(N&&N.base_===Z)return $.copy_[J]=Z,$.assigned_[J]=!1,!0;if(_1(Z,Y)&&(Z!==void 0||W2($.base_,J)))return!0;B2($),U2($)}if($.copy_[J]===Z&&(Z!==void 0||(J in $.copy_))||Number.isNaN(Z)&&Number.isNaN($.copy_[J]))return!0;return $.copy_[J]=Z,$.assigned_[J]=!0,!0},deleteProperty($,J){if(q2($.base_,J)!==void 0||J in $.base_)$.assigned_[J]=!1,B2($),U2($);else delete $.assigned_[J];if($.copy_)delete $.copy_[J];return!0},getOwnPropertyDescriptor($,J){let Z=Z0($),X=Reflect.getOwnPropertyDescriptor(Z,J);if(!X)return X;return{writable:!0,configurable:$.type_!==1||J!=="length",enumerable:X.enumerable,value:Z[J]}},defineProperty(){u(11)},getPrototypeOf($){return C0($.base_)},setPrototypeOf(){u(12)}},P0={};c0(V2,($,J)=>{P0[$]=function(){return arguments[0]=arguments[0][0],J.apply(this,arguments)}});P0.deleteProperty=function($,J){return P0.set.call(this,$,J,void 0)};P0.set=function($,J,Z){return V2.set.call(this,$[0],J,Z,$[0])};function q2($,J){let Z=$[b];return(Z?Z0(Z):$)[J]}function u1($,J,Z){let X=$5(J,Z);return X?"value"in X?X.value:X.get?.call($.draft_):void 0}function $5($,J){if(!(J in $))return;let Z=C0($);while(Z){let X=Object.getOwnPropertyDescriptor(Z,J);if(X)return X;Z=C0(Z)}return}function U2($){if(!$.modified_){if($.modified_=!0,$.parent_)U2($.parent_)}}function B2($){if(!$.copy_)$.copy_=z2($.base_,$.scope_.immer_.useStrictShallowCopy_)}var d1=class{constructor($){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(J,Z,X)=>{if(typeof J==="function"&&typeof Z!=="function"){let N=Z;Z=J;let Q=this;return function(G=N,...z){return Q.produce(G,(M)=>Z.call(this,M,...z))}}if(typeof Z!=="function")u(6);if(X!==void 0&&typeof X!=="function")u(7);let Y;if(X0(J)){let N=n2(this),Q=F2(J,void 0),K=!0;try{Y=Z(Q),K=!1}finally{if(K)G2(N);else M2(N)}return i2(N,X),o2(Y,N)}else if(!J||typeof J!=="object"){if(Y=Z(J),Y===void 0)Y=J;if(Y===r2)Y=void 0;if(this.autoFreeze_)w2(Y,!0);if(X){let N=[],Q=[];Y0("Patches").generateReplacementPatches_(J,Y,N,Q),X(N,Q)}return Y}else u(1,J)},this.produceWithPatches=(J,Z)=>{if(typeof J==="function")return(Q,...K)=>this.produceWithPatches(Q,(G)=>J(G,...K));let X,Y;return[this.produce(J,Z,(Q,K)=>{X=Q,Y=K}),X,Y]},typeof $?.autoFreeze==="boolean")this.setAutoFreeze($.autoFreeze);if(typeof $?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy($.useStrictShallowCopy);if(typeof $?.useStrictIteration==="boolean")this.setUseStrictIteration($.useStrictIteration)}createDraft($){if(!X0($))u(8);if(B0($))$=l1($);let J=n2(this),Z=F2($,void 0);return Z[b].isManual_=!0,M2(J),Z}finishDraft($,J){let Z=$&&$[b];if(!Z||!Z.isManual_)u(9);let{scope_:X}=Z;return i2(X,J),o2(void 0,X)}setAutoFreeze($){this.autoFreeze_=$}setUseStrictShallowCopy($){this.useStrictShallowCopy_=$}setUseStrictIteration($){this.useStrictIteration_=$}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches($,J){let Z;for(Z=J.length-1;Z>=0;Z--){let Y=J[Z];if(Y.path.length===0&&Y.op==="replace"){$=Y.value;break}}if(Z>-1)J=J.slice(Z+1);let X=Y0("Patches").applyPatches_;if(B0($))return X($,J);return this.produce($,(Y)=>X(Y,J))}};function F2($,J){let Z=O0($)?Y0("MapSet").proxyMap_($,J):p0($)?Y0("MapSet").proxySet_($,J):c1($,J);return(J?J.scope_:e2()).drafts_.push(Z),Z}function l1($){if(!B0($))u(10,$);return J5($)}function J5($){if(!X0($)||i0($))return $;let J=$[b],Z,X=!0;if(J){if(!J.modified_)return J.base_;J.finalized_=!0,Z=z2($,J.scope_.immer_.useStrictShallowCopy_),X=J.scope_.immer_.shouldUseStrictIteration()}else Z=z2($,!0);if(c0(Z,(Y,N)=>{t2(Z,Y,J5(N))},X),J)J.finalized_=!1;return Z}var p1=new d1,Z5=p1.produce;var i1=($)=>(J,Z,X)=>{return X.setState=(Y,N,...Q)=>{let K=typeof Y==="function"?Z5(Y):Y;return J(K,N,...Q)},$(X.setState,Z,X)},X5=i1;var o0=n0()(Y5(X5(($,J)=>({members:[],loading:!1,fetchMembers:async(Z,X,Y)=>{if(!Y&&J().loadedTeamId===Z&&J().loadedWithAgents===X)return;$({loading:!0});try{let N=await T0.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{includeAgents:X?"true":"false"}});if(!N.ok)throw Error("failed to fetch members");let Q=await N.json();$({members:Q||[],loadedTeamId:Z,loadedWithAgents:X,loading:!1})}catch{$({loading:!1})}}}))));var Q5=n0(($)=>({fields:[],loadedProjectId:null,setFields:(J,Z)=>$({fields:J,loadedProjectId:Z}),updateFields:(J)=>$({fields:J})}));function L2($,J,Z){let X=y($,Z?.in);if(isNaN(J))return S0(Z?.in||$,NaN);if(!J)return X;let Y=X.getDate(),N=S0(Z?.in||$,X.getTime());N.setMonth(X.getMonth()+J+1,0);let Q=N.getDate();if(Y>=Q)return N;else return X.setFullYear(N.getFullYear(),N.getMonth(),Y),X}function H5($,J){let Z=y($,J?.in),X=Z.getMonth();return Z.setFullYear(Z.getFullYear(),X+1,0),Z.setHours(23,59,59,999),Z}function N5($,J){let[Z,X]=K5($,J.start,J.end);return{start:Z,end:X}}function q5($,J){let{start:Z,end:X}=N5(J?.in,$),Y=+Z>+X,N=Y?+Z:+X,Q=Y?X:Z;Q.setHours(0,0,0,0);let K=J?.step??1;if(!K)return[];if(K<0)K=-K,Y=!Y;let G=[];while(+Q<=N)G.push(S0(Z,Q)),Q.setDate(Q.getDate()+K),Q.setHours(0,0,0,0);return Y?G.reverse():G}function s0($,J){return y($,J?.in).getDate()}function B5($,J){return y($,J?.in).getDay()}function R2($,J){return y($,J?.in).getHours()}function A2($,J){return y($,J?.in).getMinutes()}function C2($,J){return y($,J?.in).getMonth()}function k2($,J){return y($,J?.in).getFullYear()}var r=d(l(),1);var n1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.date,[N,Q]=r.useState(!1),K=r.useRef(null),G=$?new Date($):new Date,z=W0(G)?G:new Date,[M,U]=r.useState(z);r.useEffect(()=>{if(N&&$){let q=new Date($);if(W0(q))U(q)}},[N,$]),r.useEffect(()=>{let q=(C)=>{if(K.current&&!K.current.contains(C.target)){if(N)Q(!1)}};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[N]);let W=()=>{if(!X)Q(!0)},w=(q)=>{if(!q)return"";let C=new Date(q);if(!W0(C))return"Invalid Date";let T="PPP";if(Y?.displayFormat==="usa")T="MM/dd/yyyy";else if(Y?.displayFormat==="euro")T="dd/MM/yyyy";else if(Y?.displayFormat==="iso")T="yyyy-MM-dd";if(Y?.includeTime)if(Y?.timeFormat==="twenty_four_hour")T+=" HH:mm";else T+=" p";let D=P2(C,T);if(Y?.displayTimezone)D+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return D},B=new Date(M.getFullYear(),M.getMonth(),1),O=H5(M),P=q5({start:B,end:O}),A=B5(B),S=(q)=>{let C=new Date(q);if(Y?.includeTime)C.setHours(R2(z)),C.setMinutes(A2(z));let T=C.toISOString();if(Z(T),!Y?.includeTime)Q(!1)},F=(q,C)=>{let T=$?new Date($):new Date;if(!W0(T))T.setTime(new Date().getTime());if(q==="hour")T.setHours(C);if(q==="minute")T.setMinutes(C);let D=T.toISOString();Z(D)},L=Array.from({length:24},(q,C)=>C),V=Array.from({length:12},(q,C)=>C*5);if(N)return R("div",{className:"relative w-full",ref:K,children:[H("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:$?w($):H("span",{className:"text-muted-foreground",children:"Select date..."})}),R("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[R("div",{className:"p-4 w-64",children:[R("div",{className:"flex justify-between items-center mb-4",children:[H("button",{onClick:()=>U(L2(M,-1)),className:"p-1 hover:bg-accent rounded",children:H(W5,{className:"w-4 h-4"})}),H("span",{className:"font-semibold text-sm",children:P2(M,"MMMM yyyy")}),H("button",{onClick:()=>U(L2(M,1)),className:"p-1 hover:bg-accent rounded",children:H(z5,{className:"w-4 h-4"})})]}),H("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((q)=>H("div",{children:q},q))}),R("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:A}).map((q,C)=>H("div",{},`empty-${C}`)),P.map((q)=>{let C=$?new Date($):null,T=C&&W0(C)&&s0(C)===s0(q)&&C2(C)===C2(q)&&k2(C)===k2(q);return H("button",{onClick:()=>S(q),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${T?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:s0(q)},q.toString())})]})]}),Y?.includeTime&&R("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[R("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[H(G5,{className:"w-3 h-3"})," Time"]}),R("div",{className:"flex flex-1 h-64",children:[H("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:L.map((q)=>H("div",{onClick:()=>F("hour",q),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R2(z)===q?"bg-primary/10 font-medium text-primary":""}`,children:q.toString().padStart(2,"0")},q))}),H("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:V.map((q)=>H("div",{onClick:()=>F("minute",q),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${A2(z)===q?"bg-primary/10 font-medium text-primary":""}`,children:q.toString().padStart(2,"0")},q))})]})]})]})]});return H("div",{onClick:W,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$?w($):H("span",{className:"text-muted-foreground italic",children:"Empty"})})},M5=n1;var p=d(l(),1);var o1=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=p.useState(!1),[N,Q]=p.useState($||""),K=p.useRef(null),G=p.useRef(null),[z,M]=p.useState(!1);p.useEffect(()=>{Q($||"")},[$]),p.useEffect(()=>{if(X&&K.current)K.current.focus(),M(!1)},[X]),p.useEffect(()=>{let B=(O)=>{if(z&&G.current&&!G.current.contains(O.target))M(!1)};if(z)document.addEventListener("mousedown",B);return()=>{document.removeEventListener("mousedown",B)}},[z]);let U=()=>{Y(!1),J(N)},W=(B)=>{B.stopPropagation(),M(!0)},w=(B)=>{if(B.stopPropagation(),!Z)Y(!0)};if(X)return H("textarea",{ref:K,value:N,onChange:(B)=>Q(B.target.value),onBlur:U,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return R("div",{ref:G,className:"relative w-full text-sm",children:[H("div",{onClick:W,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 line-clamp-2 max-h-[3rem] overflow-hidden ${!Z?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:$?$:H("span",{className:"text-muted-foreground italic",children:"Empty"})}),z&&H("div",{onClick:w,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!Z?"cursor-text":""}`,children:$?$:H("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},U5=o1;var a=d(l(),1);var s1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.number,[N,Q]=a.useState(!1),[K,G]=a.useState(""),z=a.useRef(null);a.useEffect(()=>{G($!==void 0&&$!==null?$.toString():"")},[$]),a.useEffect(()=>{if(N&&z.current)z.current.focus()},[N]);let M=()=>{if(!X)Q(!0)},U=()=>{if(Q(!1),K==="")Z(void 0);else{let B=parseFloat(K);Z(isNaN(B)?void 0:B)}},W=(B)=>{if(B.key==="Enter")B.stopPropagation(),z.current?.blur()},w=(B)=>{if(B===void 0||B===null||isNaN(B))return"";return B.toFixed(Y?.scale)};if(N)return H("input",{ref:z,type:"number",step:1/Math.pow(10,Y?.scale||0),value:K,onChange:(B)=>G(B.target.value),onBlur:U,onKeyDown:W,onDoubleClick:(B)=>B.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return H("div",{onClick:M,onDoubleClick:(B)=>B.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$!==void 0&&$!==null?w($):H("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},F5=s1;var w5=d(l(),1);var r1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.rating,N=Math.max(2,Math.min(6,Y?.maxValue||5)),[Q,K]=w5.useState(null),G=(M,U)=>{if(M.stopPropagation(),X)return;let W;if($===U)W=0;else W=U;Z(W)},z=Array.from({length:N},(M,U)=>U+1);return H("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!X&&K(null),onDoubleClick:(M)=>M.stopPropagation(),children:z.map((M)=>{let U=Q!==null?M<=Q:M<=($||0);return H("button",{onClick:(W)=>G(W,M),onMouseEnter:()=>!X&&K(M),className:`focus:outline-none transition-transform ${!X?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:X,children:H(r0,{className:`w-5 h-5 transition-colors ${U?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},M)})})},V5=r1;var S1=d(l(),1);function i({...$}){return H(f0.Root,{"data-slot":"popover",...$})}function n({...$}){return H(f0.Trigger,{"data-slot":"popover-trigger",...$})}function o({className:$,align:J="center",sideOffset:Z=4,...X}){return H(f0.Portal,{children:H(f0.Content,{"data-slot":"popover-content",align:J,sideOffset:Z,className:a0("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",$),...X})})}var Q0;(function($){$.Base32IncorrectEncoding="B32_ENC_INVALID",$.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",$.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",$.EncodeTimeNegative="ENC_TIME_NEG",$.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",$.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",$.PRNGDetectFailure="PRNG_DETECT",$.ULIDInvalid="ULID_INVALID",$.Unexpected="UNEXPECTED",$.UUIDInvalid="UUID_INVALID"})(Q0||(Q0={}));class z0 extends Error{constructor($,J){super(`${J} (${$})`);this.name="ULIDError",this.code=$}}function a1($){let J=Math.floor($()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(J)}function t1($){let J=e1(),Z=J&&(J.crypto||J.msCrypto)||null;if(typeof Z?.getRandomValues==="function")return()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]/256};else if(typeof Z?.randomBytes==="function")return()=>Z.randomBytes(1).readUInt8()/256;throw new z0(Q0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function e1(){if(Z4())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function $4($,J){let Z="";for(;$>0;$--)Z=a1(J)+Z;return Z}function J4($,J=10){if(isNaN($))throw new z0(Q0.EncodeTimeValueMalformed,`Time must be a number: ${$}`);else if($>281474976710655)throw new z0(Q0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${$}`);else if($<0)throw new z0(Q0.EncodeTimeNegative,`Time must be positive: ${$}`);else if(Number.isInteger($)===!1)throw new z0(Q0.EncodeTimeValueMalformed,`Time must be an integer: ${$}`);let Z,X="";for(let Y=J;Y>0;Y--)Z=$%32,X="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(Z)+X,$=($-Z)/32;return X}function Z4(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function L5($,J){let Z=J||t1(),X=!$||isNaN($)?Date.now():$;return J4(X,10)+$4(16,Z)}var h0=d(l(),1);var{create:X4,defineProperty:u5,defineProperties:Y4,getOwnPropertyDescriptor:Q4,getOwnPropertyDescriptors:H4,getOwnPropertySymbols:Z2}=Object,d5=Object.prototype.hasOwnProperty,l5=Object.prototype.propertyIsEnumerable,K4=($,J)=>(J=Symbol[$])?J:Symbol.for("Symbol."+$),y0=($)=>{throw TypeError($)},j2=($,J,Z)=>(J in $)?u5($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,R5=($,J)=>{for(var Z in J||(J={}))if(d5.call(J,Z))j2($,Z,J[Z]);if(Z2){for(var Z of Z2(J))if(l5.call(J,Z))j2($,Z,J[Z])}return $},A5=($,J)=>Y4($,H4(J)),N4=($,J)=>{var Z={};for(var X in $)if(d5.call($,X)&&J.indexOf(X)<0)Z[X]=$[X];if($!=null&&Z2){for(var X of Z2($))if(J.indexOf(X)<0&&l5.call($,X))Z[X]=$[X]}return Z},q4=($)=>{var J;return[,,,X4((J=void 0)!=null?J:null)]},p5=["class","method","getter","setter","accessor","field","value","get","set"],I0=($)=>$!==void 0&&typeof $!=="function"?y0("Function expected"):$,B4=($,J,Z,X,Y)=>({kind:p5[$],name:J,metadata:X,addInitializer:(N)=>Z._?y0("Already initialized"):Y.push(I0(N||null))}),W4=($,J)=>j2(J,K4("metadata"),$[3]),t0=($,J,Z,X)=>{for(var Y=0,N=$[J>>1],Q=N&&N.length;Y<Q;Y++)J&1?N[Y].call(Z):X=N[Y].call(Z,X);return X},i5=($,J,Z,X,Y,N)=>{var Q,K,G,z,M,U=J&7,W=!1,w=!1,B=$.length+1,O=p5[U+5],P=$[B-1]=[],A=$[B]||($[B]=[]),S=(Y=Y.prototype,Q4({get[Z](){return D0(this,N)},set[Z](L){return H0(this,N,L)}},Z));for(var F=X.length-1;F>=0;F--)if(z=B4(U,Z,G={},$[3],A),z.static=W,z.private=w,M=z.access={has:(L)=>(Z in L)},M.get=(L)=>L[Z],M.set=(L,V)=>L[Z]=V,K=(0,X[F])({get:S.get,set:S.set},z),G._=1,K===void 0)I0(K)&&(S[O]=K);else if(typeof K!=="object"||K===null)y0("Object expected");else I0(Q=K.get)&&(S.get=Q),I0(Q=K.set)&&(S.set=Q),I0(Q=K.init)&&P.unshift(Q);return S&&u5(Y,Z,S),Y},n5=($,J,Z)=>J.has($)||y0("Cannot "+Z),D0=($,J,Z)=>(n5($,J,"read from private field"),J.get($)),E0=($,J,Z)=>J.has($)?y0("Cannot add the same private member more than once"):J instanceof WeakSet?J.add($):J.set($,Z),H0=($,J,Z,X)=>(n5($,J,"write to private field"),J.set($,Z),Z);function K0($){return $ instanceof g2||$ instanceof r5}var e0=10,z4=class extends y2{constructor($){super($);let J=S5(()=>{let{dragOperation:X}=$;if(!x2(X.activatorEvent))return;if(!K0(X.source))return;if(X.status.initialized){let Y=$.registry.plugins.get(m5);if(Y)return Y.disable(),()=>Y.enable()}}),Z=$.monitor.addEventListener("dragmove",(X,Y)=>{queueMicrotask(()=>{if(this.disabled||X.defaultPrevented||!X.nativeEvent)return;let{dragOperation:N}=Y;if(!x2(X.nativeEvent))return;if(!K0(N.source))return;if(!N.shape)return;let{actions:Q,collisionObserver:K,registry:G}=Y,{by:z}=X;if(!z)return;let M=G4(z),{source:U,target:W}=N,{center:w}=N.shape.current,B=[],O=[];_(()=>{for(let V of G.droppables){let{id:q}=V;if(!V.accepts(U)||q===(W==null?void 0:W.id)&&K0(V)||!V.element)continue;let C=V.shape,T=new D2(V.element,{getBoundingClientRect:(D)=>I5(D,void 0,0.2)});if(!T.height||!T.width)continue;if(M=="down"&&w.y+e0<T.center.y||M=="up"&&w.y-e0>T.center.y||M=="left"&&w.x-e0>T.center.x||M=="right"&&w.x+e0<T.center.x)B.push(V),V.shape=T,O.push(()=>V.shape=C)}}),X.preventDefault(),K.disable();let P=K.computeCollisions(B,h5);_(()=>O.forEach((V)=>V()));let[A]=P;if(!A)return;let{id:S}=A,{index:F,group:L}=U.sortable;Q.setDropTarget(S).then(()=>{let{source:V,target:q,shape:C}=N;if(!V||!K0(V)||!C)return;let{index:T,group:D,target:x}=V.sortable,g=F!==T||L!==D,m=g?x:q==null?void 0:q.element;if(!m)return;y5(m);let k=new D2(m);if(!k)return;let f=f2.delta(k,f2.from(C.current.boundingRectangle),V.alignment);if(Q.move({by:f}),g)Q.setDropTarget(V.id).then(()=>K.enable());else K.enable()})})});this.destroy=()=>{Z(),J()}}};function G4($){let{x:J,y:Z}=$;if(J>0)return"right";else if(J<0)return"left";else if(Z>0)return"down";else if(Z<0)return"up"}var{defineProperty:M4,defineProperties:U4,getOwnPropertyDescriptors:F4,getOwnPropertySymbols:C5}=Object,w4=Object.prototype.hasOwnProperty,V4=Object.prototype.propertyIsEnumerable,k5=($,J,Z)=>(J in $)?M4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,G0=($,J)=>{for(var Z in J||(J={}))if(w4.call(J,Z))k5($,Z,J[Z]);if(C5){for(var Z of C5(J))if(V4.call(J,Z))k5($,Z,J[Z])}return $},M0=($,J)=>U4($,F4(J));function L4($,J,Z){if(J===Z)return $;let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}function O2($){return"initialIndex"in $&&typeof $.initialIndex==="number"&&"index"in $&&typeof $.index==="number"}function R4($,J,Z){var X,Y,N;let{source:Q,target:K,canceled:G}=J.operation;if(!Q||!K||G){if("preventDefault"in J)J.preventDefault();return $}let z=(L,V)=>L===V||typeof L==="object"&&("id"in L)&&L.id===V;if(Array.isArray($)){let L=$.findIndex((q)=>z(q,Q.id)),V=$.findIndex((q)=>z(q,K.id));if(L===-1||V===-1){if(O2(Q)){let{initialIndex:q,index:C}=Q;if(q===C||q<0||q>=$.length){if("preventDefault"in J)J.preventDefault();return $}return Z($,q,C)}return $}if(!G&&"index"in Q&&typeof Q.index==="number"){let q=Q.index;if(q!==L)return Z($,L,q)}return Z($,L,V)}let M=Object.entries($),U=-1,W,w=-1,B;for(let[L,V]of M){if(U===-1){if(U=V.findIndex((q)=>z(q,Q.id)),U!==-1)W=L}if(w===-1){if(w=V.findIndex((q)=>z(q,K.id)),w!==-1)B=L}if(U!==-1&&w!==-1)break}if(U===-1&&O2(Q)){let{initialGroup:L,initialIndex:V,group:q,index:C}=Q;if(L==null||q==null||!(L in $)||!(q in $)){if("preventDefault"in J)J.preventDefault();return $}if(L===q&&V===C){if("preventDefault"in J)J.preventDefault();return $}if(L===q)return M0(G0({},$),{[L]:Z($[L],V,C)});let T=$[L][V];return M0(G0({},$),{[L]:[...$[L].slice(0,V),...$[L].slice(V+1)],[q]:[...$[q].slice(0,C),T,...$[q].slice(C)]})}if(!Q.manager)return $;let{dragOperation:O}=Q.manager,P=(Y=(X=O.shape)==null?void 0:X.current.center)!=null?Y:O.position.current;if(B==null){if(K.id in $){let L=K.shape&&P.y>K.shape.center.y?$[K.id].length:0;B=K.id,w=L}}if(W==null||B==null||W===B&&U===w){if(W!=null&&W===B&&U===w&&O2(Q)){let L=Q.group!=null&&Q.group!==W,V=Q.index!==U;if(L||V){let q=(N=Q.group)!=null?N:W;if(q in $){if(W===q)return M0(G0({},$),{[W]:Z($[W],U,Q.index)});let C=$[W][U];return M0(G0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[q]:[...$[q].slice(0,Q.index),C,...$[q].slice(Q.index)]})}}}if("preventDefault"in J)J.preventDefault();return $}if(W===B)return M0(G0({},$),{[W]:Z($[W],U,w)});let S=K.shape&&Math.round(P.y)>Math.round(K.shape.center.y)?1:0,F=$[W][U];return M0(G0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[B]:[...$[B].slice(0,w+S),F,...$[B].slice(w+S)]})}function A4($,J){return R4($,J,L4)}var P5="__default__",C4=class extends y2{constructor($){super($);let J=()=>{let X=new Map;for(let Y of $.registry.droppables)if(Y instanceof g2){let{sortable:N}=Y,{group:Q}=N,K=X.get(Q);if(!K)K=new Set,X.set(Q,K);K.add(N)}for(let[Y,N]of X)X.set(Y,new Set($2(N)));return X},Z=[$.monitor.addEventListener("dragover",(X,Y)=>{if(this.disabled)return;let{dragOperation:N}=Y,{source:Q,target:K}=N;if(!K0(Q)||!K0(K))return;if(Q.sortable===K.sortable)return;let G=J(),z=Q.sortable.group===K.sortable.group,M=G.get(Q.sortable.group),U=z?M:G.get(K.sortable.group);if(!M||!U)return;queueMicrotask(()=>{if(X.defaultPrevented)return;Y.renderer.rendering.then(()=>{var W,w,B;let O=J();for(let[x,g]of G.entries()){let m=Array.from(g).entries();for(let[k,f]of m)if(f.index!==k||f.group!==x||!((W=O.get(x))==null?void 0:W.has(f)))return}let P=Q.sortable.element,A=K.sortable.element;if(!A||!P)return;if(!z&&K.id===Q.sortable.group)return;let S=$2(M),F=z?S:$2(U),L=(w=Q.sortable.group)!=null?w:P5,V=(B=K.sortable.group)!=null?B:P5,q={[L]:S,[V]:F},C=A4(q,X);if(q===C)return;let T=C[V].indexOf(Q.sortable),D=C[V].indexOf(K.sortable);Y.collisionObserver.disable(),O5(P,T,A,D),_(()=>{for(let[x,g]of C[L].entries())g.index=x;if(!z)for(let[x,g]of C[V].entries())g.group=K.sortable.group,g.index=x}),Y.actions.setDropTarget(Q.id).then(()=>Y.collisionObserver.enable())})})}),$.monitor.addEventListener("dragend",(X,Y)=>{if(!X.canceled)return;let{dragOperation:N}=Y,{source:Q}=N;if(!K0(Q))return;if(Q.sortable.initialIndex===Q.sortable.index&&Q.sortable.initialGroup===Q.sortable.group)return;queueMicrotask(()=>{let K=J(),G=K.get(Q.sortable.initialGroup);if(!G)return;Y.renderer.rendering.then(()=>{for(let[w,B]of K.entries()){let O=Array.from(B).entries();for(let[P,A]of O)if(A.index!==P||A.group!==w)return}let z=$2(G),M=Q.sortable.element,U=z[Q.sortable.initialIndex],W=U==null?void 0:U.element;if(!U||!W||!M)return;O5(M,U.index,W,Q.index),_(()=>{for(let[w,B]of K.entries()){let O=Array.from(B).values();for(let P of O)P.index=P.initialIndex,P.group=P.initialGroup}})})})})];this.destroy=()=>{for(let X of Z)X()}}};function O5($,J,Z,X){let Y=X<J?"afterend":"beforebegin";Z.insertAdjacentElement(Y,$)}function k4($,J){return $.index-J.index}function $2($){return Array.from($).sort(k4)}var T5=[z4,C4],v2={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},J2=new f5,o5,s5,t,_2,x0,j0,h2,U0;s5=[S2],o5=[S2];var v0=class{constructor($,J){E0(this,_2,t0(t,8,this)),t0(t,11,this),E0(this,x0),E0(this,j0),E0(this,h2,t0(t,12,this)),t0(t,15,this),E0(this,U0),this.register=()=>{return _(()=>{var W,w;(W=this.manager)==null||W.registry.register(this.droppable),(w=this.manager)==null||w.registry.register(this.draggable)}),()=>this.unregister()},this.unregister=()=>{_(()=>{var W,w;(W=this.manager)==null||W.registry.unregister(this.droppable),(w=this.manager)==null||w.registry.unregister(this.draggable)})},this.destroy=()=>{_(()=>{this.droppable.destroy(),this.draggable.destroy()})};var Z=$,{effects:X=()=>[],group:Y,index:N,sensors:Q,type:K,transition:G=v2,plugins:z}=Z,M=N4(Z,["effects","group","index","sensors","type","transition","plugins"]);let U=E2(z,T5);this.droppable=new g2(M,J,this),this.draggable=new r5(A5(R5({},M),{plugins:U,effects:()=>[()=>{var W,w,B;let O=(W=this.manager)==null?void 0:W.dragOperation.status;if((O==null?void 0:O.initializing)&&this.id===((B=(w=this.manager)==null?void 0:w.dragOperation.source)==null?void 0:B.id))J2.clear(this.manager);if(O==null?void 0:O.dragging)J2.set(this.manager,this.id,T2(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:W,group:w,manager:B}=this,O=D0(this,j0),P=D0(this,x0);if(W!==O||w!==P)H0(this,j0,W),H0(this,x0,w),this.animate()},()=>{var W,w;let{target:B}=this,{isDragSource:O}=this.draggable;if(((w=(W=this.draggable.pluginConfig(g5))==null?void 0:W.feedback)!=null?w:"default")==="move"&&O)this.droppable.disabled=!B},...X()],type:K,sensors:Q}),J,this),H0(this,U0,M.element),this.manager=J,this.index=N,H0(this,j0,N),this.group=Y,H0(this,x0,Y),this.type=K,this.transition=G}get initialIndex(){var $,J;return(J=($=J2.get(this.manager,this.id))==null?void 0:$.initialIndex)!=null?J:this.index}get initialGroup(){var $,J;return(J=($=J2.get(this.manager,this.id))==null?void 0:$.initialGroup)!=null?J:this.group}animate(){T2(()=>{let{manager:$,transition:J}=this,{shape:Z}=this.droppable;if(!$)return;let{idle:X}=$.dragOperation.status;if(!Z||!J||X&&!J.idle)return;$.renderer.rendering.then(()=>{let{element:Y}=this;if(!Y)return;for(let M of Y.getAnimations())if("transitionProperty"in M&&(M.transitionProperty==="transform"||M.transitionProperty==="translate"||M.transitionProperty==="scale"))M.cancel();let N=this.refreshShape();if(!N)return;let Q={x:Z.boundingRectangle.left-N.boundingRectangle.left,y:Z.boundingRectangle.top-N.boundingRectangle.top},{translate:K}=j5(Y),G=I2(Y,K,!1),z=I2(Y,K);if(Q.x||Q.y){let M=D5(E5(Y))?A5(R5({},J),{duration:0}):J;v5({element:Y,keyframes:{translate:[`${G.x+Q.x}px ${G.y+Q.y}px ${G.z}`,`${z.x}px ${z.y}px ${z.z}`]},options:M}).then(()=>{if(!$.dragOperation.status.dragging)this.droppable.shape=void 0})}})})}get manager(){return this.draggable.manager}set manager($){_(()=>{this.draggable.manager=$,this.droppable.manager=$})}set element($){_(()=>{let J=D0(this,U0),Z=this.droppable.element,X=this.draggable.element;if(!Z||Z===J)this.droppable.element=$;if(!X||X===J)this.draggable.element=$;H0(this,U0,$)})}get element(){var $,J;let Z=D0(this,U0);if(!Z)return;return(J=($=x5.get(Z))!=null?$:Z)!=null?J:this.droppable.element}set target($){this.droppable.element=$}get target(){return this.droppable.element}set source($){this.draggable.element=$}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set plugins($){this.draggable.plugins=E2($,T5)}set disabled($){_(()=>{this.droppable.disabled=$,this.draggable.disabled=$})}set data($){_(()=>{this.droppable.data=$,this.draggable.data=$})}set handle($){this.draggable.handle=$}set id($){this.droppable.id=$,this.draggable.id=$}get id(){return this.droppable.id}set sensors($){this.draggable.sensors=$}set modifiers($){this.draggable.modifiers=$}set collisionPriority($){this.droppable.collisionPriority=$}set collisionDetector($){this.droppable.collisionDetector=$!=null?$:_5}set alignment($){this.draggable.alignment=$}get alignment(){return this.draggable.alignment}set type($){_(()=>{this.droppable.type=$,this.draggable.type=$})}get type(){return this.draggable.type}set accept($){this.droppable.accept=$}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts($){return this.droppable.accepts($)}};t=q4();_2=new WeakMap;x0=new WeakMap;j0=new WeakMap;h2=new WeakMap;U0=new WeakMap;i5(t,4,"index",s5,v0,_2);i5(t,4,"group",o5,v0,h2);W4(t,v0);var r5=class extends b5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},g2=class extends c5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get group(){return this.sortable.group}};var{defineProperty:P4,defineProperties:O4,getOwnPropertyDescriptors:T4,getOwnPropertySymbols:a5}=Object,S4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,t5=($,J,Z)=>(J in $)?P4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,m2=($,J)=>{for(var Z in J||(J={}))if(S4.call(J,Z))t5($,Z,J[Z]);if(a5){for(var Z of a5(J))if(f4.call(J,Z))t5($,Z,J[Z])}return $},E4=($,J)=>O4($,T4(J));function X1($){let{accept:J,collisionDetector:Z,collisionPriority:X,id:Y,data:N,element:Q,handle:K,index:G,group:z,disabled:M,modifiers:U,sensors:W,target:w,type:B,plugins:O}=$,P=m2(m2({},v2),$.transition),A=Z1((F)=>{return new v0(E4(m2({},$),{transition:P,register:!1,handle:X2(K),element:X2(Q),target:X2(w)}),F)}),S=$1(A,I4);return h(Y,()=>A.id=Y),e5(()=>{_(()=>{A.group=z,A.index=G})},[A,z,G]),h(B,()=>A.type=B),h(J,()=>A.accept=J,void 0,_0),h(N,()=>N&&(A.data=N)),h(G,()=>{var F;if(((F=A.manager)==null?void 0:F.dragOperation.status.idle)&&(P==null?void 0:P.idle))A.refreshShape()},J1),Y2(K,(F)=>A.handle=F),Y2(Q,(F)=>A.element=F),Y2(w,(F)=>A.target=F),h(M,()=>A.disabled=M===!0),h(W,()=>A.sensors=W),h(Z,()=>A.collisionDetector=Z),h(X,()=>A.collisionPriority=X),h(O,()=>A.plugins=O,void 0,_0),h(P,()=>A.transition=P,void 0,_0),h(U,()=>A.modifiers=U,void 0,_0),h($.alignment,()=>A.alignment=$.alignment),{sortable:S,get isDragging(){return S.isDragging},get isDropping(){return S.isDropping},get isDragSource(){return S.isDragSource},get isDropTarget(){return S.isDropTarget},handleRef:h0.useCallback((F)=>{A.handle=F!=null?F:void 0},[A]),ref:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.element)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.element=F!=null?F:void 0},[A]),sourceRef:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.source)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.source=F!=null?F:void 0},[A]),targetRef:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.target)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.target=F!=null?F:void 0},[A])}}function I4($,J,Z){if($==="isDragSource"&&!Z&&J)return!0;return!1}function Y1($,J,Z){let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}async function H$($){let J=[],Z=[],X=$.items;if(X)for(let Q=0;Q<X.length;Q++){let K=X[Q];if(K.kind==="file"){let G=K.webkitGetAsEntry?.();if(G)Z.push({entry:G,path:""})}}else return Array.from($.files);let Y=(Q)=>{return new Promise((K)=>{Q.readEntries((G)=>K(G),()=>K([]))})},N=(Q)=>{return new Promise((K,G)=>{Q.file((z)=>K(z),(z)=>G(z))})};while(Z.length>0){let Q=Z.shift();if(!Q)continue;let{entry:K,path:G}=Q;if(K.isFile)try{let z=await N(K),M=G?`${G}/${z.name}`:z.name;Object.defineProperty(z,"webkitRelativePath",{value:M,writable:!1,configurable:!0}),J.push(z)}catch(z){console.error("Error reading file entry:",z)}else if(K.isDirectory){let z=K.createReader(),M=[],U=await Y(z);while(U.length>0)M=M.concat(U),U=await Y(z);let W=G?`${G}/${K.name}`:K.name;for(let w of M)Z.push({entry:w,path:W})}}return J}var c=d(l(),1);var D4=["red","orange","yellow","green","blue","purple","gray"],u2={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function N0($){if(!$)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let J=$.toLowerCase(),Z=u2[J];if(Z)return{backgroundColor:Z.bg,color:Z.text};if($.startsWith("#"))return{backgroundColor:`${$}33`,color:$};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:$}}var x4={[v.text]:F1,[v.longText]:K1,[v.select]:W1,[v.selectMulti]:M1,[v.rating]:r0,[v.number]:B1,[v.toggle]:U1,[v.date]:N1,[v.user]:w1,[v.userMulti]:V1};function j4({field:$,index:J,onVisibilityChange:Z}){let{ref:X,handleRef:Y}=X1({id:$.id,index:J}),N=$.config?.type?x4[$.config.type]:null;return R("div",{ref:X,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[R("div",{className:"flex items-center gap-2",children:[H("div",{ref:Y,className:"cursor-grab",children:H(q1,{className:"h-4 w-4 text-muted-foreground"})}),N&&H(N,{className:"h-4 w-4 text-muted-foreground shrink-0"}),$.aiAutofill&&H(H1,{className:"h-4 w-4 text-muted-foreground shrink-0"}),H("span",{className:"text-sm truncate",children:$.config?.name})]}),H(m0,{checked:$.visible,onCheckedChange:(Q)=>Z($.id,Q)})]})}function O$({projectId:$,onManageFields:J,onSave:Z}){let{fields:X,updateFields:Y}=Q5(),[N,Q]=c.useState(""),[K,G]=c.useState("list"),[z,M]=c.useState(""),[U,W]=c.useState(""),[w,B]=c.useState(!1),[O,P]=c.useState(""),[A,S]=c.useState([]),F=Q1();c.useEffect(()=>{F.invalidateQueries({queryKey:["fields",$]})},[$,F]);let L=T0.api.projects[":projectId"].fields.order.$patch,{mutate:V}=b2({mutationFn:async(k)=>{if(!(await L(k)).ok)throw Error(I.failed_update_fields_order());return null}}),q=T0.api.projects[":projectId"].fields.$post,{mutate:C}=b2({mutationFn:async(k)=>{let f=await q(k);if(!f.ok)throw Error(I.failed_create_field());return await f.json()},onSuccess:(k)=>{let f={...k,visible:!0},E=[...X,f];Y(E),M(""),S([]),V({param:{projectId:$},json:E.map((j)=>({fieldId:j.id,visible:j.visible||!1}))}),Z?.()}}),T=c.useMemo(()=>X.filter((k)=>k.config?.name?.toLowerCase().includes(N.toLowerCase())),[X,N]),D=(k)=>{let{source:f,target:E}=k.operation;if(f&&E&&f.id!==E.id){let j=X.findIndex((q0)=>q0.id===f.id),y1=X.findIndex((q0)=>q0.id===E.id),d2=Y1(X,j,y1);Y(d2),V({param:{projectId:$},json:d2.map((q0)=>({fieldId:q0.id,visible:q0.visible||!1}))})}},x=(k,f)=>{let E=X.map((j)=>j.id===k?{...j,visible:f}:j);Y(E),V({param:{projectId:$},json:E.map((j)=>({fieldId:j.id,visible:j.visible||!1}))})},g=()=>{if(!z||!U)return;let k=U===v.select?{select:{options:A}}:U===v.selectMulti?{selectMulti:{options:A}}:{};C({param:{projectId:$},json:{config:{name:z,type:U,...k},label:z,aiAutofill:w,description:O}})},m=X.filter((k)=>k.visible).length;if(K==="create")return H("div",{className:"w-80 p-4",children:R("div",{className:"space-y-4",children:[R("div",{className:"space-y-2",children:[H(F0,{htmlFor:"field-name",children:I.field_name()}),H(g0,{id:"field-name",placeholder:I.new_field_placeholder(),value:z,onChange:(k)=>M(k.target.value),autoFocus:!0})]}),R("div",{className:"space-y-2",children:[H(F0,{children:I.field_type()}),R(L1,{children:[H(R1,{asChild:!0,children:R(e,{variant:"outline",className:"w-full justify-between font-normal",children:[U?H("span",{className:"capitalize",children:U.replace(/_/g," ")}):H("span",{className:"text-muted-foreground border-dashed",children:I.select_field_type()}),H(w0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),H(A1,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(v).map((k)=>H(C1,{onClick:()=>{W(k),S([])},className:"capitalize",children:k.replace(/_/g," ")},k))})]})]}),R("div",{className:"space-y-2",children:[H(F0,{htmlFor:"field-desc",children:I.description()}),H(g0,{id:"field-desc",placeholder:I.description_optional_placeholder(),value:O,onChange:(k)=>P(k.target.value)})]}),R("div",{className:"flex items-center space-x-2",children:[H(m0,{id:"ai-autofill",checked:w,onCheckedChange:B}),H(F0,{htmlFor:"ai-autofill",children:I.ai_autofill()})]}),(U===v.select||U===v.selectMulti)&&R("div",{className:"space-y-2",children:[R("div",{className:"flex items-center justify-between",children:[H(F0,{className:"text-sm font-medium",children:I.options()}),R(e,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let k={id:L5(),displayName:I.new_option(),color:"#808080"};S([...A,k])},children:[H(c2,{className:"h-4 w-4 mr-1"})," ",I.add_option()]})]}),H("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:A.map((k,f)=>R("div",{className:"flex items-center gap-2",children:[H(g0,{value:k.displayName,onChange:(E)=>{let j=[...A];j[f]={...k,displayName:E.target.value},S(j)},placeholder:I.option_name_placeholder(),className:"h-8 flex-1"}),R(i,{children:[H(n,{asChild:!0,children:H("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:u2[k.color||""]?.hex||k.color||"#808080"}})}),H(o,{className:"p-2 w-auto",align:"end",children:H("div",{className:"flex gap-1",children:D4.map((E)=>H("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:u2[E]?.hex||E},onClick:()=>{let j=[...A];j[f]={...k,color:E},S(j)}},E))})})]}),H(e,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{S(A.filter((E,j)=>j!==f))},children:H(V0,{className:"h-4 w-4"})})]},k.id))})]}),R("div",{className:"flex gap-2 pt-2",children:[H(e,{variant:"secondary",className:"flex-1",onClick:()=>{G("list"),M(""),W(""),B(!1),P(""),S([])},children:I.cancel()}),H(e,{className:"flex-1",onClick:g,disabled:!z||!U,children:I.save()})]})]})});return R("div",{className:"w-80 p-4",children:[H("div",{className:"flex items-center justify-between mb-4",children:R("h3",{className:"font-semibold",children:[I.fields()," ",H("span",{className:"text-muted-foreground text-sm font-normal",children:I.visible_count({count:m})})]})}),R("div",{className:"relative mb-4",children:[H(z1,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),H(g0,{placeholder:I.search_fields_placeholder(),value:N,onChange:(k)=>Q(k.target.value),className:"pl-8"})]}),H("div",{className:"max-h-60 overflow-y-auto pr-2",children:H(T1,{sensors:[O1.configure({activationConstraints:[new P1.Distance({value:8})]}),k1],onDragEnd:D,children:T.map((k,f)=>H(j4,{field:k,index:f,onVisibilityChange:x},k.id))})}),J&&R("div",{className:"mt-4 space-y-2",children:[R(e,{variant:"secondary",className:"w-full",onClick:J,children:[H(G1,{className:"h-4 w-4 mr-2"}),I.manage_fields()]}),R(e,{className:"w-full",onClick:()=>G("create"),children:[H(c2,{className:"h-4 w-4 mr-2"}),I.new_field()]})]})]})}var y4=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.select,[N,Q]=S1.useState(!1),K=Y?.options?.find((W)=>W.id===$),G=()=>{if(!X)Q(!0)},z=(W)=>{Z(W),Q(!1)};return H("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:R(i,{open:!X&&N,onOpenChange:(W)=>{if(X)return;Q(W)},children:[H(n,{asChild:!0,children:R("div",{onClick:G,className:`flex items-center justify-between w-full min-h-[28px] px-2 py-1 rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((W)=>{if(!W)return H("span",{className:"text-muted-foreground italic",children:"Select an option"});return H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(W.color),children:W.displayName})})(K),!X&&H(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),R(o,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[150px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[R("div",{onClick:()=>z(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2",children:[H(V0,{className:"w-3 h-3"})," Clear"]}),Y?.options?.map((W)=>H("div",{onClick:()=>z(W.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center",children:H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(W.color),children:W.displayName})},W.id))]})]})})},f1=y4;var $0=d(l(),1);var v4=({value:$=[],config:J,onSave:Z,readOnly:X})=>{let Y=J?.selectMulti,N=$0.useRef(null),[Q,K]=$0.useState(!1),[G,z]=$0.useState(!1),[M,U]=$0.useState($.length),W=Y?.options?.filter((F)=>($||[]).includes(F.id))||[];$0.useLayoutEffect(()=>{if(Q||G){U(W.length);return}if(N.current){let F=N.current.offsetWidth,V=document.createElement("canvas").getContext("2d");if(V){V.font="12px ui-sans-serif, system-ui, sans-serif";let q=0,C=0,D=F-28;for(let x=0;x<W.length;x++){let m=V.measureText(W[x].displayName).width+16+4;if(q+m>D&&x<W.length-1)break;if(x===W.length-1){if(q+m<=F)C++;break}q+=m,C++}U(C)}}},[W,Q,G,$]);let w=(F)=>{let L=$||[],V;if(L.includes(F))V=L.filter((q)=>q!==F);else V=[...L,F];Z(V)},B=(F)=>{if(F.stopPropagation(),Q)return;let L=W.length-M;if(!G&&L>0)z(!0);else if(!X)K(!0)},O=(F)=>{if(F.stopPropagation(),!X)K(!0)},P=W.length-M;return H("div",{className:"relative w-full",onClick:(F)=>F.stopPropagation(),children:R(i,{open:!X&&(G&&!Q||Q),onOpenChange:(F)=>{if(X)return;if(!F)z(!1),K(!1)},children:[H(n,{asChild:!0,children:R("div",{ref:N,onClick:B,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!X||P>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[W.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.slice(0,M).map((F)=>H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:N0(F.color),children:F.displayName},F.id)),P>0&&R("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",P]})]})}),H(o,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${G&&!Q?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:G&&!Q?O:void 0,children:G&&!Q?R(Q2,{children:[W.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.map((F)=>H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:N0(F.color),children:F.displayName},F.id))]}):Y?.options?.map((F)=>{let L=($||[]).includes(F.id);return R("div",{onClick:()=>w(F.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between",children:[H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(F.color),children:F.displayName}),L&&H(H2,{className:"w-4 h-4 text-primary"})]},F.id)})})]})})},E1=v4;var J0=d(l(),1);var _4=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=J0.useState(!1),[N,Q]=J0.useState($||""),K=J0.useRef(null);J0.useEffect(()=>{Q($||"")},[$]),J0.useEffect(()=>{if(X&&K.current)K.current.focus()},[X]);let G=()=>{if(!Z)Y(!0)},z=()=>{Y(!1),J(N)},M=(U)=>{if(U.key==="Enter")K.current?.blur()};if(X)return H("input",{ref:K,type:"text",value:N,onChange:(U)=>Q(U.target.value),onBlur:z,onKeyDown:M,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return H("div",{onClick:G,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$||H("span",{className:"text-muted-foreground italic",children:"Empty"})})},I1=_4;var h4=({value:$,onSave:J,readOnly:Z})=>{return H("div",{className:"flex items-center h-[28px] w-full",onClick:(Y)=>Y.stopPropagation(),children:H(m0,{checked:$,onCheckedChange:(Y)=>{if(!Z)J(Y)},disabled:Z,className:"cursor-pointer"})})},D1=h4;var N2=d(l(),1);var g4=({value:$,onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:N}=o0(),[Q,K]=N2.useState(!1);N2.useEffect(()=>{if(X)N(X)},[X,N]);let G=Y.find((B)=>B.id===$),z=()=>{if(!Z)K(!0)},M=(B)=>{J(B),K(!1)},U=(B)=>{if(Z)return;K(B)},W=(B)=>{return B.split(" ").map((O)=>O[0]).slice(0,2).join("").toUpperCase()};return H("div",{className:"relative w-full",onClick:(B)=>B.stopPropagation(),children:R(i,{open:!Z&&Q,onOpenChange:U,children:[H(n,{asChild:!0,children:R("div",{onClick:z,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((B)=>{if(!B)return H("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return R("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[R(L0,{className:"w-4 h-4",children:[H(R0,{src:B.image,alt:B.name,className:"object-cover"}),H(A0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),H("span",{className:"truncate max-w-[120px]",children:B.name})]})})(G),!Z&&H(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),R(o,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[R("div",{onClick:()=>M(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[H(V0,{className:"w-3 h-3"})," Clear"]}),Y.map((B)=>R("div",{onClick:()=>M(B.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[R(L0,{className:"w-5 h-5",children:[H(R0,{src:B.image,alt:B.name,className:"object-cover"}),H(A0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),H("span",{className:"text-sm font-medium text-foreground",children:B.name})]},B.id))]})]})})},x1=g4;var s=d(l(),1);var m4=({value:$=[],onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:N}=o0(),Q=s.useRef(null),[K,G]=s.useState(!1),[z,M]=s.useState(!1),[U,W]=s.useState($.length);s.useEffect(()=>{if(X)N(X)},[X,N]);let w=Y.filter((q)=>($||[]).includes(q.id)),B=(q)=>{return q.split(" ").map((C)=>C[0]).slice(0,2).join("").toUpperCase()};s.useLayoutEffect(()=>{if(K||z){W(w.length);return}if(Q.current){let q=Q.current.offsetWidth,T=document.createElement("canvas").getContext("2d");if(T){T.font="12px ui-sans-serif, system-ui, sans-serif";let D=0,x=0,m=q-28;for(let k=0;k<w.length;k++){let E=T.measureText(w[k].name).width+42;if(D+E>m&&k<w.length-1)break;if(k===w.length-1){if(D+E<=q)x++;break}D+=E,x++}W(x)}}},[w,K,z,$]);let O=(q)=>{let C=$||[],T;if(C.includes(q))T=C.filter((D)=>D!==q);else T=[...C,q];J(T)},P=(q)=>{if(q.stopPropagation(),K)return;let C=w.length-U;if(!z&&C>0)M(!0);else if(!Z)G(!0)},A=(q)=>{if(q.stopPropagation(),!Z)G(!0)},S=w.length-U,F=z&&!K||K,L=(q)=>{if(Z)return;if(!q)M(!1),G(!1)},V=(q)=>{return R("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[R(L0,{className:"w-4 h-4",children:[H(R0,{src:q.image,alt:q.name,className:"object-cover"}),H(A0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:B(q.name)})]}),H("span",{className:"truncate max-w-[100px]",children:q.name})]},q.id)};return H("div",{className:"relative w-full",onClick:(q)=>q.stopPropagation(),children:R(i,{open:!Z&&F,onOpenChange:L,children:[H(n,{asChild:!0,children:R("div",{ref:Q,onClick:P,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!Z||S>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[w.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.slice(0,U).map(V),S>0&&R("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",S]})]})}),H(o,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${z&&!K?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:z&&!K?A:void 0,children:z&&!K?R(Q2,{children:[w.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.map(V)]}):Y.map((q)=>{let C=($||[]).includes(q.id);return R("div",{onClick:()=>O(q.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[R("div",{className:"flex items-center gap-2",children:[R(L0,{className:"w-5 h-5",children:[H(R0,{src:q.image,alt:q.name,className:"object-cover"}),H(A0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:B(q.name)})]}),H("span",{className:"text-sm font-medium text-foreground",children:q.name})]}),C&&H(H2,{className:"w-4 h-4 text-primary"})]},q.id)})})]})})},j1=m4;var b4=($)=>{if(!$.config)return H("div",{children:"Unknown Field Type"});switch($.config.type){case"text":return H(I1,{...$,value:$.value,onSave:$.onSave});case"longText":return H(U5,{...$,value:$.value,onSave:$.onSave});case"select":return H(f1,{...$,value:$.value,onSave:$.onSave});case"selectMulti":return H(E1,{...$,value:$.value,onSave:$.onSave});case"rating":return H(V5,{...$,value:$.value,onSave:$.onSave});case"number":return H(F5,{...$,value:$.value,onSave:$.onSave});case"toggle":return H(D1,{...$,value:$.value,onSave:$.onSave});case"date":return H(M5,{...$,value:$.value,onSave:$.onSave});case"user":return H(x1,{...$,value:$.value,onSave:$.onSave});case"userMulti":return H(j1,{...$,value:$.value,onSave:$.onSave});default:return H("div",{children:"Unknown Field Type"})}},L6=b4;var C6=({progress:$,className:J})=>{let X=2*Math.PI*20,Y=X-Math.min(100,Math.max(0,$))/100*X;return R("svg",{viewBox:"0 0 50 50",className:a0("w-12 h-12",J),children:[H("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),H("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:X,strokeDashoffset:Y,transform:"rotate(-90 25 25)"}),H("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round($)}%`})]})};var c4=($)=>{if(isNaN($))return"00:00";let J=new Date($*1000),Z=J.getUTCHours(),X=J.getUTCMinutes().toString().padStart(2,"0"),Y=J.getUTCSeconds().toString().padStart(2,"0");if(Z)return`${Z}:${X}:${Y}`;return`${X}:${Y}`},O6=($,J,Z,X)=>{if(Z==="frames")return`${$} fr`;if(Z==="standard")return c4($/J);let Y=Math.round(J),N=J!==Y,Q=!1;if(N&&(Y===30||Y===60))Q=!0;let K=0;if(X){let B=X.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(B){let O=parseInt(B[1],10),P=parseInt(B[2],10),A=parseInt(B[3],10),S=parseInt(B[5],10);if(Q=B[4]!==":",K=(O*3600+P*60+A)*Y+S,Q){let F=O*60+P,L=J<30?2:4;K-=L*(F-Math.floor(F/10))}}}let G=$+K;if(Q){let B=J<30?2:4,O=Math.floor(G/(17982*B/2)),P=G%(17982*B/2);if(P<B)P=P+B;G+=9*B*O+B*Math.floor((P-B)/(1798*B/2))}let z=G%Y,M=Math.floor(G/Y)%60,U=Math.floor(G/(Y*60))%60,W=Math.floor(G/(Y*3600))%24,w=Q?";":":";return`${W.toString().padStart(2,"0")}:${U.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}${w}${z.toString().padStart(2,"0")}`};var T6=($,J)=>{if(!J)return 0;let Z=1/J;return $*Z+Z/2},u4=($)=>Math.max(100,3000/($||30)),S6=({dbTotalFrames:$,containerDuration:J,frameRate:Z})=>{let X=Z||30,Y=Math.round(J*X);if($<=0)return Y;let N=$/X,Q=J-N,K=u4(X)/1000;return Q>K?Y:$};
1
+ import{aa as v}from"./chunk-zhd2mkbr.js";import{Aa as D2,Ba as x2,Ca as _5,Da as h5,Ea as g5,Fa as m5,Ga as k1,Ha as P1,Ia as O1,Ja as b5,Ka as c5,La as X2,Ma as e5,Na as $1,Oa as J1,Pa as h,Qa as Y2,Ra as T1,Sa as Z1,ha as _,ia as T2,ja as S5,ka as _0,la as S2,ma as f5,na as f2,pa as y2,ra as E2,sa as E5,ta as I5,ua as D5,va as x5,wa as j5,xa as y5,ya as v5,za as I2}from"./chunk-31mjcykb.js";import{$a as m0}from"./chunk-3rcc5s99.js";import{ig as K2}from"./chunk-z0ej44ak.js";import{tg as F0}from"./chunk-mahxw48e.js";import{Bg as K5,Gg as W0,Lg as P2,vg as S0,wg as y}from"./chunk-wap08p4j.js";import{Rg as L1,Tg as R1,Ug as A1,Vg as C1,dh as g0}from"./chunk-nr89225z.js";import{$h as K1,Cj as w1,Dj as V1,Fh as n0,Gh as Y5,Hj as V0,Li as q1,Mh as T0,Mi as B1,Sj as f0,Ui as W1,Zh as H1,ak as a0,ck as e,dk as L0,ek as R0,fk as A0,gh as l,hh as Q2,ih as H,ik as I,jh as R,jj as c2,kh as Q1,ni as N1,nj as z1,oj as G1,ph as b2,pi as H2,qi as w0,ri as W5,si as z5,tj as r0,uj as M1,wj as U1,yi as G5,yj as F1}from"./chunk-b1e3tec3.js";import{Xk as d}from"./chunk-ws07a9kv.js";var r2=Symbol.for("immer-nothing"),l2=Symbol.for("immer-draftable"),b=Symbol.for("immer-state");function u($,...J){throw Error(`[Immer] minified error nr: ${$}. Full error at: https://bit.ly/3cXEKWf`)}var C0=Object.getPrototypeOf;function B0($){return!!$&&!!$[b]}function X0($){if(!$)return!1;return a2($)||Array.isArray($)||!!$[l2]||!!$.constructor?.[l2]||O0($)||p0($)}var v1=Object.prototype.constructor.toString(),p2=new WeakMap;function a2($){if(!$||typeof $!=="object")return!1;let J=Object.getPrototypeOf($);if(J===null||J===Object.prototype)return!0;let Z=Object.hasOwnProperty.call(J,"constructor")&&J.constructor;if(Z===Object)return!0;if(typeof Z!=="function")return!1;let X=p2.get(Z);if(X===void 0)X=Function.toString.call(Z),p2.set(Z,X);return X===v1}function c0($,J,Z=!0){if(l0($)===0)(Z?Reflect.ownKeys($):Object.keys($)).forEach((Y)=>{J(Y,$[Y],$)});else $.forEach((X,Y)=>J(Y,X,$))}function l0($){let J=$[b];return J?J.type_:Array.isArray($)?1:O0($)?2:p0($)?3:0}function W2($,J){return l0($)===2?$.has(J):Object.prototype.hasOwnProperty.call($,J)}function t2($,J,Z){let X=l0($);if(X===2)$.set(J,Z);else if(X===3)$.add(Z);else $[J]=Z}function _1($,J){if($===J)return $!==0||1/$===1/J;else return $!==$&&J!==J}function O0($){return $ instanceof Map}function p0($){return $ instanceof Set}function Z0($){return $.copy_||$.base_}function z2($,J){if(O0($))return new Map($);if(p0($))return new Set($);if(Array.isArray($))return Array.prototype.slice.call($);let Z=a2($);if(J===!0||J==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors($);delete X[b];let Y=Reflect.ownKeys(X);for(let N=0;N<Y.length;N++){let Q=Y[N],K=X[Q];if(K.writable===!1)K.writable=!0,K.configurable=!0;if(K.get||K.set)X[Q]={configurable:!0,writable:!0,enumerable:K.enumerable,value:$[Q]}}return Object.create(C0($),X)}else{let X=C0($);if(X!==null&&Z)return{...$};let Y=Object.create(X);return Object.assign(Y,$)}}function w2($,J=!1){if(i0($)||B0($)||!X0($))return $;if(l0($)>1)Object.defineProperties($,{set:b0,add:b0,clear:b0,delete:b0});if(Object.freeze($),J)Object.values($).forEach((Z)=>w2(Z,!0));return $}function h1(){u(2)}var b0={value:h1};function i0($){if($===null||typeof $!=="object")return!0;return Object.isFrozen($)}var g1={};function Y0($){let J=g1[$];if(!J)u(0,$);return J}var k0;function e2(){return k0}function m1($,J){return{drafts_:[],parent_:$,immer_:J,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function i2($,J){if(J)Y0("Patches"),$.patches_=[],$.inversePatches_=[],$.patchListener_=J}function G2($){M2($),$.drafts_.forEach(b1),$.drafts_=null}function M2($){if($===k0)k0=$.parent_}function n2($){return k0=m1(k0,$)}function b1($){let J=$[b];if(J.type_===0||J.type_===1)J.revoke_();else J.revoked_=!0}function o2($,J){J.unfinalizedDrafts_=J.drafts_.length;let Z=J.drafts_[0];if($!==void 0&&$!==Z){if(Z[b].modified_)G2(J),u(4);if(X0($)){if($=u0(J,$),!J.parent_)d0(J,$)}if(J.patches_)Y0("Patches").generateReplacementPatches_(Z[b].base_,$,J.patches_,J.inversePatches_)}else $=u0(J,Z,[]);if(G2(J),J.patches_)J.patchListener_(J.patches_,J.inversePatches_);return $!==r2?$:void 0}function u0($,J,Z){if(i0(J))return J;let X=$.immer_.shouldUseStrictIteration(),Y=J[b];if(!Y)return c0(J,(N,Q)=>s2($,Y,J,N,Q,Z),X),J;if(Y.scope_!==$)return J;if(!Y.modified_)return d0($,Y.base_,!0),Y.base_;if(!Y.finalized_){Y.finalized_=!0,Y.scope_.unfinalizedDrafts_--;let N=Y.copy_,Q=N,K=!1;if(Y.type_===3)Q=new Set(N),N.clear(),K=!0;if(c0(Q,(G,z)=>s2($,Y,N,G,z,Z,K),X),d0($,N,!1),Z&&$.patches_)Y0("Patches").generatePatches_(Y,Z,$.patches_,$.inversePatches_)}return Y.copy_}function s2($,J,Z,X,Y,N,Q){if(Y==null)return;if(typeof Y!=="object"&&!Q)return;let K=i0(Y);if(K&&!Q)return;if(B0(Y)){let G=N&&J&&J.type_!==3&&!W2(J.assigned_,X)?N.concat(X):void 0,z=u0($,Y,G);if(t2(Z,X,z),B0(z))$.canAutoFreeze_=!1;else return}else if(Q)Z.add(Y);if(X0(Y)&&!K){if(!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1)return;if(J&&J.base_&&J.base_[X]===Y&&K)return;if(u0($,Y),(!J||!J.scope_.parent_)&&typeof X!=="symbol"&&(O0(Z)?Z.has(X):Object.prototype.propertyIsEnumerable.call(Z,X)))d0($,Y)}}function d0($,J,Z=!1){if(!$.parent_&&$.immer_.autoFreeze_&&$.canAutoFreeze_)w2(J,Z)}function c1($,J){let Z=Array.isArray($),X={type_:Z?1:0,scope_:J?J.scope_:e2(),modified_:!1,finalized_:!1,assigned_:{},parent_:J,base_:$,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,N=V2;if(Z)Y=[X],N=P0;let{revoke:Q,proxy:K}=Proxy.revocable(Y,N);return X.draft_=K,X.revoke_=Q,K}var V2={get($,J){if(J===b)return $;let Z=Z0($);if(!W2(Z,J))return u1($,Z,J);let X=Z[J];if($.finalized_||!X0(X))return X;if(X===q2($.base_,J))return B2($),$.copy_[J]=F2(X,$);return X},has($,J){return J in Z0($)},ownKeys($){return Reflect.ownKeys(Z0($))},set($,J,Z){let X=$5(Z0($),J);if(X?.set)return X.set.call($.draft_,Z),!0;if(!$.modified_){let Y=q2(Z0($),J),N=Y?.[b];if(N&&N.base_===Z)return $.copy_[J]=Z,$.assigned_[J]=!1,!0;if(_1(Z,Y)&&(Z!==void 0||W2($.base_,J)))return!0;B2($),U2($)}if($.copy_[J]===Z&&(Z!==void 0||(J in $.copy_))||Number.isNaN(Z)&&Number.isNaN($.copy_[J]))return!0;return $.copy_[J]=Z,$.assigned_[J]=!0,!0},deleteProperty($,J){if(q2($.base_,J)!==void 0||J in $.base_)$.assigned_[J]=!1,B2($),U2($);else delete $.assigned_[J];if($.copy_)delete $.copy_[J];return!0},getOwnPropertyDescriptor($,J){let Z=Z0($),X=Reflect.getOwnPropertyDescriptor(Z,J);if(!X)return X;return{writable:!0,configurable:$.type_!==1||J!=="length",enumerable:X.enumerable,value:Z[J]}},defineProperty(){u(11)},getPrototypeOf($){return C0($.base_)},setPrototypeOf(){u(12)}},P0={};c0(V2,($,J)=>{P0[$]=function(){return arguments[0]=arguments[0][0],J.apply(this,arguments)}});P0.deleteProperty=function($,J){return P0.set.call(this,$,J,void 0)};P0.set=function($,J,Z){return V2.set.call(this,$[0],J,Z,$[0])};function q2($,J){let Z=$[b];return(Z?Z0(Z):$)[J]}function u1($,J,Z){let X=$5(J,Z);return X?"value"in X?X.value:X.get?.call($.draft_):void 0}function $5($,J){if(!(J in $))return;let Z=C0($);while(Z){let X=Object.getOwnPropertyDescriptor(Z,J);if(X)return X;Z=C0(Z)}return}function U2($){if(!$.modified_){if($.modified_=!0,$.parent_)U2($.parent_)}}function B2($){if(!$.copy_)$.copy_=z2($.base_,$.scope_.immer_.useStrictShallowCopy_)}var d1=class{constructor($){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(J,Z,X)=>{if(typeof J==="function"&&typeof Z!=="function"){let N=Z;Z=J;let Q=this;return function(G=N,...z){return Q.produce(G,(M)=>Z.call(this,M,...z))}}if(typeof Z!=="function")u(6);if(X!==void 0&&typeof X!=="function")u(7);let Y;if(X0(J)){let N=n2(this),Q=F2(J,void 0),K=!0;try{Y=Z(Q),K=!1}finally{if(K)G2(N);else M2(N)}return i2(N,X),o2(Y,N)}else if(!J||typeof J!=="object"){if(Y=Z(J),Y===void 0)Y=J;if(Y===r2)Y=void 0;if(this.autoFreeze_)w2(Y,!0);if(X){let N=[],Q=[];Y0("Patches").generateReplacementPatches_(J,Y,N,Q),X(N,Q)}return Y}else u(1,J)},this.produceWithPatches=(J,Z)=>{if(typeof J==="function")return(Q,...K)=>this.produceWithPatches(Q,(G)=>J(G,...K));let X,Y;return[this.produce(J,Z,(Q,K)=>{X=Q,Y=K}),X,Y]},typeof $?.autoFreeze==="boolean")this.setAutoFreeze($.autoFreeze);if(typeof $?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy($.useStrictShallowCopy);if(typeof $?.useStrictIteration==="boolean")this.setUseStrictIteration($.useStrictIteration)}createDraft($){if(!X0($))u(8);if(B0($))$=l1($);let J=n2(this),Z=F2($,void 0);return Z[b].isManual_=!0,M2(J),Z}finishDraft($,J){let Z=$&&$[b];if(!Z||!Z.isManual_)u(9);let{scope_:X}=Z;return i2(X,J),o2(void 0,X)}setAutoFreeze($){this.autoFreeze_=$}setUseStrictShallowCopy($){this.useStrictShallowCopy_=$}setUseStrictIteration($){this.useStrictIteration_=$}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches($,J){let Z;for(Z=J.length-1;Z>=0;Z--){let Y=J[Z];if(Y.path.length===0&&Y.op==="replace"){$=Y.value;break}}if(Z>-1)J=J.slice(Z+1);let X=Y0("Patches").applyPatches_;if(B0($))return X($,J);return this.produce($,(Y)=>X(Y,J))}};function F2($,J){let Z=O0($)?Y0("MapSet").proxyMap_($,J):p0($)?Y0("MapSet").proxySet_($,J):c1($,J);return(J?J.scope_:e2()).drafts_.push(Z),Z}function l1($){if(!B0($))u(10,$);return J5($)}function J5($){if(!X0($)||i0($))return $;let J=$[b],Z,X=!0;if(J){if(!J.modified_)return J.base_;J.finalized_=!0,Z=z2($,J.scope_.immer_.useStrictShallowCopy_),X=J.scope_.immer_.shouldUseStrictIteration()}else Z=z2($,!0);if(c0(Z,(Y,N)=>{t2(Z,Y,J5(N))},X),J)J.finalized_=!1;return Z}var p1=new d1,Z5=p1.produce;var i1=($)=>(J,Z,X)=>{return X.setState=(Y,N,...Q)=>{let K=typeof Y==="function"?Z5(Y):Y;return J(K,N,...Q)},$(X.setState,Z,X)},X5=i1;var o0=n0()(Y5(X5(($,J)=>({members:[],loading:!1,fetchMembers:async(Z,X,Y)=>{if(!Y&&J().loadedTeamId===Z&&J().loadedWithAgents===X)return;$({loading:!0});try{let N=await T0.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{includeAgents:X?"true":"false"}});if(!N.ok)throw Error("failed to fetch members");let Q=await N.json();$({members:Q||[],loadedTeamId:Z,loadedWithAgents:X,loading:!1})}catch{$({loading:!1})}}}))));var Q5=n0(($)=>({fields:[],loadedProjectId:null,setFields:(J,Z)=>$({fields:J,loadedProjectId:Z}),updateFields:(J)=>$({fields:J})}));function L2($,J,Z){let X=y($,Z?.in);if(isNaN(J))return S0(Z?.in||$,NaN);if(!J)return X;let Y=X.getDate(),N=S0(Z?.in||$,X.getTime());N.setMonth(X.getMonth()+J+1,0);let Q=N.getDate();if(Y>=Q)return N;else return X.setFullYear(N.getFullYear(),N.getMonth(),Y),X}function H5($,J){let Z=y($,J?.in),X=Z.getMonth();return Z.setFullYear(Z.getFullYear(),X+1,0),Z.setHours(23,59,59,999),Z}function N5($,J){let[Z,X]=K5($,J.start,J.end);return{start:Z,end:X}}function q5($,J){let{start:Z,end:X}=N5(J?.in,$),Y=+Z>+X,N=Y?+Z:+X,Q=Y?X:Z;Q.setHours(0,0,0,0);let K=J?.step??1;if(!K)return[];if(K<0)K=-K,Y=!Y;let G=[];while(+Q<=N)G.push(S0(Z,Q)),Q.setDate(Q.getDate()+K),Q.setHours(0,0,0,0);return Y?G.reverse():G}function s0($,J){return y($,J?.in).getDate()}function B5($,J){return y($,J?.in).getDay()}function R2($,J){return y($,J?.in).getHours()}function A2($,J){return y($,J?.in).getMinutes()}function C2($,J){return y($,J?.in).getMonth()}function k2($,J){return y($,J?.in).getFullYear()}var r=d(l(),1);var n1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.date,[N,Q]=r.useState(!1),K=r.useRef(null),G=$?new Date($):new Date,z=W0(G)?G:new Date,[M,U]=r.useState(z);r.useEffect(()=>{if(N&&$){let q=new Date($);if(W0(q))U(q)}},[N,$]),r.useEffect(()=>{let q=(C)=>{if(K.current&&!K.current.contains(C.target)){if(N)Q(!1)}};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[N]);let W=()=>{if(!X)Q(!0)},w=(q)=>{if(!q)return"";let C=new Date(q);if(!W0(C))return"Invalid Date";let T="PPP";if(Y?.displayFormat==="usa")T="MM/dd/yyyy";else if(Y?.displayFormat==="euro")T="dd/MM/yyyy";else if(Y?.displayFormat==="iso")T="yyyy-MM-dd";if(Y?.includeTime)if(Y?.timeFormat==="twenty_four_hour")T+=" HH:mm";else T+=" p";let D=P2(C,T);if(Y?.displayTimezone)D+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return D},B=new Date(M.getFullYear(),M.getMonth(),1),O=H5(M),P=q5({start:B,end:O}),A=B5(B),S=(q)=>{let C=new Date(q);if(Y?.includeTime)C.setHours(R2(z)),C.setMinutes(A2(z));let T=C.toISOString();if(Z(T),!Y?.includeTime)Q(!1)},F=(q,C)=>{let T=$?new Date($):new Date;if(!W0(T))T.setTime(new Date().getTime());if(q==="hour")T.setHours(C);if(q==="minute")T.setMinutes(C);let D=T.toISOString();Z(D)},L=Array.from({length:24},(q,C)=>C),V=Array.from({length:12},(q,C)=>C*5);if(N)return R("div",{className:"relative w-full",ref:K,children:[H("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:$?w($):H("span",{className:"text-muted-foreground",children:"Select date..."})}),R("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[R("div",{className:"p-4 w-64",children:[R("div",{className:"flex justify-between items-center mb-4",children:[H("button",{onClick:()=>U(L2(M,-1)),className:"p-1 hover:bg-accent rounded",children:H(W5,{className:"w-4 h-4"})}),H("span",{className:"font-semibold text-sm",children:P2(M,"MMMM yyyy")}),H("button",{onClick:()=>U(L2(M,1)),className:"p-1 hover:bg-accent rounded",children:H(z5,{className:"w-4 h-4"})})]}),H("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((q)=>H("div",{children:q},q))}),R("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:A}).map((q,C)=>H("div",{},`empty-${C}`)),P.map((q)=>{let C=$?new Date($):null,T=C&&W0(C)&&s0(C)===s0(q)&&C2(C)===C2(q)&&k2(C)===k2(q);return H("button",{onClick:()=>S(q),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${T?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:s0(q)},q.toString())})]})]}),Y?.includeTime&&R("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[R("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[H(G5,{className:"w-3 h-3"})," Time"]}),R("div",{className:"flex flex-1 h-64",children:[H("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:L.map((q)=>H("div",{onClick:()=>F("hour",q),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R2(z)===q?"bg-primary/10 font-medium text-primary":""}`,children:q.toString().padStart(2,"0")},q))}),H("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:V.map((q)=>H("div",{onClick:()=>F("minute",q),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${A2(z)===q?"bg-primary/10 font-medium text-primary":""}`,children:q.toString().padStart(2,"0")},q))})]})]})]})]});return H("div",{onClick:W,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$?w($):H("span",{className:"text-muted-foreground italic",children:"Empty"})})},M5=n1;var p=d(l(),1);var o1=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=p.useState(!1),[N,Q]=p.useState($||""),K=p.useRef(null),G=p.useRef(null),[z,M]=p.useState(!1);p.useEffect(()=>{Q($||"")},[$]),p.useEffect(()=>{if(X&&K.current)K.current.focus(),M(!1)},[X]),p.useEffect(()=>{let B=(O)=>{if(z&&G.current&&!G.current.contains(O.target))M(!1)};if(z)document.addEventListener("mousedown",B);return()=>{document.removeEventListener("mousedown",B)}},[z]);let U=()=>{Y(!1),J(N)},W=(B)=>{B.stopPropagation(),M(!0)},w=(B)=>{if(B.stopPropagation(),!Z)Y(!0)};if(X)return H("textarea",{ref:K,value:N,onChange:(B)=>Q(B.target.value),onBlur:U,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return R("div",{ref:G,className:"relative w-full text-sm",children:[H("div",{onClick:W,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 line-clamp-2 max-h-[3rem] overflow-hidden ${!Z?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:$?$:H("span",{className:"text-muted-foreground italic",children:"Empty"})}),z&&H("div",{onClick:w,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!Z?"cursor-text":""}`,children:$?$:H("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},U5=o1;var a=d(l(),1);var s1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.number,[N,Q]=a.useState(!1),[K,G]=a.useState(""),z=a.useRef(null);a.useEffect(()=>{G($!==void 0&&$!==null?$.toString():"")},[$]),a.useEffect(()=>{if(N&&z.current)z.current.focus()},[N]);let M=()=>{if(!X)Q(!0)},U=()=>{if(Q(!1),K==="")Z(void 0);else{let B=parseFloat(K);Z(isNaN(B)?void 0:B)}},W=(B)=>{if(B.key==="Enter")B.stopPropagation(),z.current?.blur()},w=(B)=>{if(B===void 0||B===null||isNaN(B))return"";return B.toFixed(Y?.scale)};if(N)return H("input",{ref:z,type:"number",step:1/Math.pow(10,Y?.scale||0),value:K,onChange:(B)=>G(B.target.value),onBlur:U,onKeyDown:W,onDoubleClick:(B)=>B.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return H("div",{onClick:M,onDoubleClick:(B)=>B.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$!==void 0&&$!==null?w($):H("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},F5=s1;var w5=d(l(),1);var r1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.rating,N=Math.max(2,Math.min(6,Y?.maxValue||5)),[Q,K]=w5.useState(null),G=(M,U)=>{if(M.stopPropagation(),X)return;let W;if($===U)W=0;else W=U;Z(W)},z=Array.from({length:N},(M,U)=>U+1);return H("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!X&&K(null),onDoubleClick:(M)=>M.stopPropagation(),children:z.map((M)=>{let U=Q!==null?M<=Q:M<=($||0);return H("button",{onClick:(W)=>G(W,M),onMouseEnter:()=>!X&&K(M),className:`focus:outline-none transition-transform ${!X?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:X,children:H(r0,{className:`w-5 h-5 transition-colors ${U?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},M)})})},V5=r1;var S1=d(l(),1);function i({...$}){return H(f0.Root,{"data-slot":"popover",...$})}function n({...$}){return H(f0.Trigger,{"data-slot":"popover-trigger",...$})}function o({className:$,align:J="center",sideOffset:Z=4,...X}){return H(f0.Portal,{children:H(f0.Content,{"data-slot":"popover-content",align:J,sideOffset:Z,className:a0("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",$),...X})})}var Q0;(function($){$.Base32IncorrectEncoding="B32_ENC_INVALID",$.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",$.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",$.EncodeTimeNegative="ENC_TIME_NEG",$.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",$.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",$.PRNGDetectFailure="PRNG_DETECT",$.ULIDInvalid="ULID_INVALID",$.Unexpected="UNEXPECTED",$.UUIDInvalid="UUID_INVALID"})(Q0||(Q0={}));class z0 extends Error{constructor($,J){super(`${J} (${$})`);this.name="ULIDError",this.code=$}}function a1($){let J=Math.floor($()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(J)}function t1($){let J=e1(),Z=J&&(J.crypto||J.msCrypto)||null;if(typeof Z?.getRandomValues==="function")return()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]/256};else if(typeof Z?.randomBytes==="function")return()=>Z.randomBytes(1).readUInt8()/256;throw new z0(Q0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function e1(){if(Z4())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function $4($,J){let Z="";for(;$>0;$--)Z=a1(J)+Z;return Z}function J4($,J=10){if(isNaN($))throw new z0(Q0.EncodeTimeValueMalformed,`Time must be a number: ${$}`);else if($>281474976710655)throw new z0(Q0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${$}`);else if($<0)throw new z0(Q0.EncodeTimeNegative,`Time must be positive: ${$}`);else if(Number.isInteger($)===!1)throw new z0(Q0.EncodeTimeValueMalformed,`Time must be an integer: ${$}`);let Z,X="";for(let Y=J;Y>0;Y--)Z=$%32,X="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(Z)+X,$=($-Z)/32;return X}function Z4(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function L5($,J){let Z=J||t1(),X=!$||isNaN($)?Date.now():$;return J4(X,10)+$4(16,Z)}var h0=d(l(),1);var{create:X4,defineProperty:u5,defineProperties:Y4,getOwnPropertyDescriptor:Q4,getOwnPropertyDescriptors:H4,getOwnPropertySymbols:Z2}=Object,d5=Object.prototype.hasOwnProperty,l5=Object.prototype.propertyIsEnumerable,K4=($,J)=>(J=Symbol[$])?J:Symbol.for("Symbol."+$),y0=($)=>{throw TypeError($)},j2=($,J,Z)=>(J in $)?u5($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,R5=($,J)=>{for(var Z in J||(J={}))if(d5.call(J,Z))j2($,Z,J[Z]);if(Z2){for(var Z of Z2(J))if(l5.call(J,Z))j2($,Z,J[Z])}return $},A5=($,J)=>Y4($,H4(J)),N4=($,J)=>{var Z={};for(var X in $)if(d5.call($,X)&&J.indexOf(X)<0)Z[X]=$[X];if($!=null&&Z2){for(var X of Z2($))if(J.indexOf(X)<0&&l5.call($,X))Z[X]=$[X]}return Z},q4=($)=>{var J;return[,,,X4((J=void 0)!=null?J:null)]},p5=["class","method","getter","setter","accessor","field","value","get","set"],I0=($)=>$!==void 0&&typeof $!=="function"?y0("Function expected"):$,B4=($,J,Z,X,Y)=>({kind:p5[$],name:J,metadata:X,addInitializer:(N)=>Z._?y0("Already initialized"):Y.push(I0(N||null))}),W4=($,J)=>j2(J,K4("metadata"),$[3]),t0=($,J,Z,X)=>{for(var Y=0,N=$[J>>1],Q=N&&N.length;Y<Q;Y++)J&1?N[Y].call(Z):X=N[Y].call(Z,X);return X},i5=($,J,Z,X,Y,N)=>{var Q,K,G,z,M,U=J&7,W=!1,w=!1,B=$.length+1,O=p5[U+5],P=$[B-1]=[],A=$[B]||($[B]=[]),S=(Y=Y.prototype,Q4({get[Z](){return D0(this,N)},set[Z](L){return H0(this,N,L)}},Z));for(var F=X.length-1;F>=0;F--)if(z=B4(U,Z,G={},$[3],A),z.static=W,z.private=w,M=z.access={has:(L)=>(Z in L)},M.get=(L)=>L[Z],M.set=(L,V)=>L[Z]=V,K=(0,X[F])({get:S.get,set:S.set},z),G._=1,K===void 0)I0(K)&&(S[O]=K);else if(typeof K!=="object"||K===null)y0("Object expected");else I0(Q=K.get)&&(S.get=Q),I0(Q=K.set)&&(S.set=Q),I0(Q=K.init)&&P.unshift(Q);return S&&u5(Y,Z,S),Y},n5=($,J,Z)=>J.has($)||y0("Cannot "+Z),D0=($,J,Z)=>(n5($,J,"read from private field"),J.get($)),E0=($,J,Z)=>J.has($)?y0("Cannot add the same private member more than once"):J instanceof WeakSet?J.add($):J.set($,Z),H0=($,J,Z,X)=>(n5($,J,"write to private field"),J.set($,Z),Z);function K0($){return $ instanceof g2||$ instanceof r5}var e0=10,z4=class extends y2{constructor($){super($);let J=S5(()=>{let{dragOperation:X}=$;if(!x2(X.activatorEvent))return;if(!K0(X.source))return;if(X.status.initialized){let Y=$.registry.plugins.get(m5);if(Y)return Y.disable(),()=>Y.enable()}}),Z=$.monitor.addEventListener("dragmove",(X,Y)=>{queueMicrotask(()=>{if(this.disabled||X.defaultPrevented||!X.nativeEvent)return;let{dragOperation:N}=Y;if(!x2(X.nativeEvent))return;if(!K0(N.source))return;if(!N.shape)return;let{actions:Q,collisionObserver:K,registry:G}=Y,{by:z}=X;if(!z)return;let M=G4(z),{source:U,target:W}=N,{center:w}=N.shape.current,B=[],O=[];_(()=>{for(let V of G.droppables){let{id:q}=V;if(!V.accepts(U)||q===(W==null?void 0:W.id)&&K0(V)||!V.element)continue;let C=V.shape,T=new D2(V.element,{getBoundingClientRect:(D)=>I5(D,void 0,0.2)});if(!T.height||!T.width)continue;if(M=="down"&&w.y+e0<T.center.y||M=="up"&&w.y-e0>T.center.y||M=="left"&&w.x-e0>T.center.x||M=="right"&&w.x+e0<T.center.x)B.push(V),V.shape=T,O.push(()=>V.shape=C)}}),X.preventDefault(),K.disable();let P=K.computeCollisions(B,h5);_(()=>O.forEach((V)=>V()));let[A]=P;if(!A)return;let{id:S}=A,{index:F,group:L}=U.sortable;Q.setDropTarget(S).then(()=>{let{source:V,target:q,shape:C}=N;if(!V||!K0(V)||!C)return;let{index:T,group:D,target:x}=V.sortable,g=F!==T||L!==D,m=g?x:q==null?void 0:q.element;if(!m)return;y5(m);let k=new D2(m);if(!k)return;let f=f2.delta(k,f2.from(C.current.boundingRectangle),V.alignment);if(Q.move({by:f}),g)Q.setDropTarget(V.id).then(()=>K.enable());else K.enable()})})});this.destroy=()=>{Z(),J()}}};function G4($){let{x:J,y:Z}=$;if(J>0)return"right";else if(J<0)return"left";else if(Z>0)return"down";else if(Z<0)return"up"}var{defineProperty:M4,defineProperties:U4,getOwnPropertyDescriptors:F4,getOwnPropertySymbols:C5}=Object,w4=Object.prototype.hasOwnProperty,V4=Object.prototype.propertyIsEnumerable,k5=($,J,Z)=>(J in $)?M4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,G0=($,J)=>{for(var Z in J||(J={}))if(w4.call(J,Z))k5($,Z,J[Z]);if(C5){for(var Z of C5(J))if(V4.call(J,Z))k5($,Z,J[Z])}return $},M0=($,J)=>U4($,F4(J));function L4($,J,Z){if(J===Z)return $;let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}function O2($){return"initialIndex"in $&&typeof $.initialIndex==="number"&&"index"in $&&typeof $.index==="number"}function R4($,J,Z){var X,Y,N;let{source:Q,target:K,canceled:G}=J.operation;if(!Q||!K||G){if("preventDefault"in J)J.preventDefault();return $}let z=(L,V)=>L===V||typeof L==="object"&&("id"in L)&&L.id===V;if(Array.isArray($)){let L=$.findIndex((q)=>z(q,Q.id)),V=$.findIndex((q)=>z(q,K.id));if(L===-1||V===-1){if(O2(Q)){let{initialIndex:q,index:C}=Q;if(q===C||q<0||q>=$.length){if("preventDefault"in J)J.preventDefault();return $}return Z($,q,C)}return $}if(!G&&"index"in Q&&typeof Q.index==="number"){let q=Q.index;if(q!==L)return Z($,L,q)}return Z($,L,V)}let M=Object.entries($),U=-1,W,w=-1,B;for(let[L,V]of M){if(U===-1){if(U=V.findIndex((q)=>z(q,Q.id)),U!==-1)W=L}if(w===-1){if(w=V.findIndex((q)=>z(q,K.id)),w!==-1)B=L}if(U!==-1&&w!==-1)break}if(U===-1&&O2(Q)){let{initialGroup:L,initialIndex:V,group:q,index:C}=Q;if(L==null||q==null||!(L in $)||!(q in $)){if("preventDefault"in J)J.preventDefault();return $}if(L===q&&V===C){if("preventDefault"in J)J.preventDefault();return $}if(L===q)return M0(G0({},$),{[L]:Z($[L],V,C)});let T=$[L][V];return M0(G0({},$),{[L]:[...$[L].slice(0,V),...$[L].slice(V+1)],[q]:[...$[q].slice(0,C),T,...$[q].slice(C)]})}if(!Q.manager)return $;let{dragOperation:O}=Q.manager,P=(Y=(X=O.shape)==null?void 0:X.current.center)!=null?Y:O.position.current;if(B==null){if(K.id in $){let L=K.shape&&P.y>K.shape.center.y?$[K.id].length:0;B=K.id,w=L}}if(W==null||B==null||W===B&&U===w){if(W!=null&&W===B&&U===w&&O2(Q)){let L=Q.group!=null&&Q.group!==W,V=Q.index!==U;if(L||V){let q=(N=Q.group)!=null?N:W;if(q in $){if(W===q)return M0(G0({},$),{[W]:Z($[W],U,Q.index)});let C=$[W][U];return M0(G0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[q]:[...$[q].slice(0,Q.index),C,...$[q].slice(Q.index)]})}}}if("preventDefault"in J)J.preventDefault();return $}if(W===B)return M0(G0({},$),{[W]:Z($[W],U,w)});let S=K.shape&&Math.round(P.y)>Math.round(K.shape.center.y)?1:0,F=$[W][U];return M0(G0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[B]:[...$[B].slice(0,w+S),F,...$[B].slice(w+S)]})}function A4($,J){return R4($,J,L4)}var P5="__default__",C4=class extends y2{constructor($){super($);let J=()=>{let X=new Map;for(let Y of $.registry.droppables)if(Y instanceof g2){let{sortable:N}=Y,{group:Q}=N,K=X.get(Q);if(!K)K=new Set,X.set(Q,K);K.add(N)}for(let[Y,N]of X)X.set(Y,new Set($2(N)));return X},Z=[$.monitor.addEventListener("dragover",(X,Y)=>{if(this.disabled)return;let{dragOperation:N}=Y,{source:Q,target:K}=N;if(!K0(Q)||!K0(K))return;if(Q.sortable===K.sortable)return;let G=J(),z=Q.sortable.group===K.sortable.group,M=G.get(Q.sortable.group),U=z?M:G.get(K.sortable.group);if(!M||!U)return;queueMicrotask(()=>{if(X.defaultPrevented)return;Y.renderer.rendering.then(()=>{var W,w,B;let O=J();for(let[x,g]of G.entries()){let m=Array.from(g).entries();for(let[k,f]of m)if(f.index!==k||f.group!==x||!((W=O.get(x))==null?void 0:W.has(f)))return}let P=Q.sortable.element,A=K.sortable.element;if(!A||!P)return;if(!z&&K.id===Q.sortable.group)return;let S=$2(M),F=z?S:$2(U),L=(w=Q.sortable.group)!=null?w:P5,V=(B=K.sortable.group)!=null?B:P5,q={[L]:S,[V]:F},C=A4(q,X);if(q===C)return;let T=C[V].indexOf(Q.sortable),D=C[V].indexOf(K.sortable);Y.collisionObserver.disable(),O5(P,T,A,D),_(()=>{for(let[x,g]of C[L].entries())g.index=x;if(!z)for(let[x,g]of C[V].entries())g.group=K.sortable.group,g.index=x}),Y.actions.setDropTarget(Q.id).then(()=>Y.collisionObserver.enable())})})}),$.monitor.addEventListener("dragend",(X,Y)=>{if(!X.canceled)return;let{dragOperation:N}=Y,{source:Q}=N;if(!K0(Q))return;if(Q.sortable.initialIndex===Q.sortable.index&&Q.sortable.initialGroup===Q.sortable.group)return;queueMicrotask(()=>{let K=J(),G=K.get(Q.sortable.initialGroup);if(!G)return;Y.renderer.rendering.then(()=>{for(let[w,B]of K.entries()){let O=Array.from(B).entries();for(let[P,A]of O)if(A.index!==P||A.group!==w)return}let z=$2(G),M=Q.sortable.element,U=z[Q.sortable.initialIndex],W=U==null?void 0:U.element;if(!U||!W||!M)return;O5(M,U.index,W,Q.index),_(()=>{for(let[w,B]of K.entries()){let O=Array.from(B).values();for(let P of O)P.index=P.initialIndex,P.group=P.initialGroup}})})})})];this.destroy=()=>{for(let X of Z)X()}}};function O5($,J,Z,X){let Y=X<J?"afterend":"beforebegin";Z.insertAdjacentElement(Y,$)}function k4($,J){return $.index-J.index}function $2($){return Array.from($).sort(k4)}var T5=[z4,C4],v2={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},J2=new f5,o5,s5,t,_2,x0,j0,h2,U0;s5=[S2],o5=[S2];var v0=class{constructor($,J){E0(this,_2,t0(t,8,this)),t0(t,11,this),E0(this,x0),E0(this,j0),E0(this,h2,t0(t,12,this)),t0(t,15,this),E0(this,U0),this.register=()=>{return _(()=>{var W,w;(W=this.manager)==null||W.registry.register(this.droppable),(w=this.manager)==null||w.registry.register(this.draggable)}),()=>this.unregister()},this.unregister=()=>{_(()=>{var W,w;(W=this.manager)==null||W.registry.unregister(this.droppable),(w=this.manager)==null||w.registry.unregister(this.draggable)})},this.destroy=()=>{_(()=>{this.droppable.destroy(),this.draggable.destroy()})};var Z=$,{effects:X=()=>[],group:Y,index:N,sensors:Q,type:K,transition:G=v2,plugins:z}=Z,M=N4(Z,["effects","group","index","sensors","type","transition","plugins"]);let U=E2(z,T5);this.droppable=new g2(M,J,this),this.draggable=new r5(A5(R5({},M),{plugins:U,effects:()=>[()=>{var W,w,B;let O=(W=this.manager)==null?void 0:W.dragOperation.status;if((O==null?void 0:O.initializing)&&this.id===((B=(w=this.manager)==null?void 0:w.dragOperation.source)==null?void 0:B.id))J2.clear(this.manager);if(O==null?void 0:O.dragging)J2.set(this.manager,this.id,T2(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:W,group:w,manager:B}=this,O=D0(this,j0),P=D0(this,x0);if(W!==O||w!==P)H0(this,j0,W),H0(this,x0,w),this.animate()},()=>{var W,w;let{target:B}=this,{isDragSource:O}=this.draggable;if(((w=(W=this.draggable.pluginConfig(g5))==null?void 0:W.feedback)!=null?w:"default")==="move"&&O)this.droppable.disabled=!B},...X()],type:K,sensors:Q}),J,this),H0(this,U0,M.element),this.manager=J,this.index=N,H0(this,j0,N),this.group=Y,H0(this,x0,Y),this.type=K,this.transition=G}get initialIndex(){var $,J;return(J=($=J2.get(this.manager,this.id))==null?void 0:$.initialIndex)!=null?J:this.index}get initialGroup(){var $,J;return(J=($=J2.get(this.manager,this.id))==null?void 0:$.initialGroup)!=null?J:this.group}animate(){T2(()=>{let{manager:$,transition:J}=this,{shape:Z}=this.droppable;if(!$)return;let{idle:X}=$.dragOperation.status;if(!Z||!J||X&&!J.idle)return;$.renderer.rendering.then(()=>{let{element:Y}=this;if(!Y)return;for(let M of Y.getAnimations())if("transitionProperty"in M&&(M.transitionProperty==="transform"||M.transitionProperty==="translate"||M.transitionProperty==="scale"))M.cancel();let N=this.refreshShape();if(!N)return;let Q={x:Z.boundingRectangle.left-N.boundingRectangle.left,y:Z.boundingRectangle.top-N.boundingRectangle.top},{translate:K}=j5(Y),G=I2(Y,K,!1),z=I2(Y,K);if(Q.x||Q.y){let M=D5(E5(Y))?A5(R5({},J),{duration:0}):J;v5({element:Y,keyframes:{translate:[`${G.x+Q.x}px ${G.y+Q.y}px ${G.z}`,`${z.x}px ${z.y}px ${z.z}`]},options:M}).then(()=>{if(!$.dragOperation.status.dragging)this.droppable.shape=void 0})}})})}get manager(){return this.draggable.manager}set manager($){_(()=>{this.draggable.manager=$,this.droppable.manager=$})}set element($){_(()=>{let J=D0(this,U0),Z=this.droppable.element,X=this.draggable.element;if(!Z||Z===J)this.droppable.element=$;if(!X||X===J)this.draggable.element=$;H0(this,U0,$)})}get element(){var $,J;let Z=D0(this,U0);if(!Z)return;return(J=($=x5.get(Z))!=null?$:Z)!=null?J:this.droppable.element}set target($){this.droppable.element=$}get target(){return this.droppable.element}set source($){this.draggable.element=$}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set plugins($){this.draggable.plugins=E2($,T5)}set disabled($){_(()=>{this.droppable.disabled=$,this.draggable.disabled=$})}set data($){_(()=>{this.droppable.data=$,this.draggable.data=$})}set handle($){this.draggable.handle=$}set id($){this.droppable.id=$,this.draggable.id=$}get id(){return this.droppable.id}set sensors($){this.draggable.sensors=$}set modifiers($){this.draggable.modifiers=$}set collisionPriority($){this.droppable.collisionPriority=$}set collisionDetector($){this.droppable.collisionDetector=$!=null?$:_5}set alignment($){this.draggable.alignment=$}get alignment(){return this.draggable.alignment}set type($){_(()=>{this.droppable.type=$,this.draggable.type=$})}get type(){return this.draggable.type}set accept($){this.droppable.accept=$}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts($){return this.droppable.accepts($)}};t=q4();_2=new WeakMap;x0=new WeakMap;j0=new WeakMap;h2=new WeakMap;U0=new WeakMap;i5(t,4,"index",s5,v0,_2);i5(t,4,"group",o5,v0,h2);W4(t,v0);var r5=class extends b5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},g2=class extends c5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get group(){return this.sortable.group}};var{defineProperty:P4,defineProperties:O4,getOwnPropertyDescriptors:T4,getOwnPropertySymbols:a5}=Object,S4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,t5=($,J,Z)=>(J in $)?P4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,m2=($,J)=>{for(var Z in J||(J={}))if(S4.call(J,Z))t5($,Z,J[Z]);if(a5){for(var Z of a5(J))if(f4.call(J,Z))t5($,Z,J[Z])}return $},E4=($,J)=>O4($,T4(J));function X1($){let{accept:J,collisionDetector:Z,collisionPriority:X,id:Y,data:N,element:Q,handle:K,index:G,group:z,disabled:M,modifiers:U,sensors:W,target:w,type:B,plugins:O}=$,P=m2(m2({},v2),$.transition),A=Z1((F)=>{return new v0(E4(m2({},$),{transition:P,register:!1,handle:X2(K),element:X2(Q),target:X2(w)}),F)}),S=$1(A,I4);return h(Y,()=>A.id=Y),e5(()=>{_(()=>{A.group=z,A.index=G})},[A,z,G]),h(B,()=>A.type=B),h(J,()=>A.accept=J,void 0,_0),h(N,()=>N&&(A.data=N)),h(G,()=>{var F;if(((F=A.manager)==null?void 0:F.dragOperation.status.idle)&&(P==null?void 0:P.idle))A.refreshShape()},J1),Y2(K,(F)=>A.handle=F),Y2(Q,(F)=>A.element=F),Y2(w,(F)=>A.target=F),h(M,()=>A.disabled=M===!0),h(W,()=>A.sensors=W),h(Z,()=>A.collisionDetector=Z),h(X,()=>A.collisionPriority=X),h(O,()=>A.plugins=O,void 0,_0),h(P,()=>A.transition=P,void 0,_0),h(U,()=>A.modifiers=U,void 0,_0),h($.alignment,()=>A.alignment=$.alignment),{sortable:S,get isDragging(){return S.isDragging},get isDropping(){return S.isDropping},get isDragSource(){return S.isDragSource},get isDropTarget(){return S.isDropTarget},handleRef:h0.useCallback((F)=>{A.handle=F!=null?F:void 0},[A]),ref:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.element)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.element=F!=null?F:void 0},[A]),sourceRef:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.source)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.source=F!=null?F:void 0},[A]),targetRef:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.target)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.target=F!=null?F:void 0},[A])}}function I4($,J,Z){if($==="isDragSource"&&!Z&&J)return!0;return!1}function Y1($,J,Z){let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}async function H$($){let J=[],Z=[],X=$.items;if(X)for(let Q=0;Q<X.length;Q++){let K=X[Q];if(K.kind==="file"){let G=K.webkitGetAsEntry?.();if(G)Z.push({entry:G,path:""})}}else return Array.from($.files);let Y=(Q)=>{return new Promise((K)=>{Q.readEntries((G)=>K(G),()=>K([]))})},N=(Q)=>{return new Promise((K,G)=>{Q.file((z)=>K(z),(z)=>G(z))})};while(Z.length>0){let Q=Z.shift();if(!Q)continue;let{entry:K,path:G}=Q;if(K.isFile)try{let z=await N(K),M=G?`${G}/${z.name}`:z.name;Object.defineProperty(z,"webkitRelativePath",{value:M,writable:!1,configurable:!0}),J.push(z)}catch(z){console.error("Error reading file entry:",z)}else if(K.isDirectory){let z=K.createReader(),M=[],U=await Y(z);while(U.length>0)M=M.concat(U),U=await Y(z);let W=G?`${G}/${K.name}`:K.name;for(let w of M)Z.push({entry:w,path:W})}}return J}var c=d(l(),1);var D4=["red","orange","yellow","green","blue","purple","gray"],u2={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function N0($){if(!$)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let J=$.toLowerCase(),Z=u2[J];if(Z)return{backgroundColor:Z.bg,color:Z.text};if($.startsWith("#"))return{backgroundColor:`${$}33`,color:$};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:$}}var x4={[v.text]:F1,[v.longText]:K1,[v.select]:W1,[v.selectMulti]:M1,[v.rating]:r0,[v.number]:B1,[v.toggle]:U1,[v.date]:N1,[v.user]:w1,[v.userMulti]:V1};function j4({field:$,index:J,onVisibilityChange:Z}){let{ref:X,handleRef:Y}=X1({id:$.id,index:J}),N=$.config?.type?x4[$.config.type]:null;return R("div",{ref:X,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[R("div",{className:"flex items-center gap-2",children:[H("div",{ref:Y,className:"cursor-grab",children:H(q1,{className:"h-4 w-4 text-muted-foreground"})}),N&&H(N,{className:"h-4 w-4 text-muted-foreground shrink-0"}),$.aiAutofill&&H(H1,{className:"h-4 w-4 text-muted-foreground shrink-0"}),H("span",{className:"text-sm truncate",children:$.config?.name})]}),H(m0,{checked:$.visible,onCheckedChange:(Q)=>Z($.id,Q)})]})}function O$({projectId:$,onManageFields:J,onSave:Z}){let{fields:X,updateFields:Y}=Q5(),[N,Q]=c.useState(""),[K,G]=c.useState("list"),[z,M]=c.useState(""),[U,W]=c.useState(""),[w,B]=c.useState(!1),[O,P]=c.useState(""),[A,S]=c.useState([]),F=Q1();c.useEffect(()=>{F.invalidateQueries({queryKey:["fields",$]})},[$,F]);let L=T0.api.projects[":projectId"].fields.order.$patch,{mutate:V}=b2({mutationFn:async(k)=>{if(!(await L(k)).ok)throw Error(I.failed_update_fields_order());return null}}),q=T0.api.projects[":projectId"].fields.$post,{mutate:C}=b2({mutationFn:async(k)=>{let f=await q(k);if(!f.ok)throw Error(I.failed_create_field());return await f.json()},onSuccess:(k)=>{let f={...k,visible:!0},E=[...X,f];Y(E),M(""),S([]),V({param:{projectId:$},json:E.map((j)=>({fieldId:j.id,visible:j.visible||!1}))}),Z?.()}}),T=c.useMemo(()=>X.filter((k)=>k.config?.name?.toLowerCase().includes(N.toLowerCase())),[X,N]),D=(k)=>{let{source:f,target:E}=k.operation;if(f&&E&&f.id!==E.id){let j=X.findIndex((q0)=>q0.id===f.id),y1=X.findIndex((q0)=>q0.id===E.id),d2=Y1(X,j,y1);Y(d2),V({param:{projectId:$},json:d2.map((q0)=>({fieldId:q0.id,visible:q0.visible||!1}))})}},x=(k,f)=>{let E=X.map((j)=>j.id===k?{...j,visible:f}:j);Y(E),V({param:{projectId:$},json:E.map((j)=>({fieldId:j.id,visible:j.visible||!1}))})},g=()=>{if(!z||!U)return;let k=U===v.select?{select:{options:A}}:U===v.selectMulti?{selectMulti:{options:A}}:{};C({param:{projectId:$},json:{config:{name:z,type:U,...k},label:z,aiAutofill:w,description:O}})},m=X.filter((k)=>k.visible).length;if(K==="create")return H("div",{className:"w-80 p-4",children:R("div",{className:"space-y-4",children:[R("div",{className:"space-y-2",children:[H(F0,{htmlFor:"field-name",children:I.field_name()}),H(g0,{id:"field-name",placeholder:I.new_field_placeholder(),value:z,onChange:(k)=>M(k.target.value),autoFocus:!0})]}),R("div",{className:"space-y-2",children:[H(F0,{children:I.field_type()}),R(L1,{children:[H(R1,{asChild:!0,children:R(e,{variant:"outline",className:"w-full justify-between font-normal",children:[U?H("span",{className:"capitalize",children:U.replace(/_/g," ")}):H("span",{className:"text-muted-foreground border-dashed",children:I.select_field_type()}),H(w0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),H(A1,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(v).map((k)=>H(C1,{onClick:()=>{W(k),S([])},className:"capitalize",children:k.replace(/_/g," ")},k))})]})]}),R("div",{className:"space-y-2",children:[H(F0,{htmlFor:"field-desc",children:I.description()}),H(g0,{id:"field-desc",placeholder:I.description_optional_placeholder(),value:O,onChange:(k)=>P(k.target.value)})]}),R("div",{className:"flex items-center space-x-2",children:[H(m0,{id:"ai-autofill",checked:w,onCheckedChange:B}),H(F0,{htmlFor:"ai-autofill",children:I.ai_autofill()})]}),(U===v.select||U===v.selectMulti)&&R("div",{className:"space-y-2",children:[R("div",{className:"flex items-center justify-between",children:[H(F0,{className:"text-sm font-medium",children:I.options()}),R(e,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let k={id:L5(),displayName:I.new_option(),color:"#808080"};S([...A,k])},children:[H(c2,{className:"h-4 w-4 mr-1"})," ",I.add_option()]})]}),H("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:A.map((k,f)=>R("div",{className:"flex items-center gap-2",children:[H(g0,{value:k.displayName,onChange:(E)=>{let j=[...A];j[f]={...k,displayName:E.target.value},S(j)},placeholder:I.option_name_placeholder(),className:"h-8 flex-1"}),R(i,{children:[H(n,{asChild:!0,children:H("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:u2[k.color||""]?.hex||k.color||"#808080"}})}),H(o,{className:"p-2 w-auto",align:"end",children:H("div",{className:"flex gap-1",children:D4.map((E)=>H("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:u2[E]?.hex||E},onClick:()=>{let j=[...A];j[f]={...k,color:E},S(j)}},E))})})]}),H(e,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{S(A.filter((E,j)=>j!==f))},children:H(V0,{className:"h-4 w-4"})})]},k.id))})]}),R("div",{className:"flex gap-2 pt-2",children:[H(e,{variant:"secondary",className:"flex-1",onClick:()=>{G("list"),M(""),W(""),B(!1),P(""),S([])},children:I.cancel()}),H(e,{className:"flex-1",onClick:g,disabled:!z||!U,children:I.save()})]})]})});return R("div",{className:"w-80 p-4",children:[H("div",{className:"flex items-center justify-between mb-4",children:R("h3",{className:"font-semibold",children:[I.fields()," ",H("span",{className:"text-muted-foreground text-sm font-normal",children:I.visible_count({count:m})})]})}),R("div",{className:"relative mb-4",children:[H(z1,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),H(g0,{placeholder:I.search_fields_placeholder(),value:N,onChange:(k)=>Q(k.target.value),className:"pl-8"})]}),H("div",{className:"max-h-60 overflow-y-auto pr-2",children:H(T1,{sensors:[O1.configure({activationConstraints:[new P1.Distance({value:8})]}),k1],onDragEnd:D,children:T.map((k,f)=>H(j4,{field:k,index:f,onVisibilityChange:x},k.id))})}),J&&R("div",{className:"mt-4 space-y-2",children:[R(e,{variant:"secondary",className:"w-full",onClick:J,children:[H(G1,{className:"h-4 w-4 mr-2"}),I.manage_fields()]}),R(e,{className:"w-full",onClick:()=>G("create"),children:[H(c2,{className:"h-4 w-4 mr-2"}),I.new_field()]})]})]})}var y4=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.select,[N,Q]=S1.useState(!1),K=Y?.options?.find((W)=>W.id===$),G=()=>{if(!X)Q(!0)},z=(W)=>{Z(W),Q(!1)};return H("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:R(i,{open:!X&&N,onOpenChange:(W)=>{if(X)return;Q(W)},children:[H(n,{asChild:!0,children:R("div",{onClick:G,className:`flex items-center justify-between w-full min-h-[28px] px-2 py-1 rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((W)=>{if(!W)return H("span",{className:"text-muted-foreground italic",children:"Select an option"});return H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(W.color),children:W.displayName})})(K),!X&&H(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),R(o,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[150px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[R("div",{onClick:()=>z(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2",children:[H(V0,{className:"w-3 h-3"})," Clear"]}),Y?.options?.map((W)=>H("div",{onClick:()=>z(W.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center",children:H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(W.color),children:W.displayName})},W.id))]})]})})},f1=y4;var $0=d(l(),1);var v4=({value:$=[],config:J,onSave:Z,readOnly:X})=>{let Y=J?.selectMulti,N=$0.useRef(null),[Q,K]=$0.useState(!1),[G,z]=$0.useState(!1),[M,U]=$0.useState($.length),W=Y?.options?.filter((F)=>($||[]).includes(F.id))||[];$0.useLayoutEffect(()=>{if(Q||G){U(W.length);return}if(N.current){let F=N.current.offsetWidth,V=document.createElement("canvas").getContext("2d");if(V){V.font="12px ui-sans-serif, system-ui, sans-serif";let q=0,C=0,D=F-28;for(let x=0;x<W.length;x++){let m=V.measureText(W[x].displayName).width+16+4;if(q+m>D&&x<W.length-1)break;if(x===W.length-1){if(q+m<=F)C++;break}q+=m,C++}U(C)}}},[W,Q,G,$]);let w=(F)=>{let L=$||[],V;if(L.includes(F))V=L.filter((q)=>q!==F);else V=[...L,F];Z(V)},B=(F)=>{if(F.stopPropagation(),Q)return;let L=W.length-M;if(!G&&L>0)z(!0);else if(!X)K(!0)},O=(F)=>{if(F.stopPropagation(),!X)K(!0)},P=W.length-M;return H("div",{className:"relative w-full",onClick:(F)=>F.stopPropagation(),children:R(i,{open:!X&&(G&&!Q||Q),onOpenChange:(F)=>{if(X)return;if(!F)z(!1),K(!1)},children:[H(n,{asChild:!0,children:R("div",{ref:N,onClick:B,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!X||P>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[W.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.slice(0,M).map((F)=>H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:N0(F.color),children:F.displayName},F.id)),P>0&&R("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",P]})]})}),H(o,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${G&&!Q?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:G&&!Q?O:void 0,children:G&&!Q?R(Q2,{children:[W.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.map((F)=>H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:N0(F.color),children:F.displayName},F.id))]}):Y?.options?.map((F)=>{let L=($||[]).includes(F.id);return R("div",{onClick:()=>w(F.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between",children:[H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(F.color),children:F.displayName}),L&&H(H2,{className:"w-4 h-4 text-primary"})]},F.id)})})]})})},E1=v4;var J0=d(l(),1);var _4=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=J0.useState(!1),[N,Q]=J0.useState($||""),K=J0.useRef(null);J0.useEffect(()=>{Q($||"")},[$]),J0.useEffect(()=>{if(X&&K.current)K.current.focus()},[X]);let G=()=>{if(!Z)Y(!0)},z=()=>{Y(!1),J(N)},M=(U)=>{if(U.key==="Enter")K.current?.blur()};if(X)return H("input",{ref:K,type:"text",value:N,onChange:(U)=>Q(U.target.value),onBlur:z,onKeyDown:M,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return H("div",{onClick:G,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$||H("span",{className:"text-muted-foreground italic",children:"Empty"})})},I1=_4;var h4=({value:$,onSave:J,readOnly:Z})=>{return H("div",{className:"flex items-center h-[28px] w-full",onClick:(Y)=>Y.stopPropagation(),children:H(m0,{checked:$,onCheckedChange:(Y)=>{if(!Z)J(Y)},disabled:Z,className:"cursor-pointer"})})},D1=h4;var N2=d(l(),1);var g4=({value:$,onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:N}=o0(),[Q,K]=N2.useState(!1);N2.useEffect(()=>{if(X)N(X)},[X,N]);let G=Y.find((B)=>B.id===$),z=()=>{if(!Z)K(!0)},M=(B)=>{J(B),K(!1)},U=(B)=>{if(Z)return;K(B)},W=(B)=>{return B.split(" ").map((O)=>O[0]).slice(0,2).join("").toUpperCase()};return H("div",{className:"relative w-full",onClick:(B)=>B.stopPropagation(),children:R(i,{open:!Z&&Q,onOpenChange:U,children:[H(n,{asChild:!0,children:R("div",{onClick:z,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((B)=>{if(!B)return H("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return R("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[R(L0,{className:"w-4 h-4",children:[H(R0,{src:B.image,alt:B.name,className:"object-cover"}),H(A0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),H("span",{className:"truncate max-w-[120px]",children:B.name})]})})(G),!Z&&H(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),R(o,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[R("div",{onClick:()=>M(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[H(V0,{className:"w-3 h-3"})," Clear"]}),Y.map((B)=>R("div",{onClick:()=>M(B.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[R(L0,{className:"w-5 h-5",children:[H(R0,{src:B.image,alt:B.name,className:"object-cover"}),H(A0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),H("span",{className:"text-sm font-medium text-foreground",children:B.name})]},B.id))]})]})})},x1=g4;var s=d(l(),1);var m4=({value:$=[],onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:N}=o0(),Q=s.useRef(null),[K,G]=s.useState(!1),[z,M]=s.useState(!1),[U,W]=s.useState($.length);s.useEffect(()=>{if(X)N(X)},[X,N]);let w=Y.filter((q)=>($||[]).includes(q.id)),B=(q)=>{return q.split(" ").map((C)=>C[0]).slice(0,2).join("").toUpperCase()};s.useLayoutEffect(()=>{if(K||z){W(w.length);return}if(Q.current){let q=Q.current.offsetWidth,T=document.createElement("canvas").getContext("2d");if(T){T.font="12px ui-sans-serif, system-ui, sans-serif";let D=0,x=0,m=q-28;for(let k=0;k<w.length;k++){let E=T.measureText(w[k].name).width+42;if(D+E>m&&k<w.length-1)break;if(k===w.length-1){if(D+E<=q)x++;break}D+=E,x++}W(x)}}},[w,K,z,$]);let O=(q)=>{let C=$||[],T;if(C.includes(q))T=C.filter((D)=>D!==q);else T=[...C,q];J(T)},P=(q)=>{if(q.stopPropagation(),K)return;let C=w.length-U;if(!z&&C>0)M(!0);else if(!Z)G(!0)},A=(q)=>{if(q.stopPropagation(),!Z)G(!0)},S=w.length-U,F=z&&!K||K,L=(q)=>{if(Z)return;if(!q)M(!1),G(!1)},V=(q)=>{return R("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[R(L0,{className:"w-4 h-4",children:[H(R0,{src:q.image,alt:q.name,className:"object-cover"}),H(A0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:B(q.name)})]}),H("span",{className:"truncate max-w-[100px]",children:q.name})]},q.id)};return H("div",{className:"relative w-full",onClick:(q)=>q.stopPropagation(),children:R(i,{open:!Z&&F,onOpenChange:L,children:[H(n,{asChild:!0,children:R("div",{ref:Q,onClick:P,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!Z||S>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[w.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.slice(0,U).map(V),S>0&&R("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",S]})]})}),H(o,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${z&&!K?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:z&&!K?A:void 0,children:z&&!K?R(Q2,{children:[w.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.map(V)]}):Y.map((q)=>{let C=($||[]).includes(q.id);return R("div",{onClick:()=>O(q.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[R("div",{className:"flex items-center gap-2",children:[R(L0,{className:"w-5 h-5",children:[H(R0,{src:q.image,alt:q.name,className:"object-cover"}),H(A0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:B(q.name)})]}),H("span",{className:"text-sm font-medium text-foreground",children:q.name})]}),C&&H(H2,{className:"w-4 h-4 text-primary"})]},q.id)})})]})})},j1=m4;var b4=($)=>{if(!$.config)return H("div",{children:"Unknown Field Type"});switch($.config.type){case"text":return H(I1,{...$,value:$.value,onSave:$.onSave});case"longText":return H(U5,{...$,value:$.value,onSave:$.onSave});case"select":return H(f1,{...$,value:$.value,onSave:$.onSave});case"selectMulti":return H(E1,{...$,value:$.value,onSave:$.onSave});case"rating":return H(V5,{...$,value:$.value,onSave:$.onSave});case"number":return H(F5,{...$,value:$.value,onSave:$.onSave});case"toggle":return H(D1,{...$,value:$.value,onSave:$.onSave});case"date":return H(M5,{...$,value:$.value,onSave:$.onSave});case"user":return H(x1,{...$,value:$.value,onSave:$.onSave});case"userMulti":return H(j1,{...$,value:$.value,onSave:$.onSave});default:return H("div",{children:"Unknown Field Type"})}},L6=b4;var C6=({progress:$,className:J})=>{let X=2*Math.PI*20,Y=X-Math.min(100,Math.max(0,$))/100*X;return R("svg",{viewBox:"0 0 50 50",className:a0("w-12 h-12",J),children:[H("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),H("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:X,strokeDashoffset:Y,transform:"rotate(-90 25 25)"}),H("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round($)}%`})]})};var c4=($)=>{if(isNaN($))return"00:00";let J=new Date($*1000),Z=J.getUTCHours(),X=J.getUTCMinutes().toString().padStart(2,"0"),Y=J.getUTCSeconds().toString().padStart(2,"0");if(Z)return`${Z}:${X}:${Y}`;return`${X}:${Y}`},O6=($,J,Z,X)=>{if(Z==="frames")return`${$} fr`;if(Z==="standard")return c4($/J);let Y=Math.round(J),N=J!==Y,Q=!1;if(N&&(Y===30||Y===60))Q=!0;let K=0;if(X){let B=X.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(B){let O=parseInt(B[1],10),P=parseInt(B[2],10),A=parseInt(B[3],10),S=parseInt(B[5],10);if(Q=B[4]!==":",K=(O*3600+P*60+A)*Y+S,Q){let F=O*60+P,L=J<30?2:4;K-=L*(F-Math.floor(F/10))}}}let G=$+K;if(Q){let B=J<30?2:4,O=Math.floor(G/(17982*B/2)),P=G%(17982*B/2);if(P<B)P=P+B;G+=9*B*O+B*Math.floor((P-B)/(1798*B/2))}let z=G%Y,M=Math.floor(G/Y)%60,U=Math.floor(G/(Y*60))%60,W=Math.floor(G/(Y*3600))%24,w=Q?";":":";return`${W.toString().padStart(2,"0")}:${U.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}${w}${z.toString().padStart(2,"0")}`};var T6=($,J)=>{if(!J)return 0;let Z=1/J;return $*Z+Z/2},u4=($)=>Math.max(100,3000/($||30)),S6=({dbTotalFrames:$,containerDuration:J,frameRate:Z})=>{let X=Z||30,Y=Math.round(J*X);if($<=0)return Y;let N=$/X,Q=J-N,K=u4(X)/1000;return Q>K?Y:$};
2
2
  export{L2 as v,H5 as w,N5 as x,C2 as y,k2 as z,Y1 as A,H$ as B,Q5 as C,L5 as D,C6 as E,V5 as F,i as G,n as H,o as I,X1 as J,D4 as K,u2 as L,N0 as M,x4 as N,O$ as O,o0 as P,L6 as Q,c4 as R,O6 as S,T6 as T,u4 as U,S6 as V};