sqlmesh 0.181.2.dev7__py3-none-any.whl → 0.181.2.dev9__py3-none-any.whl
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.
- sqlmesh/_version.py +2 -2
- sqlmesh/lsp/api.py +61 -0
- sqlmesh/lsp/main.py +25 -0
- {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/METADATA +1 -1
- {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/RECORD +51 -50
- web/client/dist/assets/{Audits-4U9LnWyN.js → Audits-DRkR6sg0.js} +1 -1
- web/client/dist/assets/{Banner-DfF4HK9_.js → Banner-BXisqtMu.js} +1 -1
- web/client/dist/assets/{ChevronDownIcon-DhkdL7W7.js → ChevronDownIcon-D8CFPQ96.js} +1 -1
- web/client/dist/assets/{ChevronRightIcon-CknBR_Ye.js → ChevronRightIcon-BpRv8ZN4.js} +1 -1
- web/client/dist/assets/{Content-T59G6CRd.js → Content-KG4KSDDO.js} +1 -1
- web/client/dist/assets/{Content-DfnWzoRW.js → Content-pMJLtxGr.js} +1 -1
- web/client/dist/assets/{Data-Dvs4EVTS.js → Data-D-rZnh8x.js} +1 -1
- web/client/dist/assets/{DataCatalog-CsA-vDbc.js → DataCatalog-BJTDeU-_.js} +1 -1
- web/client/dist/assets/{Editor-DsU0OwIl.js → Editor-C8-1rqZ2.js} +1 -1
- web/client/dist/assets/{Editor-DgIo0RbF.js → Editor-Cpn7iBcm.js} +1 -1
- web/client/dist/assets/{Errors-BOLt2obm.js → Errors-DyDRdQyq.js} +1 -1
- web/client/dist/assets/{FileExplorer-CIj2pM9u.js → FileExplorer-CmdsG4yG.js} +3 -3
- web/client/dist/assets/{Footer--bTxQCKB.js → Footer-D4ok48Gm.js} +1 -1
- web/client/dist/assets/{Header-DmcDkHFL.js → Header-BVwdhMQQ.js} +1 -1
- web/client/dist/assets/{Input-CJirBrKe.js → Input-CxOCLTNw.js} +1 -1
- web/client/dist/assets/Lineage-ZXdxdqzl.js +1 -0
- web/client/dist/assets/{ListboxShow-C0DBUX71.js → ListboxShow-YBO3HIHQ.js} +1 -1
- web/client/dist/assets/{ModelLineage-B8hv0xJ-.js → ModelLineage-BFuK5Bgk.js} +1 -1
- web/client/dist/assets/{Models-CCm5MLTD.js → Models-Dn2xoUA7.js} +1 -1
- web/client/dist/assets/{Page-WrN3RYDT.js → Page-kOwPk8A6.js} +1 -1
- web/client/dist/assets/{Plan-CFJZVnkR.js → Plan-BQe3-3RL.js} +1 -1
- web/client/dist/assets/{PlusCircleIcon-CcC2lSkc.js → PlusCircleIcon-CXYicjof.js} +1 -1
- web/client/dist/assets/{ReportErrors-BK8N5y1z.js → ReportErrors-DaAC3YF4.js} +1 -1
- web/client/dist/assets/{Root-DSGcTlxk.js → Root-BIGZcS_U.js} +1 -1
- web/client/dist/assets/{SearchList-B9NnvRod.js → SearchList-Lag39srv.js} +1 -1
- web/client/dist/assets/{SelectEnvironment-CJsiOTlU.js → SelectEnvironment-0MCV04NI.js} +1 -1
- web/client/dist/assets/{SourceList-FVjgH2xJ.js → SourceList-CTL41Fia.js} +1 -1
- web/client/dist/assets/{SourceListItem-BDqqo5jo.js → SourceListItem-6mIYlySR.js} +1 -1
- web/client/dist/assets/{SplitPane-BSlIdmc8.js → SplitPane-7_khUxNG.js} +1 -1
- web/client/dist/assets/{Tests-DAbOEH7t.js → Tests-DSsKelgd.js} +1 -1
- web/client/dist/assets/{Welcome-c37SRGFq.js → Welcome-C0F3fb3h.js} +1 -1
- web/client/dist/assets/{context-APidk_GA.js → context-B0V9EzWJ.js} +13 -13
- web/client/dist/assets/{context-DmjvuTWz.js → context-pytQSsK4.js} +1 -1
- web/client/dist/assets/{editor-B2GioI_r.js → editor-CmeEFdEz.js} +1 -1
- web/client/dist/assets/{file-C7afm_LM.js → file-DY5SRTK1.js} +1 -1
- web/client/dist/assets/{help-C_umCstj.js → help-Bm8ph9oI.js} +1 -1
- web/client/dist/assets/{index-CK4fdw8q.js → index-BWibl-Ee.js} +1 -1
- web/client/dist/assets/{index-COnjINWU.js → index-C22hdM_h.js} +2 -2
- web/client/dist/assets/{plan-BwAtu9hd.js → plan-BUTy2uM-.js} +1 -1
- web/client/dist/assets/{project-CWUUCZWT.js → project-CtAE3tsj.js} +1 -1
- web/client/dist/assets/{transition-DjPYSO2n.js → transition-CiMBgn_Y.js} +1 -1
- web/client/dist/index.html +1 -1
- web/client/dist/assets/Lineage-BbLp8RL_.js +0 -1
- {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/WHEEL +0 -0
- {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.181.2.dev7.dist-info → sqlmesh-0.181.2.dev9.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{r as i,j as u,ac as Zr,R as re,f as hn,ad as Qr,ae as Jr,af as pe,ag as eo,a2 as to,c as L,W as pn,b as X,w as no,h as ro,a as oo,A as so,L as io,S as ao,m as co}from"./index-COnjINWU.js";import{u as k,M as lt}from"./project-CWUUCZWT.js";import{u as uo,o as lo,s as fo,f as go,a as ho,b as po,h as mo,l as vo,c as yo,d as Co,e as xo,z as So,g as bo,i as wo,R as Eo,j as Do,k as To}from"./Input-CJirBrKe.js";import{M as Oo}from"./file-C7afm_LM.js";import{useFileExplorer as Ge}from"./context-DmjvuTWz.js";import{u as mn,S as Io}from"./SearchList-B9NnvRod.js";import{u as Qe}from"./editor-B2GioI_r.js";import{F as Po}from"./ChevronDownIcon-DhkdL7W7.js";import{F as Ro}from"./ChevronRightIcon-CknBR_Ye.js";import"./help-6Q7f7fjd.js";import"./transition-DjPYSO2n.js";function Mo({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625Z"}),i.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}const No=i.forwardRef(Mo);function Ao({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M19.906 9c.382 0 .749.057 1.094.162V9a3 3 0 0 0-3-3h-3.879a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H6a3 3 0 0 0-3 3v3.162A3.756 3.756 0 0 1 4.094 9h15.812ZM4.094 10.5a2.25 2.25 0 0 0-2.227 2.568l.857 6A2.25 2.25 0 0 0 4.951 21H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-2.227-2.568H4.094Z"}))}const _o=i.forwardRef(Ao);function jo({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"}))}const Fo=i.forwardRef(jo);function P(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function Te(t,e=[]){let n=[];function r(s,a){const c=i.createContext(a),d=n.length;n=[...n,a];const l=h=>{var y;const{scope:g,children:m,...C}=h,p=((y=g==null?void 0:g[t])==null?void 0:y[d])||c,v=i.useMemo(()=>C,Object.values(C));return u.jsx(p.Provider,{value:v,children:m})};l.displayName=s+"Provider";function f(h,g){var p;const m=((p=g==null?void 0:g[t])==null?void 0:p[d])||c,C=i.useContext(m);if(C)return C;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(a=>i.createContext(a));return function(c){const d=(c==null?void 0:c[t])||s;return i.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return o.scopeName=t,[r,Lo(o,...e)]}function Lo(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((c,{useScope:d,scopeName:l})=>{const h=d(s)[`__scope${l}`];return{...c,...h}},{});return i.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function Ht(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function xt(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Ht(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ht(t[o],null)}}}}function W(...t){return i.useCallback(xt(...t),t)}function He(t){const e=ko(t),n=i.forwardRef((r,o)=>{const{children:s,...a}=r,c=i.Children.toArray(s),d=c.find(Ho);if(d){const l=d.props.children,f=c.map(h=>h===d?i.Children.count(l)>1?i.Children.only(null):i.isValidElement(l)?l.props.children:null:h);return u.jsx(e,{...a,ref:o,children:i.isValidElement(l)?i.cloneElement(l,void 0,f):null})}return u.jsx(e,{...a,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function ko(t){const e=i.forwardRef((n,r)=>{const{children:o,...s}=n;if(i.isValidElement(o)){const a=Bo(o),c=$o(s,o.props);return o.type!==i.Fragment&&(c.ref=r?xt(r,a):a),i.cloneElement(o,c)}return i.Children.count(o)>1?i.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Uo=Symbol("radix.slottable");function Ho(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Uo}function $o(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{s(...c),o(...c)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function Bo(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Go=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=Go.reduce((t,e)=>{const n=He(`Primitive.${e}`),r=i.forwardRef((o,s)=>{const{asChild:a,...c}=o,d=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function vn(t,e){t&&Zr.flushSync(()=>t.dispatchEvent(e))}function yn(t){const e=t+"CollectionProvider",[n,r]=Te(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:y}=p,w=re.useRef(null),b=re.useRef(new Map).current;return u.jsx(o,{scope:v,itemMap:b,collectionRef:w,children:y})};a.displayName=e;const c=t+"CollectionSlot",d=He(c),l=re.forwardRef((p,v)=>{const{scope:y,children:w}=p,b=s(c,y),E=W(v,b.collectionRef);return u.jsx(d,{ref:E,children:w})});l.displayName=c;const f=t+"CollectionItemSlot",h="data-radix-collection-item",g=He(f),m=re.forwardRef((p,v)=>{const{scope:y,children:w,...b}=p,E=re.useRef(null),I=W(v,E),R=s(f,y);return re.useEffect(()=>(R.itemMap.set(E,{ref:E,...b}),()=>void R.itemMap.delete(E))),u.jsx(g,{[h]:"",ref:I,children:w})});m.displayName=f;function C(p){const v=s(t+"CollectionConsumer",p);return re.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((R,T)=>b.indexOf(R.ref.current)-b.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:l,ItemSlot:m},C,r]}var Ko=i.createContext(void 0);function Cn(t){const e=i.useContext(Ko);return t||e||"ltr"}function J(t){const e=i.useRef(t);return i.useEffect(()=>{e.current=t}),i.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function Wo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Vo="DismissableLayer",dt="dismissableLayer.update",Yo="dismissableLayer.pointerDownOutside",Xo="dismissableLayer.focusOutside",$t,xn=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sn=i.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...d}=t,l=i.useContext(xn),[f,h]=i.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=i.useState({}),C=W(e,T=>h(T)),p=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,I=Zo(T=>{const M=T.target,_=[...l.branches].some(F=>F.contains(M));!E||_||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},g),R=Qo(T=>{const M=T.target;[...l.branches].some(F=>F.contains(M))||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},g);return Wo(T=>{w===l.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),i.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&($t=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Bt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=$t)}},[f,g,n,l]),i.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Bt())},[f,l]),i.useEffect(()=>{const T=()=>m({});return document.addEventListener(dt,T),()=>document.removeEventListener(dt,T)},[]),u.jsx($.div,{...d,ref:C,style:{pointerEvents:b?E?"auto":"none":void 0,...t.style},onFocusCapture:P(t.onFocusCapture,R.onFocusCapture),onBlurCapture:P(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:P(t.onPointerDownCapture,I.onPointerDownCapture)})});Sn.displayName=Vo;var zo="DismissableLayerBranch",qo=i.forwardRef((t,e)=>{const n=i.useContext(xn),r=i.useRef(null),o=W(e,r);return i.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx($.div,{...t,ref:o})});qo.displayName=zo;function Zo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let d=function(){bn(Yo,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=d,e.addEventListener("click",o.current,{once:!0})):d()}else e.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Qo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t),r=i.useRef(!1);return i.useEffect(()=>{const o=s=>{s.target&&!r.current&&bn(Xo,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Bt(){const t=new CustomEvent(dt);document.dispatchEvent(t)}function bn(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?vn(o,s):o.dispatchEvent(s)}var Je=0;function Jo(){i.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Gt()),document.body.insertAdjacentElement("beforeend",t[1]??Gt()),Je++,()=>{Je===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Je--}},[])}function Gt(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var et="focusScope.autoFocusOnMount",tt="focusScope.autoFocusOnUnmount",Kt={bubbles:!1,cancelable:!0},es="FocusScope",wn=i.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=t,[c,d]=i.useState(null),l=J(o),f=J(s),h=i.useRef(null),g=W(e,p=>d(p)),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let p=function(b){if(m.paused||!c)return;const E=b.target;c.contains(E)?h.current=E:oe(h.current,{select:!0})},v=function(b){if(m.paused||!c)return;const E=b.relatedTarget;E!==null&&(c.contains(E)||oe(h.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const I of b)I.removedNodes.length>0&&oe(c)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,c,m.paused]),i.useEffect(()=>{if(c){Vt.add(m);const p=document.activeElement;if(!c.contains(p)){const y=new CustomEvent(et,Kt);c.addEventListener(et,l),c.dispatchEvent(y),y.defaultPrevented||(ts(is(En(c)),{select:!0}),document.activeElement===p&&oe(c))}return()=>{c.removeEventListener(et,l),setTimeout(()=>{const y=new CustomEvent(tt,Kt);c.addEventListener(tt,f),c.dispatchEvent(y),y.defaultPrevented||oe(p??document.body,{select:!0}),c.removeEventListener(tt,f),Vt.remove(m)},0)}}},[c,l,f,m]);const C=i.useCallback(p=>{if(!n&&!r||m.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[b,E]=ns(w);b&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&oe(b,{select:!0})):p.shiftKey&&y===b&&(p.preventDefault(),n&&oe(E,{select:!0})):y===w&&p.preventDefault()}},[n,r,m.paused]);return u.jsx($.div,{tabIndex:-1,...a,ref:g,onKeyDown:C})});wn.displayName=es;function ts(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(oe(r,{select:e}),document.activeElement!==n)return}function ns(t){const e=En(t),n=Wt(e,t),r=Wt(e.reverse(),t);return[n,r]}function En(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Wt(t,e){for(const n of t)if(!rs(n,{upTo:e}))return n}function rs(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function os(t){return t instanceof HTMLInputElement&&"select"in t}function oe(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&os(t)&&e&&t.select()}}var Vt=ss();function ss(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Yt(t,e),t.unshift(e)},remove(e){var n;t=Yt(t,e),(n=t[0])==null||n.resume()}}}function Yt(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function is(t){return t.filter(e=>e.tagName!=="A")}var se=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},as=hn[" useId ".trim().toString()]||(()=>{}),cs=0;function us(t){const[e,n]=i.useState(as());return se(()=>{n(r=>r??String(cs++))},[t]),e?`radix-${e}`:""}var ls="Arrow",Dn=i.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...s}=t;return u.jsx($.svg,{...s,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dn.displayName=ls;var ds=Dn;function fs(t){const[e,n]=i.useState(void 0);return se(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,c;if("borderBoxSize"in s){const d=s.borderBoxSize,l=Array.isArray(d)?d[0]:d;a=l.inlineSize,c=l.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var St="Popper",[Tn,On]=Te(St),[gs,In]=Tn(St),Pn=t=>{const{__scopePopper:e,children:n}=t,[r,o]=i.useState(null);return u.jsx(gs,{scope:e,anchor:r,onAnchorChange:o,children:n})};Pn.displayName=St;var Rn="PopperAnchor",Mn=i.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,s=In(Rn,n),a=i.useRef(null),c=W(e,a);return i.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:u.jsx($.div,{...o,ref:c})});Mn.displayName=Rn;var bt="PopperContent",[hs,ps]=Tn(bt),Nn=i.forwardRef((t,e)=>{var ne,ye,Y,Ce,Lt,kt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:C,...p}=t,v=In(bt,n),[y,w]=i.useState(null),b=W(e,xe=>w(xe)),[E,I]=i.useState(null),R=fs(E),T=(R==null?void 0:R.width)??0,M=(R==null?void 0:R.height)??0,_=r+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(l)?l:[l],A=D.length>0,G={padding:F,boundary:D.filter(vs),altBoundary:A},{refs:ee,floatingStyles:te,placement:V,isPositioned:U,middlewareData:S}=uo({strategy:"fixed",placement:_,whileElementsMounted:(...xe)=>yo(...xe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[lo({mainAxis:o+M,alignmentAxis:a}),d&&fo({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?vo():void 0,...G}),d&&go({...G}),ho({...G,apply:({elements:xe,rects:Ut,availableWidth:Yr,availableHeight:Xr})=>{const{width:zr,height:qr}=Ut.reference,Ne=xe.floating.style;Ne.setProperty("--radix-popper-available-width",`${Yr}px`),Ne.setProperty("--radix-popper-available-height",`${Xr}px`),Ne.setProperty("--radix-popper-anchor-width",`${zr}px`),Ne.setProperty("--radix-popper-anchor-height",`${qr}px`)}}),E&&po({element:E,padding:c}),ys({arrowWidth:T,arrowHeight:M}),g&&mo({strategy:"referenceHidden",...G})]}),[x,N]=jn(V),j=J(C);se(()=>{U&&(j==null||j())},[U,j]);const H=(ne=S.arrow)==null?void 0:ne.x,me=(ye=S.arrow)==null?void 0:ye.y,ve=((Y=S.arrow)==null?void 0:Y.centerOffset)!==0,[Me,ie]=i.useState();return se(()=>{y&&ie(window.getComputedStyle(y).zIndex)},[y]),u.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:U?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Me,"--radix-popper-transform-origin":[(Ce=S.transformOrigin)==null?void 0:Ce.x,(Lt=S.transformOrigin)==null?void 0:Lt.y].join(" "),...((kt=S.hide)==null?void 0:kt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:u.jsx(hs,{scope:n,placedSide:x,onArrowChange:I,arrowX:H,arrowY:me,shouldHideArrow:ve,children:u.jsx($.div,{"data-side":x,"data-align":N,...p,ref:b,style:{...p.style,animation:U?void 0:"none"}})})})});Nn.displayName=bt;var An="PopperArrow",ms={top:"bottom",right:"left",bottom:"top",left:"right"},_n=i.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,s=ps(An,r),a=ms[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(ds,{...o,ref:n,style:{...o.style,display:"block"}})})});_n.displayName=An;function vs(t){return t!==null}var ys=t=>({name:"transformOrigin",options:t,fn(e){var v,y,w;const{placement:n,rects:r,middlewareData:o}=e,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,c=a?0:t.arrowWidth,d=a?0:t.arrowHeight,[l,f]=jn(n),h={start:"0%",center:"50%",end:"100%"}[f],g=(((y=o.arrow)==null?void 0:y.x)??0)+c/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+d/2;let C="",p="";return l==="bottom"?(C=a?h:`${g}px`,p=`${-d}px`):l==="top"?(C=a?h:`${g}px`,p=`${r.floating.height+d}px`):l==="right"?(C=`${-d}px`,p=a?h:`${m}px`):l==="left"&&(C=`${r.floating.width+d}px`,p=a?h:`${m}px`),{data:{x:C,y:p}}}});function jn(t){const[e,n="center"]=t.split("-");return[e,n]}var Cs=Pn,xs=Mn,Ss=Nn,bs=_n,ws="Portal",Fn=i.forwardRef((t,e)=>{var c;const{container:n,...r}=t,[o,s]=i.useState(!1);se(()=>s(!0),[]);const a=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Qr.createPortal(u.jsx($.div,{...r,ref:e}),a):null});Fn.displayName=ws;function Es(t,e){return i.useReducer((n,r)=>e[n][r]??n,t)}var Oe=t=>{const{present:e,children:n}=t,r=Ds(e),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),s=W(r.ref,Ts(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:s}):null};Oe.displayName="Presence";function Ds(t){const[e,n]=i.useState(),r=i.useRef({}),o=i.useRef(t),s=i.useRef("none"),a=t?"mounted":"unmounted",[c,d]=Es(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const l=Ae(r.current);s.current=c==="mounted"?l:"none"},[c]),se(()=>{const l=r.current,f=o.current;if(f!==t){const g=s.current,m=Ae(l);t?d("MOUNT"):m==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(f&&g!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),se(()=>{if(e){let l;const f=e.ownerDocument.defaultView??window,h=m=>{const p=Ae(r.current).includes(m.animationName);if(m.target===e&&p&&(d("ANIMATION_END"),!o.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",l=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},g=m=>{m.target===e&&(s.current=Ae(r.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(l),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Ae(t){return(t==null?void 0:t.animationName)||"none"}function Ts(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Os=hn[" useInsertionEffect ".trim().toString()]||se;function Is({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,s,a]=Ps({defaultProp:e,onChange:n}),c=t!==void 0,d=c?t:o;{const f=i.useRef(t!==void 0);i.useEffect(()=>{const h=f.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const l=i.useCallback(f=>{var h;if(c){const g=Rs(f)?f(t):f;g!==t&&((h=a.current)==null||h.call(a,g))}else s(f)},[c,t,s,a]);return[d,l]}function Ps({defaultProp:t,onChange:e}){const[n,r]=i.useState(t),o=i.useRef(n),s=i.useRef(e);return Os(()=>{s.current=e},[e]),i.useEffect(()=>{var a;o.current!==n&&((a=s.current)==null||a.call(s,n),o.current=n)},[n,o]),[n,r,s]}function Rs(t){return typeof t=="function"}var nt="rovingFocusGroup.onEntryFocus",Ms={bubbles:!1,cancelable:!0},Ie="RovingFocusGroup",[ft,Ln,Ns]=yn(Ie),[As,kn]=Te(Ie,[Ns]),[_s,js]=As(Ie),Un=i.forwardRef((t,e)=>u.jsx(ft.Provider,{scope:t.__scopeRovingFocusGroup,children:u.jsx(ft.Slot,{scope:t.__scopeRovingFocusGroup,children:u.jsx(Fs,{...t,ref:e})})}));Un.displayName=Ie;var Fs=i.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...h}=t,g=i.useRef(null),m=W(e,g),C=Cn(s),[p,v]=Is({prop:a,defaultProp:c??null,onChange:d,caller:Ie}),[y,w]=i.useState(!1),b=J(l),E=Ln(n),I=i.useRef(!1),[R,T]=i.useState(0);return i.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(nt,b),()=>M.removeEventListener(nt,b)},[b]),u.jsx(_s,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:p,onItemFocus:i.useCallback(M=>v(M),[v]),onItemShiftTab:i.useCallback(()=>w(!0),[]),onFocusableItemAdd:i.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:i.useCallback(()=>T(M=>M-1),[]),children:u.jsx($.div,{tabIndex:y||R===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:P(t.onMouseDown,()=>{I.current=!0}),onFocus:P(t.onFocus,M=>{const _=!I.current;if(M.target===M.currentTarget&&_&&!y){const F=new CustomEvent(nt,Ms);if(M.currentTarget.dispatchEvent(F),!F.defaultPrevented){const D=E().filter(V=>V.focusable),A=D.find(V=>V.active),G=D.find(V=>V.id===p),te=[A,G,...D].filter(Boolean).map(V=>V.ref.current);Bn(te,f)}}I.current=!1}),onBlur:P(t.onBlur,()=>w(!1))})})}),Hn="RovingFocusGroupItem",$n=i.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...c}=t,d=us(),l=s||d,f=js(Hn,n),h=f.currentTabStopId===l,g=Ln(n),{onFocusableItemAdd:m,onFocusableItemRemove:C,currentTabStopId:p}=f;return i.useEffect(()=>{if(r)return m(),()=>C()},[r,m,C]),u.jsx(ft.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:u.jsx($.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:e,onMouseDown:P(t.onMouseDown,v=>{r?f.onItemFocus(l):v.preventDefault()}),onFocus:P(t.onFocus,()=>f.onItemFocus(l)),onKeyDown:P(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=Us(v,f.orientation,f.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=g().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")b.reverse();else if(y==="prev"||y==="next"){y==="prev"&&b.reverse();const E=b.indexOf(v.currentTarget);b=f.loop?Hs(b,E+1):b.slice(E+1)}setTimeout(()=>Bn(b))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:p!=null}):a})})});$n.displayName=Hn;var Ls={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ks(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Us(t,e,n){const r=ks(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ls[r]}function Bn(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Hs(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var $s=Un,Bs=$n,Gn=Co(),rt=function(){},Ke=i.forwardRef(function(t,e){var n=i.useRef(null),r=i.useState({onScrollCapture:rt,onWheelCapture:rt,onTouchMoveCapture:rt}),o=r[0],s=r[1],a=t.forwardProps,c=t.children,d=t.className,l=t.removeScrollBar,f=t.enabled,h=t.shards,g=t.sideCar,m=t.noIsolation,C=t.inert,p=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,w=t.gapMode,b=Jr(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,I=xo([n,e]),R=pe(pe({},b),o);return i.createElement(i.Fragment,null,f&&i.createElement(E,{sideCar:Gn,removeScrollBar:l,shards:h,noIsolation:m,inert:C,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:w}),a?i.cloneElement(i.Children.only(c),pe(pe({},R),{ref:I})):i.createElement(y,pe({},R,{className:d,ref:I}),c))});Ke.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ke.classNames={fullWidth:bo,zeroRight:So};var gt=!1;if(typeof window<"u")try{var _e=Object.defineProperty({},"passive",{get:function(){return gt=!0,!0}});window.addEventListener("test",_e,_e),window.removeEventListener("test",_e,_e)}catch{gt=!1}var fe=gt?{passive:!1}:!1,Gs=function(t){return t.tagName==="TEXTAREA"},Kn=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Gs(t)&&n[e]==="visible")},Ks=function(t){return Kn(t,"overflowY")},Ws=function(t){return Kn(t,"overflowX")},Xt=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Wn(t,r);if(o){var s=Vn(t,r),a=s[1],c=s[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vs=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Ys=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Wn=function(t,e){return t==="v"?Ks(e):Ws(e)},Vn=function(t,e){return t==="v"?Vs(e):Ys(e)},Xs=function(t,e){return t==="h"&&e==="rtl"?-1:1},zs=function(t,e,n,r,o){var s=Xs(t,window.getComputedStyle(e).direction),a=s*r,c=n.target,d=e.contains(c),l=!1,f=a>0,h=0,g=0;do{var m=Vn(t,c),C=m[0],p=m[1],v=m[2],y=p-v-s*C;(C||y)&&Wn(t,c)&&(h+=y,g+=C),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!d&&c!==document.body||d&&(e.contains(c)||e===c));return(f&&Math.abs(h)<1||!f&&Math.abs(g)<1)&&(l=!0),l},je=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},zt=function(t){return[t.deltaX,t.deltaY]},qt=function(t){return t&&"current"in t?t.current:t},qs=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Zs=function(t){return`
|
|
1
|
+
import{r as i,j as u,ac as Zr,R as re,f as gn,ad as Qr,ae as Jr,af as pe,ag as eo,a2 as to,c as L,W as hn,b as X,w as no,h as ro,a as oo,A as so,L as io,S as ao,m as co}from"./index-C22hdM_h.js";import{u as k,M as lt}from"./project-CtAE3tsj.js";import{u as uo,o as lo,s as fo,f as go,a as ho,b as po,h as mo,l as vo,c as yo,d as Co,e as xo,z as So,g as bo,i as wo,R as Eo,j as Do,k as To}from"./Input-CxOCLTNw.js";import{M as Oo}from"./file-DY5SRTK1.js";import{useFileExplorer as Ge}from"./context-pytQSsK4.js";import{u as pn,S as Io}from"./SearchList-Lag39srv.js";import{u as Qe}from"./editor-CmeEFdEz.js";import{F as Po}from"./ChevronDownIcon-D8CFPQ96.js";import{F as Ro}from"./ChevronRightIcon-BpRv8ZN4.js";import"./help-6Q7f7fjd.js";import"./transition-CiMBgn_Y.js";function Mo({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625Z"}),i.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}const No=i.forwardRef(Mo);function Ao({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M19.906 9c.382 0 .749.057 1.094.162V9a3 3 0 0 0-3-3h-3.879a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H6a3 3 0 0 0-3 3v3.162A3.756 3.756 0 0 1 4.094 9h15.812ZM4.094 10.5a2.25 2.25 0 0 0-2.227 2.568l.857 6A2.25 2.25 0 0 0 4.951 21H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-2.227-2.568H4.094Z"}))}const _o=i.forwardRef(Ao);function jo({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"}))}const Fo=i.forwardRef(jo);function P(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function Te(t,e=[]){let n=[];function r(s,a){const c=i.createContext(a),d=n.length;n=[...n,a];const l=h=>{var y;const{scope:g,children:m,...C}=h,p=((y=g==null?void 0:g[t])==null?void 0:y[d])||c,v=i.useMemo(()=>C,Object.values(C));return u.jsx(p.Provider,{value:v,children:m})};l.displayName=s+"Provider";function f(h,g){var p;const m=((p=g==null?void 0:g[t])==null?void 0:p[d])||c,C=i.useContext(m);if(C)return C;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(a=>i.createContext(a));return function(c){const d=(c==null?void 0:c[t])||s;return i.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return o.scopeName=t,[r,Lo(o,...e)]}function Lo(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((c,{useScope:d,scopeName:l})=>{const h=d(s)[`__scope${l}`];return{...c,...h}},{});return i.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function Ut(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function mn(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Ut(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ut(t[o],null)}}}}function $(...t){return i.useCallback(mn(...t),t)}function He(t){const e=ko(t),n=i.forwardRef((r,o)=>{const{children:s,...a}=r,c=i.Children.toArray(s),d=c.find(Ho);if(d){const l=d.props.children,f=c.map(h=>h===d?i.Children.count(l)>1?i.Children.only(null):i.isValidElement(l)?l.props.children:null:h);return u.jsx(e,{...a,ref:o,children:i.isValidElement(l)?i.cloneElement(l,void 0,f):null})}return u.jsx(e,{...a,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function ko(t){const e=i.forwardRef((n,r)=>{const{children:o,...s}=n,a=i.isValidElement(o)?Bo(o):void 0,c=$(a,r);if(i.isValidElement(o)){const d=$o(s,o.props);return o.type!==i.Fragment&&(d.ref=c),i.cloneElement(o,d)}return i.Children.count(o)>1?i.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Uo=Symbol("radix.slottable");function Ho(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Uo}function $o(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function Bo(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Go=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],B=Go.reduce((t,e)=>{const n=He(`Primitive.${e}`),r=i.forwardRef((o,s)=>{const{asChild:a,...c}=o,d=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function vn(t,e){t&&Zr.flushSync(()=>t.dispatchEvent(e))}function yn(t){const e=t+"CollectionProvider",[n,r]=Te(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:y}=p,w=re.useRef(null),b=re.useRef(new Map).current;return u.jsx(o,{scope:v,itemMap:b,collectionRef:w,children:y})};a.displayName=e;const c=t+"CollectionSlot",d=He(c),l=re.forwardRef((p,v)=>{const{scope:y,children:w}=p,b=s(c,y),E=$(v,b.collectionRef);return u.jsx(d,{ref:E,children:w})});l.displayName=c;const f=t+"CollectionItemSlot",h="data-radix-collection-item",g=He(f),m=re.forwardRef((p,v)=>{const{scope:y,children:w,...b}=p,E=re.useRef(null),I=$(v,E),R=s(f,y);return re.useEffect(()=>(R.itemMap.set(E,{ref:E,...b}),()=>void R.itemMap.delete(E))),u.jsx(g,{[h]:"",ref:I,children:w})});m.displayName=f;function C(p){const v=s(t+"CollectionConsumer",p);return re.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((R,T)=>b.indexOf(R.ref.current)-b.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:l,ItemSlot:m},C,r]}var Ko=i.createContext(void 0);function Cn(t){const e=i.useContext(Ko);return t||e||"ltr"}function J(t){const e=i.useRef(t);return i.useEffect(()=>{e.current=t}),i.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function Wo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Vo="DismissableLayer",dt="dismissableLayer.update",Yo="dismissableLayer.pointerDownOutside",Xo="dismissableLayer.focusOutside",Ht,xn=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sn=i.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...d}=t,l=i.useContext(xn),[f,h]=i.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=i.useState({}),C=$(e,T=>h(T)),p=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,I=Zo(T=>{const M=T.target,_=[...l.branches].some(F=>F.contains(M));!E||_||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},g),R=Qo(T=>{const M=T.target;[...l.branches].some(F=>F.contains(M))||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},g);return Wo(T=>{w===l.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),i.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ht=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),$t(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Ht)}},[f,g,n,l]),i.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),$t())},[f,l]),i.useEffect(()=>{const T=()=>m({});return document.addEventListener(dt,T),()=>document.removeEventListener(dt,T)},[]),u.jsx(B.div,{...d,ref:C,style:{pointerEvents:b?E?"auto":"none":void 0,...t.style},onFocusCapture:P(t.onFocusCapture,R.onFocusCapture),onBlurCapture:P(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:P(t.onPointerDownCapture,I.onPointerDownCapture)})});Sn.displayName=Vo;var zo="DismissableLayerBranch",qo=i.forwardRef((t,e)=>{const n=i.useContext(xn),r=i.useRef(null),o=$(e,r);return i.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(B.div,{...t,ref:o})});qo.displayName=zo;function Zo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let d=function(){bn(Yo,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=d,e.addEventListener("click",o.current,{once:!0})):d()}else e.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Qo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t),r=i.useRef(!1);return i.useEffect(()=>{const o=s=>{s.target&&!r.current&&bn(Xo,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $t(){const t=new CustomEvent(dt);document.dispatchEvent(t)}function bn(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?vn(o,s):o.dispatchEvent(s)}var Je=0;function Jo(){i.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Bt()),document.body.insertAdjacentElement("beforeend",t[1]??Bt()),Je++,()=>{Je===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Je--}},[])}function Bt(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var et="focusScope.autoFocusOnMount",tt="focusScope.autoFocusOnUnmount",Gt={bubbles:!1,cancelable:!0},es="FocusScope",wn=i.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=t,[c,d]=i.useState(null),l=J(o),f=J(s),h=i.useRef(null),g=$(e,p=>d(p)),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let p=function(b){if(m.paused||!c)return;const E=b.target;c.contains(E)?h.current=E:oe(h.current,{select:!0})},v=function(b){if(m.paused||!c)return;const E=b.relatedTarget;E!==null&&(c.contains(E)||oe(h.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const I of b)I.removedNodes.length>0&&oe(c)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,c,m.paused]),i.useEffect(()=>{if(c){Wt.add(m);const p=document.activeElement;if(!c.contains(p)){const y=new CustomEvent(et,Gt);c.addEventListener(et,l),c.dispatchEvent(y),y.defaultPrevented||(ts(is(En(c)),{select:!0}),document.activeElement===p&&oe(c))}return()=>{c.removeEventListener(et,l),setTimeout(()=>{const y=new CustomEvent(tt,Gt);c.addEventListener(tt,f),c.dispatchEvent(y),y.defaultPrevented||oe(p??document.body,{select:!0}),c.removeEventListener(tt,f),Wt.remove(m)},0)}}},[c,l,f,m]);const C=i.useCallback(p=>{if(!n&&!r||m.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[b,E]=ns(w);b&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&oe(b,{select:!0})):p.shiftKey&&y===b&&(p.preventDefault(),n&&oe(E,{select:!0})):y===w&&p.preventDefault()}},[n,r,m.paused]);return u.jsx(B.div,{tabIndex:-1,...a,ref:g,onKeyDown:C})});wn.displayName=es;function ts(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(oe(r,{select:e}),document.activeElement!==n)return}function ns(t){const e=En(t),n=Kt(e,t),r=Kt(e.reverse(),t);return[n,r]}function En(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Kt(t,e){for(const n of t)if(!rs(n,{upTo:e}))return n}function rs(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function os(t){return t instanceof HTMLInputElement&&"select"in t}function oe(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&os(t)&&e&&t.select()}}var Wt=ss();function ss(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Vt(t,e),t.unshift(e)},remove(e){var n;t=Vt(t,e),(n=t[0])==null||n.resume()}}}function Vt(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function is(t){return t.filter(e=>e.tagName!=="A")}var se=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},as=gn[" useId ".trim().toString()]||(()=>{}),cs=0;function us(t){const[e,n]=i.useState(as());return se(()=>{n(r=>r??String(cs++))},[t]),e?`radix-${e}`:""}var ls="Arrow",Dn=i.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...s}=t;return u.jsx(B.svg,{...s,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dn.displayName=ls;var ds=Dn;function fs(t){const[e,n]=i.useState(void 0);return se(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,c;if("borderBoxSize"in s){const d=s.borderBoxSize,l=Array.isArray(d)?d[0]:d;a=l.inlineSize,c=l.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var xt="Popper",[Tn,On]=Te(xt),[gs,In]=Tn(xt),Pn=t=>{const{__scopePopper:e,children:n}=t,[r,o]=i.useState(null);return u.jsx(gs,{scope:e,anchor:r,onAnchorChange:o,children:n})};Pn.displayName=xt;var Rn="PopperAnchor",Mn=i.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,s=In(Rn,n),a=i.useRef(null),c=$(e,a);return i.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:u.jsx(B.div,{...o,ref:c})});Mn.displayName=Rn;var St="PopperContent",[hs,ps]=Tn(St),Nn=i.forwardRef((t,e)=>{var ne,ye,Y,Ce,Ft,Lt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:C,...p}=t,v=In(St,n),[y,w]=i.useState(null),b=$(e,xe=>w(xe)),[E,I]=i.useState(null),R=fs(E),T=(R==null?void 0:R.width)??0,M=(R==null?void 0:R.height)??0,_=r+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(l)?l:[l],A=D.length>0,K={padding:F,boundary:D.filter(vs),altBoundary:A},{refs:ee,floatingStyles:te,placement:V,isPositioned:U,middlewareData:S}=uo({strategy:"fixed",placement:_,whileElementsMounted:(...xe)=>yo(...xe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[lo({mainAxis:o+M,alignmentAxis:a}),d&&fo({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?vo():void 0,...K}),d&&go({...K}),ho({...K,apply:({elements:xe,rects:kt,availableWidth:Yr,availableHeight:Xr})=>{const{width:zr,height:qr}=kt.reference,Ne=xe.floating.style;Ne.setProperty("--radix-popper-available-width",`${Yr}px`),Ne.setProperty("--radix-popper-available-height",`${Xr}px`),Ne.setProperty("--radix-popper-anchor-width",`${zr}px`),Ne.setProperty("--radix-popper-anchor-height",`${qr}px`)}}),E&&po({element:E,padding:c}),ys({arrowWidth:T,arrowHeight:M}),g&&mo({strategy:"referenceHidden",...K})]}),[x,N]=jn(V),j=J(C);se(()=>{U&&(j==null||j())},[U,j]);const H=(ne=S.arrow)==null?void 0:ne.x,me=(ye=S.arrow)==null?void 0:ye.y,ve=((Y=S.arrow)==null?void 0:Y.centerOffset)!==0,[Me,ie]=i.useState();return se(()=>{y&&ie(window.getComputedStyle(y).zIndex)},[y]),u.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:U?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Me,"--radix-popper-transform-origin":[(Ce=S.transformOrigin)==null?void 0:Ce.x,(Ft=S.transformOrigin)==null?void 0:Ft.y].join(" "),...((Lt=S.hide)==null?void 0:Lt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:u.jsx(hs,{scope:n,placedSide:x,onArrowChange:I,arrowX:H,arrowY:me,shouldHideArrow:ve,children:u.jsx(B.div,{"data-side":x,"data-align":N,...p,ref:b,style:{...p.style,animation:U?void 0:"none"}})})})});Nn.displayName=St;var An="PopperArrow",ms={top:"bottom",right:"left",bottom:"top",left:"right"},_n=i.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,s=ps(An,r),a=ms[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(ds,{...o,ref:n,style:{...o.style,display:"block"}})})});_n.displayName=An;function vs(t){return t!==null}var ys=t=>({name:"transformOrigin",options:t,fn(e){var v,y,w;const{placement:n,rects:r,middlewareData:o}=e,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,c=a?0:t.arrowWidth,d=a?0:t.arrowHeight,[l,f]=jn(n),h={start:"0%",center:"50%",end:"100%"}[f],g=(((y=o.arrow)==null?void 0:y.x)??0)+c/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+d/2;let C="",p="";return l==="bottom"?(C=a?h:`${g}px`,p=`${-d}px`):l==="top"?(C=a?h:`${g}px`,p=`${r.floating.height+d}px`):l==="right"?(C=`${-d}px`,p=a?h:`${m}px`):l==="left"&&(C=`${r.floating.width+d}px`,p=a?h:`${m}px`),{data:{x:C,y:p}}}});function jn(t){const[e,n="center"]=t.split("-");return[e,n]}var Cs=Pn,xs=Mn,Ss=Nn,bs=_n,ws="Portal",Fn=i.forwardRef((t,e)=>{var c;const{container:n,...r}=t,[o,s]=i.useState(!1);se(()=>s(!0),[]);const a=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Qr.createPortal(u.jsx(B.div,{...r,ref:e}),a):null});Fn.displayName=ws;function Es(t,e){return i.useReducer((n,r)=>e[n][r]??n,t)}var Oe=t=>{const{present:e,children:n}=t,r=Ds(e),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),s=$(r.ref,Ts(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:s}):null};Oe.displayName="Presence";function Ds(t){const[e,n]=i.useState(),r=i.useRef(null),o=i.useRef(t),s=i.useRef("none"),a=t?"mounted":"unmounted",[c,d]=Es(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const l=Ae(r.current);s.current=c==="mounted"?l:"none"},[c]),se(()=>{const l=r.current,f=o.current;if(f!==t){const g=s.current,m=Ae(l);t?d("MOUNT"):m==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(f&&g!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),se(()=>{if(e){let l;const f=e.ownerDocument.defaultView??window,h=m=>{const p=Ae(r.current).includes(m.animationName);if(m.target===e&&p&&(d("ANIMATION_END"),!o.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",l=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},g=m=>{m.target===e&&(s.current=Ae(r.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(l),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Ae(t){return(t==null?void 0:t.animationName)||"none"}function Ts(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Os=gn[" useInsertionEffect ".trim().toString()]||se;function Is({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,s,a]=Ps({defaultProp:e,onChange:n}),c=t!==void 0,d=c?t:o;{const f=i.useRef(t!==void 0);i.useEffect(()=>{const h=f.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const l=i.useCallback(f=>{var h;if(c){const g=Rs(f)?f(t):f;g!==t&&((h=a.current)==null||h.call(a,g))}else s(f)},[c,t,s,a]);return[d,l]}function Ps({defaultProp:t,onChange:e}){const[n,r]=i.useState(t),o=i.useRef(n),s=i.useRef(e);return Os(()=>{s.current=e},[e]),i.useEffect(()=>{var a;o.current!==n&&((a=s.current)==null||a.call(s,n),o.current=n)},[n,o]),[n,r,s]}function Rs(t){return typeof t=="function"}var nt="rovingFocusGroup.onEntryFocus",Ms={bubbles:!1,cancelable:!0},Ie="RovingFocusGroup",[ft,Ln,Ns]=yn(Ie),[As,kn]=Te(Ie,[Ns]),[_s,js]=As(Ie),Un=i.forwardRef((t,e)=>u.jsx(ft.Provider,{scope:t.__scopeRovingFocusGroup,children:u.jsx(ft.Slot,{scope:t.__scopeRovingFocusGroup,children:u.jsx(Fs,{...t,ref:e})})}));Un.displayName=Ie;var Fs=i.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...h}=t,g=i.useRef(null),m=$(e,g),C=Cn(s),[p,v]=Is({prop:a,defaultProp:c??null,onChange:d,caller:Ie}),[y,w]=i.useState(!1),b=J(l),E=Ln(n),I=i.useRef(!1),[R,T]=i.useState(0);return i.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(nt,b),()=>M.removeEventListener(nt,b)},[b]),u.jsx(_s,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:p,onItemFocus:i.useCallback(M=>v(M),[v]),onItemShiftTab:i.useCallback(()=>w(!0),[]),onFocusableItemAdd:i.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:i.useCallback(()=>T(M=>M-1),[]),children:u.jsx(B.div,{tabIndex:y||R===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:P(t.onMouseDown,()=>{I.current=!0}),onFocus:P(t.onFocus,M=>{const _=!I.current;if(M.target===M.currentTarget&&_&&!y){const F=new CustomEvent(nt,Ms);if(M.currentTarget.dispatchEvent(F),!F.defaultPrevented){const D=E().filter(V=>V.focusable),A=D.find(V=>V.active),K=D.find(V=>V.id===p),te=[A,K,...D].filter(Boolean).map(V=>V.ref.current);Bn(te,f)}}I.current=!1}),onBlur:P(t.onBlur,()=>w(!1))})})}),Hn="RovingFocusGroupItem",$n=i.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...c}=t,d=us(),l=s||d,f=js(Hn,n),h=f.currentTabStopId===l,g=Ln(n),{onFocusableItemAdd:m,onFocusableItemRemove:C,currentTabStopId:p}=f;return i.useEffect(()=>{if(r)return m(),()=>C()},[r,m,C]),u.jsx(ft.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:u.jsx(B.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:e,onMouseDown:P(t.onMouseDown,v=>{r?f.onItemFocus(l):v.preventDefault()}),onFocus:P(t.onFocus,()=>f.onItemFocus(l)),onKeyDown:P(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=Us(v,f.orientation,f.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=g().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")b.reverse();else if(y==="prev"||y==="next"){y==="prev"&&b.reverse();const E=b.indexOf(v.currentTarget);b=f.loop?Hs(b,E+1):b.slice(E+1)}setTimeout(()=>Bn(b))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:p!=null}):a})})});$n.displayName=Hn;var Ls={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ks(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Us(t,e,n){const r=ks(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ls[r]}function Bn(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Hs(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var $s=Un,Bs=$n,Gn=Co(),rt=function(){},Ke=i.forwardRef(function(t,e){var n=i.useRef(null),r=i.useState({onScrollCapture:rt,onWheelCapture:rt,onTouchMoveCapture:rt}),o=r[0],s=r[1],a=t.forwardProps,c=t.children,d=t.className,l=t.removeScrollBar,f=t.enabled,h=t.shards,g=t.sideCar,m=t.noIsolation,C=t.inert,p=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,w=t.gapMode,b=Jr(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,I=xo([n,e]),R=pe(pe({},b),o);return i.createElement(i.Fragment,null,f&&i.createElement(E,{sideCar:Gn,removeScrollBar:l,shards:h,noIsolation:m,inert:C,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:w}),a?i.cloneElement(i.Children.only(c),pe(pe({},R),{ref:I})):i.createElement(y,pe({},R,{className:d,ref:I}),c))});Ke.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ke.classNames={fullWidth:bo,zeroRight:So};var gt=!1;if(typeof window<"u")try{var _e=Object.defineProperty({},"passive",{get:function(){return gt=!0,!0}});window.addEventListener("test",_e,_e),window.removeEventListener("test",_e,_e)}catch{gt=!1}var fe=gt?{passive:!1}:!1,Gs=function(t){return t.tagName==="TEXTAREA"},Kn=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Gs(t)&&n[e]==="visible")},Ks=function(t){return Kn(t,"overflowY")},Ws=function(t){return Kn(t,"overflowX")},Yt=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Wn(t,r);if(o){var s=Vn(t,r),a=s[1],c=s[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vs=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Ys=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Wn=function(t,e){return t==="v"?Ks(e):Ws(e)},Vn=function(t,e){return t==="v"?Vs(e):Ys(e)},Xs=function(t,e){return t==="h"&&e==="rtl"?-1:1},zs=function(t,e,n,r,o){var s=Xs(t,window.getComputedStyle(e).direction),a=s*r,c=n.target,d=e.contains(c),l=!1,f=a>0,h=0,g=0;do{var m=Vn(t,c),C=m[0],p=m[1],v=m[2],y=p-v-s*C;(C||y)&&Wn(t,c)&&(h+=y,g+=C),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!d&&c!==document.body||d&&(e.contains(c)||e===c));return(f&&Math.abs(h)<1||!f&&Math.abs(g)<1)&&(l=!0),l},je=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Xt=function(t){return[t.deltaX,t.deltaY]},zt=function(t){return t&&"current"in t?t.current:t},qs=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Zs=function(t){return`
|
|
2
2
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
3
3
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
4
|
-
`)},Qs=0,ge=[];function Js(t){var e=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(Qs++)[0],s=i.useState(wo)[0],a=i.useRef(t);i.useEffect(function(){a.current=t},[t]),i.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var p=eo([t.lockRef.current],(t.shards||[]).map(qt),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var c=i.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var y=je(p),w=n.current,b="deltaX"in p?p.deltaX:w[0]-y[0],E="deltaY"in p?p.deltaY:w[1]-y[1],I,R=p.target,T=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in p&&T==="h"&&R.type==="range")return!1;var M=Xt(T,R);if(!M)return!0;if(M?I=T:(I=T==="v"?"h":"v",M=Xt(T,R)),!M)return!1;if(!r.current&&"changedTouches"in p&&(b||E)&&(r.current=I),!I)return!0;var _=r.current||I;return zs(_,v,p,_==="h"?b:E)},[]),d=i.useCallback(function(p){var v=p;if(!(!ge.length||ge[ge.length-1]!==s)){var y="deltaY"in v?zt(v):je(v),w=e.current.filter(function(I){return I.name===v.type&&(I.target===v.target||v.target===I.shadowParent)&&qs(I.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(a.current.shards||[]).map(qt).filter(Boolean).filter(function(I){return I.contains(v.target)}),E=b.length>0?c(v,b[0]):!a.current.noIsolation;E&&v.cancelable&&v.preventDefault()}}},[]),l=i.useCallback(function(p,v,y,w){var b={name:p,delta:v,target:y,should:w,shadowParent:ei(y)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(E){return E!==b})},1)},[]),f=i.useCallback(function(p){n.current=je(p),r.current=void 0},[]),h=i.useCallback(function(p){l(p.type,zt(p),p.target,c(p,t.lockRef.current))},[]),g=i.useCallback(function(p){l(p.type,je(p),p.target,c(p,t.lockRef.current))},[]);i.useEffect(function(){return ge.push(s),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",d,fe),document.addEventListener("touchmove",d,fe),document.addEventListener("touchstart",f,fe),function(){ge=ge.filter(function(p){return p!==s}),document.removeEventListener("wheel",d,fe),document.removeEventListener("touchmove",d,fe),document.removeEventListener("touchstart",f,fe)}},[]);var m=t.removeScrollBar,C=t.inert;return i.createElement(i.Fragment,null,C?i.createElement(s,{styles:Zs(o)}):null,m?i.createElement(Eo,{gapMode:t.gapMode}):null)}function ei(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ti=Do(Gn,Js);var Yn=i.forwardRef(function(t,e){return i.createElement(Ke,pe({},t,{ref:e,sideCar:ti}))});Yn.classNames=Ke.classNames;var ht=["Enter"," "],ni=["ArrowDown","PageUp","Home"],Xn=["ArrowUp","PageDown","End"],ri=[...ni,...Xn],oi={ltr:[...ht,"ArrowRight"],rtl:[...ht,"ArrowLeft"]},si={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pe="Menu",[we,ii,ai]=yn(Pe),[ue,zn]=Te(Pe,[ai,On,kn]),We=On(),qn=kn(),[ci,le]=ue(Pe),[ui,Re]=ue(Pe),Zn=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=t,c=We(e),[d,l]=i.useState(null),f=i.useRef(!1),h=J(s),g=Cn(o);return i.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),u.jsx(Cs,{...c,children:u.jsx(ci,{scope:e,open:n,onOpenChange:h,content:d,onContentChange:l,children:u.jsx(ui,{scope:e,onClose:i.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:g,modal:a,children:r})})})};Zn.displayName=Pe;var li="MenuAnchor",wt=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=We(n);return u.jsx(xs,{...o,...r,ref:e})});wt.displayName=li;var Et="MenuPortal",[di,Qn]=ue(Et,{forceMount:void 0}),Jn=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=le(Et,e);return u.jsx(di,{scope:e,forceMount:n,children:u.jsx(Oe,{present:n||s.open,children:u.jsx(Fn,{asChild:!0,container:o,children:r})})})};Jn.displayName=Et;var Z="MenuContent",[fi,Dt]=ue(Z),er=i.forwardRef((t,e)=>{const n=Qn(Z,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,s=le(Z,t.__scopeMenu),a=Re(Z,t.__scopeMenu);return u.jsx(we.Provider,{scope:t.__scopeMenu,children:u.jsx(Oe,{present:r||s.open,children:u.jsx(we.Slot,{scope:t.__scopeMenu,children:a.modal?u.jsx(gi,{...o,ref:e}):u.jsx(hi,{...o,ref:e})})})})}),gi=i.forwardRef((t,e)=>{const n=le(Z,t.__scopeMenu),r=i.useRef(null),o=W(e,r);return i.useEffect(()=>{const s=r.current;if(s)return To(s)},[]),u.jsx(Tt,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hi=i.forwardRef((t,e)=>{const n=le(Z,t.__scopeMenu);return u.jsx(Tt,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pi=He("MenuContent.ScrollLock"),Tt=i.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,disableOutsideScroll:C,...p}=t,v=le(Z,n),y=Re(Z,n),w=We(n),b=qn(n),E=ii(n),[I,R]=i.useState(null),T=i.useRef(null),M=W(e,T,v.onContentChange),_=i.useRef(0),F=i.useRef(""),D=i.useRef(0),A=i.useRef(null),G=i.useRef("right"),ee=i.useRef(0),te=C?Yn:i.Fragment,V=C?{as:pi,allowPinchZoom:!0}:void 0,U=x=>{var ne,ye;const N=F.current+x,j=E().filter(Y=>!Y.disabled),H=document.activeElement,me=(ne=j.find(Y=>Y.ref.current===H))==null?void 0:ne.textValue,ve=j.map(Y=>Y.textValue),Me=Oi(ve,N,me),ie=(ye=j.find(Y=>Y.textValue===Me))==null?void 0:ye.ref.current;(function Y(Ce){F.current=Ce,window.clearTimeout(_.current),Ce!==""&&(_.current=window.setTimeout(()=>Y(""),1e3))})(N),ie&&setTimeout(()=>ie.focus())};i.useEffect(()=>()=>window.clearTimeout(_.current),[]),Jo();const S=i.useCallback(x=>{var j,H;return G.current===((j=A.current)==null?void 0:j.side)&&Pi(x,(H=A.current)==null?void 0:H.area)},[]);return u.jsx(fi,{scope:n,searchRef:F,onItemEnter:i.useCallback(x=>{S(x)&&x.preventDefault()},[S]),onItemLeave:i.useCallback(x=>{var N;S(x)||((N=T.current)==null||N.focus(),R(null))},[S]),onTriggerLeave:i.useCallback(x=>{S(x)&&x.preventDefault()},[S]),pointerGraceTimerRef:D,onPointerGraceIntentChange:i.useCallback(x=>{A.current=x},[]),children:u.jsx(te,{...V,children:u.jsx(wn,{asChild:!0,trapped:o,onMountAutoFocus:P(s,x=>{var N;x.preventDefault(),(N=T.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(Sn,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,children:u.jsx($s,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:I,onCurrentTabStopIdChange:R,onEntryFocus:P(d,x=>{y.isUsingKeyboardRef.current||x.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(Ss,{role:"menu","aria-orientation":"vertical","data-state":mr(v.open),"data-radix-menu-content":"",dir:y.dir,...w,...p,ref:M,style:{outline:"none",...p.style},onKeyDown:P(p.onKeyDown,x=>{const j=x.target.closest("[data-radix-menu-content]")===x.currentTarget,H=x.ctrlKey||x.altKey||x.metaKey,me=x.key.length===1;j&&(x.key==="Tab"&&x.preventDefault(),!H&&me&&U(x.key));const ve=T.current;if(x.target!==ve||!ri.includes(x.key))return;x.preventDefault();const ie=E().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);Xn.includes(x.key)&&ie.reverse(),Di(ie)}),onBlur:P(t.onBlur,x=>{x.currentTarget.contains(x.target)||(window.clearTimeout(_.current),F.current="")}),onPointerMove:P(t.onPointerMove,Ee(x=>{const N=x.target,j=ee.current!==x.clientX;if(x.currentTarget.contains(N)&&j){const H=x.clientX>ee.current?"right":"left";G.current=H,ee.current=x.clientX}}))})})})})})})});er.displayName=Z;var mi="MenuGroup",Ot=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx($.div,{role:"group",...r,ref:e})});Ot.displayName=mi;var vi="MenuLabel",tr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx($.div,{...r,ref:e})});tr.displayName=vi;var $e="MenuItem",Zt="menu.itemSelect",Ve=i.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,s=i.useRef(null),a=Re($e,t.__scopeMenu),c=Dt($e,t.__scopeMenu),d=W(e,s),l=i.useRef(!1),f=()=>{const h=s.current;if(!n&&h){const g=new CustomEvent(Zt,{bubbles:!0,cancelable:!0});h.addEventListener(Zt,m=>r==null?void 0:r(m),{once:!0}),vn(h,g),g.defaultPrevented?l.current=!1:a.onClose()}};return u.jsx(nr,{...o,ref:d,disabled:n,onClick:P(t.onClick,f),onPointerDown:h=>{var g;(g=t.onPointerDown)==null||g.call(t,h),l.current=!0},onPointerUp:P(t.onPointerUp,h=>{var g;l.current||(g=h.currentTarget)==null||g.click()}),onKeyDown:P(t.onKeyDown,h=>{const g=c.searchRef.current!=="";n||g&&h.key===" "||ht.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Ve.displayName=$e;var nr=i.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=t,a=Dt($e,n),c=qn(n),d=i.useRef(null),l=W(e,d),[f,h]=i.useState(!1),[g,m]=i.useState("");return i.useEffect(()=>{const C=d.current;C&&m((C.textContent??"").trim())},[s.children]),u.jsx(we.ItemSlot,{scope:n,disabled:r,textValue:o??g,children:u.jsx(Bs,{asChild:!0,...c,focusable:!r,children:u.jsx($.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:P(t.onPointerMove,Ee(C=>{r?a.onItemLeave(C):(a.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:P(t.onPointerLeave,Ee(C=>a.onItemLeave(C))),onFocus:P(t.onFocus,()=>h(!0)),onBlur:P(t.onBlur,()=>h(!1))})})})}),yi="MenuCheckboxItem",rr=i.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return u.jsx(cr,{scope:t.__scopeMenu,checked:n,children:u.jsx(Ve,{role:"menuitemcheckbox","aria-checked":Be(n)?"mixed":n,...o,ref:e,"data-state":Pt(n),onSelect:P(o.onSelect,()=>r==null?void 0:r(Be(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rr.displayName=yi;var or="MenuRadioGroup",[Ci,xi]=ue(or,{value:void 0,onValueChange:()=>{}}),sr=i.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,s=J(r);return u.jsx(Ci,{scope:t.__scopeMenu,value:n,onValueChange:s,children:u.jsx(Ot,{...o,ref:e})})});sr.displayName=or;var ir="MenuRadioItem",ar=i.forwardRef((t,e)=>{const{value:n,...r}=t,o=xi(ir,t.__scopeMenu),s=n===o.value;return u.jsx(cr,{scope:t.__scopeMenu,checked:s,children:u.jsx(Ve,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":Pt(s),onSelect:P(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});ar.displayName=ir;var It="MenuItemIndicator",[cr,Si]=ue(It,{checked:!1}),ur=i.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,s=Si(It,n);return u.jsx(Oe,{present:r||Be(s.checked)||s.checked===!0,children:u.jsx($.span,{...o,ref:e,"data-state":Pt(s.checked)})})});ur.displayName=It;var bi="MenuSeparator",lr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx($.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});lr.displayName=bi;var wi="MenuArrow",dr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=We(n);return u.jsx(bs,{...o,...r,ref:e})});dr.displayName=wi;var Ei="MenuSub",[zu,fr]=ue(Ei),Se="MenuSubTrigger",gr=i.forwardRef((t,e)=>{const n=le(Se,t.__scopeMenu),r=Re(Se,t.__scopeMenu),o=fr(Se,t.__scopeMenu),s=Dt(Se,t.__scopeMenu),a=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,l={__scopeMenu:t.__scopeMenu},f=i.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return i.useEffect(()=>f,[f]),i.useEffect(()=>{const h=c.current;return()=>{window.clearTimeout(h),d(null)}},[c,d]),u.jsx(wt,{asChild:!0,...l,children:u.jsx(nr,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":mr(n.open),...t,ref:xt(e,o.onTriggerChange),onClick:h=>{var g;(g=t.onClick)==null||g.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:P(t.onPointerMove,Ee(h=>{s.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:P(t.onPointerLeave,Ee(h=>{var m,C;f();const g=(m=n.content)==null?void 0:m.getBoundingClientRect();if(g){const p=(C=n.content)==null?void 0:C.dataset.side,v=p==="right",y=v?-5:5,w=g[v?"left":"right"],b=g[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+y,y:h.clientY},{x:w,y:g.top},{x:b,y:g.top},{x:b,y:g.bottom},{x:w,y:g.bottom}],side:p}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:P(t.onKeyDown,h=>{var m;const g=s.searchRef.current!=="";t.disabled||g&&h.key===" "||oi[r.dir].includes(h.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),h.preventDefault())})})})});gr.displayName=Se;var hr="MenuSubContent",pr=i.forwardRef((t,e)=>{const n=Qn(Z,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,s=le(Z,t.__scopeMenu),a=Re(Z,t.__scopeMenu),c=fr(hr,t.__scopeMenu),d=i.useRef(null),l=W(e,d);return u.jsx(we.Provider,{scope:t.__scopeMenu,children:u.jsx(Oe,{present:r||s.open,children:u.jsx(we.Slot,{scope:t.__scopeMenu,children:u.jsx(Tt,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;a.isUsingKeyboardRef.current&&((h=d.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:P(t.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:P(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:P(t.onKeyDown,f=>{var m;const h=f.currentTarget.contains(f.target),g=si[a.dir].includes(f.key);h&&g&&(s.onOpenChange(!1),(m=c.trigger)==null||m.focus(),f.preventDefault())})})})})})});pr.displayName=hr;function mr(t){return t?"open":"closed"}function Be(t){return t==="indeterminate"}function Pt(t){return Be(t)?"indeterminate":t?"checked":"unchecked"}function Di(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Ti(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Oi(t,e,n){const o=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let a=Ti(t,Math.max(s,0));o.length===1&&(a=a.filter(l=>l!==n));const d=a.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function Ii(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const c=e[s],d=e[a],l=c.x,f=c.y,h=d.x,g=d.y;f>r!=g>r&&n<(h-l)*(r-f)/(g-f)+l&&(o=!o)}return o}function Pi(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Ii(n,e)}function Ee(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Ri=Zn,Mi=wt,Ni=Jn,Ai=er,_i=Ot,ji=tr,Fi=Ve,Li=rr,ki=sr,Ui=ar,Hi=ur,$i=lr,Bi=dr,Gi=gr,Ki=pr,Rt="ContextMenu",[Wi,qu]=Te(Rt,[zn]),B=zn(),[Vi,vr]=Wi(Rt),yr=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:s=!0}=t,[a,c]=i.useState(!1),d=B(e),l=J(r),f=i.useCallback(h=>{c(h),l(h)},[l]);return u.jsx(Vi,{scope:e,open:a,onOpenChange:f,modal:s,children:u.jsx(Ri,{...d,dir:o,open:a,onOpenChange:f,modal:s,children:n})})};yr.displayName=Rt;var Cr="ContextMenuTrigger",xr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,s=vr(Cr,n),a=B(n),c=i.useRef({x:0,y:0}),d=i.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),l=i.useRef(0),f=i.useCallback(()=>window.clearTimeout(l.current),[]),h=g=>{c.current={x:g.clientX,y:g.clientY},s.onOpenChange(!0)};return i.useEffect(()=>f,[f]),i.useEffect(()=>void(r&&f()),[r,f]),u.jsxs(u.Fragment,{children:[u.jsx(Mi,{...a,virtualRef:d}),u.jsx($.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:P(t.onContextMenu,g=>{f(),h(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:P(t.onPointerDown,Fe(g=>{f(),l.current=window.setTimeout(()=>h(g),700)})),onPointerMove:r?t.onPointerMove:P(t.onPointerMove,Fe(f)),onPointerCancel:r?t.onPointerCancel:P(t.onPointerCancel,Fe(f)),onPointerUp:r?t.onPointerUp:P(t.onPointerUp,Fe(f))})]})});xr.displayName=Cr;var Yi="ContextMenuPortal",Sr=t=>{const{__scopeContextMenu:e,...n}=t,r=B(e);return u.jsx(Ni,{...r,...n})};Sr.displayName=Yi;var br="ContextMenuContent",wr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=vr(br,n),s=B(n),a=i.useRef(!1);return u.jsx(Ai,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var d;(d=t.onCloseAutoFocus)==null||d.call(t,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var d;(d=t.onInteractOutside)==null||d.call(t,c),!c.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wr.displayName=br;var Xi="ContextMenuGroup",zi=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(_i,{...o,...r,ref:e})});zi.displayName=Xi;var qi="ContextMenuLabel",Zi=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(ji,{...o,...r,ref:e})});Zi.displayName=qi;var Qi="ContextMenuItem",Er=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(Fi,{...o,...r,ref:e})});Er.displayName=Qi;var Ji="ContextMenuCheckboxItem",ea=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(Li,{...o,...r,ref:e})});ea.displayName=Ji;var ta="ContextMenuRadioGroup",na=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(ki,{...o,...r,ref:e})});na.displayName=ta;var ra="ContextMenuRadioItem",oa=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(Ui,{...o,...r,ref:e})});oa.displayName=ra;var sa="ContextMenuItemIndicator",ia=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(Hi,{...o,...r,ref:e})});ia.displayName=sa;var aa="ContextMenuSeparator",Dr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx($i,{...o,...r,ref:e})});Dr.displayName=aa;var ca="ContextMenuArrow",ua=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(Bi,{...o,...r,ref:e})});ua.displayName=ca;var la="ContextMenuSubTrigger",da=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(Gi,{...o,...r,ref:e})});da.displayName=la;var fa="ContextMenuSubContent",ga=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=B(n);return u.jsx(Ki,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ga.displayName=fa;function Fe(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var ha=yr,pa=xr,ma=Sr,va=wr,Q=Er,Qt=Dr;const Tr=i.createContext({dragDropManager:void 0});function z(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Jt=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),en=function(){return Math.random().toString(36).substring(7).split("").join(".")},tn={INIT:"@@redux/INIT"+en(),REPLACE:"@@redux/REPLACE"+en()};function ya(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Or(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(z(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(z(1));return n(Or)(t,e)}if(typeof t!="function")throw new Error(z(2));var o=t,s=e,a=[],c=a,d=!1;function l(){c===a&&(c=a.slice())}function f(){if(d)throw new Error(z(3));return s}function h(p){if(typeof p!="function")throw new Error(z(4));if(d)throw new Error(z(5));var v=!0;return l(),c.push(p),function(){if(v){if(d)throw new Error(z(6));v=!1,l();var w=c.indexOf(p);c.splice(w,1),a=null}}}function g(p){if(!ya(p))throw new Error(z(7));if(typeof p.type>"u")throw new Error(z(8));if(d)throw new Error(z(9));try{d=!0,s=o(s,p)}finally{d=!1}for(var v=a=c,y=0;y<v.length;y++){var w=v[y];w()}return p}function m(p){if(typeof p!="function")throw new Error(z(10));o=p,g({type:tn.REPLACE})}function C(){var p,v=h;return p={subscribe:function(w){if(typeof w!="object"||w===null)throw new Error(z(11));function b(){w.next&&w.next(f())}b();var E=v(b);return{unsubscribe:E}}},p[Jt]=function(){return this},p}return g({type:tn.INIT}),r={dispatch:g,subscribe:h,getState:f,replaceReducer:m},r[Jt]=C,r}function O(t,e,...n){if(Ca()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let o=0;r=new Error(e.replace(/%s/g,function(){return n[o++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Ca(){return typeof process<"u"&&!0}function xa(t,e,n){return e.split(".").reduce((r,o)=>r&&r[o]?r[o]:n||null,t)}function Sa(t,e){return t.filter(n=>n!==e)}function Ir(t){return typeof t=="object"}function ba(t,e){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};t.forEach(r),e.forEach(r);const o=[];return n.forEach((s,a)=>{s===1&&o.push(a)}),o}function wa(t,e){return t.filter(n=>e.indexOf(n)>-1)}const Mt="dnd-core/INIT_COORDS",Ye="dnd-core/BEGIN_DRAG",Nt="dnd-core/PUBLISH_DRAG_SOURCE",Xe="dnd-core/HOVER",ze="dnd-core/DROP",qe="dnd-core/END_DRAG";function nn(t,e){return{type:Mt,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const Ea={type:Mt,payload:{clientOffset:null,sourceClientOffset:null}};function Da(t){return function(n=[],r={publishSource:!0}){const{publishSource:o=!0,clientOffset:s,getSourceClientOffset:a}=r,c=t.getMonitor(),d=t.getRegistry();t.dispatch(nn(s)),Ta(n,c,d);const l=Pa(n,c);if(l==null){t.dispatch(Ea);return}let f=null;if(s){if(!a)throw new Error("getSourceClientOffset must be defined");Oa(a),f=a(l)}t.dispatch(nn(s,f));const g=d.getSource(l).beginDrag(c,l);if(g==null)return;Ia(g),d.pinSource(l);const m=d.getSourceType(l);return{type:Ye,payload:{itemType:m,item:g,sourceId:l,clientOffset:s||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}function Ta(t,e,n){O(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){O(n.getSource(r),"Expected sourceIds to be registered.")})}function Oa(t){O(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ia(t){O(Ir(t),"Item must be an object.")}function Pa(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function Ra(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ma(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Ra(t,o,n[o])})}return t}function Na(t){return function(n={}){const r=t.getMonitor(),o=t.getRegistry();Aa(r),Fa(r).forEach((a,c)=>{const d=_a(a,c,o,r),l={type:ze,payload:{dropResult:Ma({},n,d)}};t.dispatch(l)})}}function Aa(t){O(t.isDragging(),"Cannot call drop while not dragging."),O(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function _a(t,e,n,r){const o=n.getTarget(t);let s=o?o.drop(r,t):void 0;return ja(s),typeof s>"u"&&(s=e===0?{}:r.getDropResult()),s}function ja(t){O(typeof t>"u"||Ir(t),"Drop result must either be an object or undefined.")}function Fa(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function La(t){return function(){const n=t.getMonitor(),r=t.getRegistry();ka(n);const o=n.getSourceId();return o!=null&&(r.getSource(o,!0).endDrag(n,o),r.unpinSource()),{type:qe}}}function ka(t){O(t.isDragging(),"Cannot call endDrag while not dragging.")}function pt(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function Ua(t){return function(n,{clientOffset:r}={}){Ha(n);const o=n.slice(0),s=t.getMonitor(),a=t.getRegistry(),c=s.getItemType();return Ba(o,a,c),$a(o,s,a),Ga(o,s,a),{type:Xe,payload:{targetIds:o,clientOffset:r||null}}}}function Ha(t){O(Array.isArray(t),"Expected targetIds to be an array.")}function $a(t,e,n){O(e.isDragging(),"Cannot call hover while not dragging."),O(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const o=t[r];O(t.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(o);O(s,"Expected targetIds to be registered.")}}function Ba(t,e,n){for(let r=t.length-1;r>=0;r--){const o=t[r],s=e.getTargetType(o);pt(s,n)||t.splice(r,1)}}function Ga(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function Ka(t){return function(){if(t.getMonitor().isDragging())return{type:Nt}}}function Wa(t){return{beginDrag:Da(t),publishDragSource:Ka(t),hover:Ua(t),drop:Na(t),endDrag:La(t)}}class Va{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(s){return(...a)=>{const c=s.apply(e,a);typeof c<"u"&&n(c)}}const o=Wa(this);return Object.keys(o).reduce((s,a)=>{const c=o[a];return s[a]=r(c),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function Ya(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Pr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Xa(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:Pr(Ya(e,r),n)}function za(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:Pr(e,n)}const be=[],At=[];be.__IS_NONE__=!0;At.__IS_ALL__=!0;function qa(t,e){return t===be?!1:t===At||typeof e>"u"?!0:wa(e,t).length>0}class Za{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;O(typeof e=="function","listener must be a function."),O(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let o=this.store.getState().stateId;const s=()=>{const a=this.store.getState(),c=a.stateId;try{c===o||c===o+1&&!qa(a.dirtyHandlerIds,r)||e()}finally{o=c}};return this.store.subscribe(s)}subscribeToOffsetChange(e){O(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const o=this.store.getState().dragOffset;o!==n&&(n=o,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return O(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(O(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();return pt(r,o)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(O(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),o=this.getItemType();return r!==o?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const o=this.registry.getTargetType(e),s=this.getItemType();if(s&&!pt(o,s))return!1;const a=this.getTargetIds();if(!a.length)return!1;const c=a.indexOf(e);return r?c===a.length-1:c>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xa(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return za(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const rn=typeof global<"u"?global:self,Rr=rn.MutationObserver||rn.WebKitMutationObserver;function Mr(t){return function(){const n=setTimeout(o,0),r=setInterval(o,50);function o(){clearTimeout(n),clearInterval(r),t()}}}function Qa(t){let e=1;const n=new Rr(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Ja=typeof Rr=="function"?Qa:Mr;class ec{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,o=e.length-this.index;r<o;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Ja(this.flush),this.requestErrorThrow=Mr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class tc{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class nc{create(e){const n=this.freeTasks,r=n.length?n.pop():new tc(this.onError,o=>n[n.length]=o);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Nr=new ec,rc=new nc(Nr.registerPendingError);function oc(t){Nr.enqueueTask(rc.create(t))}const _t="dnd-core/ADD_SOURCE",jt="dnd-core/ADD_TARGET",Ft="dnd-core/REMOVE_SOURCE",Ze="dnd-core/REMOVE_TARGET";function sc(t){return{type:_t,payload:{sourceId:t}}}function ic(t){return{type:jt,payload:{targetId:t}}}function ac(t){return{type:Ft,payload:{sourceId:t}}}function cc(t){return{type:Ze,payload:{targetId:t}}}function uc(t){O(typeof t.canDrag=="function","Expected canDrag to be a function."),O(typeof t.beginDrag=="function","Expected beginDrag to be a function."),O(typeof t.endDrag=="function","Expected endDrag to be a function.")}function lc(t){O(typeof t.canDrop=="function","Expected canDrop to be a function."),O(typeof t.hover=="function","Expected hover to be a function."),O(typeof t.drop=="function","Expected beginDrag to be a function.")}function mt(t,e){if(e&&Array.isArray(t)){t.forEach(n=>mt(n,!1));return}O(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var q;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(q||(q={}));let dc=0;function fc(){return dc++}function gc(t){const e=fc().toString();switch(t){case q.SOURCE:return`S${e}`;case q.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function on(t){switch(t[0]){case"S":return q.SOURCE;case"T":return q.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function sn(t,e){const n=t.entries();let r=!1;do{const{done:o,value:[,s]}=n.next();if(s===e)return!0;r=!!o}while(!r);return!1}class hc{addSource(e,n){mt(e),uc(n);const r=this.addHandler(q.SOURCE,e,n);return this.store.dispatch(sc(r)),r}addTarget(e,n){mt(e,!0),lc(n);const r=this.addHandler(q.TARGET,e,n);return this.store.dispatch(ic(r)),r}containsHandler(e){return sn(this.dragSources,e)||sn(this.dropTargets,e)}getSource(e,n=!1){return O(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return O(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return O(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return O(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return on(e)===q.SOURCE}isTargetId(e){return on(e)===q.TARGET}removeSource(e){O(this.getSource(e),"Expected an existing source."),this.store.dispatch(ac(e)),oc(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){O(this.getTarget(e),"Expected an existing target."),this.store.dispatch(cc(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);O(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){O(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const o=gc(e);return this.types.set(o,n),e===q.SOURCE?this.dragSources.set(o,r):e===q.TARGET&&this.dropTargets.set(o,r),o}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const pc=(t,e)=>t===e;function mc(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function vc(t,e,n=pc){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function yc(t=be,e){switch(e.type){case Xe:break;case _t:case jt:case Ze:case Ft:return be;case Ye:case Nt:case qe:case ze:default:return At}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,o=ba(n,r);if(!(o.length>0||!vc(n,r)))return be;const a=r[r.length-1],c=n[n.length-1];return a!==c&&(a&&o.push(a),c&&o.push(c)),o}function Cc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Cc(t,o,n[o])})}return t}const an={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Sc(t=an,e){const{payload:n}=e;switch(e.type){case Mt:case Ye:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Xe:return mc(t.clientOffset,n.clientOffset)?t:xc({},t,{clientOffset:n.clientOffset});case qe:case ze:return an;default:return t}}function bc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function he(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){bc(t,o,n[o])})}return t}const wc={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ec(t=wc,e){const{payload:n}=e;switch(e.type){case Ye:return he({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Nt:return he({},t,{isSourcePublic:!0});case Xe:return he({},t,{targetIds:n.targetIds});case Ze:return t.targetIds.indexOf(n.targetId)===-1?t:he({},t,{targetIds:Sa(t.targetIds,n.targetId)});case ze:return he({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case qe:return he({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Dc(t=0,e){switch(e.type){case _t:case jt:return t+1;case Ft:case Ze:return t-1;default:return t}}function Tc(t=0){return t+1}function Oc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ic(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Oc(t,o,n[o])})}return t}function Pc(t={},e){return{dirtyHandlerIds:yc(t.dirtyHandlerIds,{type:e.type,payload:Ic({},e.payload,{prevTargetIds:xa(t,"dragOperation.targetIds",[])})}),dragOffset:Sc(t.dragOffset,e),refCount:Dc(t.refCount,e),dragOperation:Ec(t.dragOperation,e),stateId:Tc(t.stateId)}}function Rc(t,e=void 0,n={},r=!1){const o=Mc(r),s=new Za(o,new hc(o)),a=new Va(o,s),c=t(a,e,n);return a.receiveBackend(c),a}function Mc(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Or(Pc,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function Nc(t,e){if(t==null)return{};var n=Ac(t,e),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(o=0;o<s.length;o++)r=s[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ac(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,s;for(s=0;s<r.length;s++)o=r[s],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}let cn=0;const Ue=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var _c=i.memo(function(e){var{children:n}=e,r=Nc(e,["children"]);const[o,s]=jc(r);return i.useEffect(()=>{if(s){const a=Ar();return++cn,()=>{--cn===0&&(a[Ue]=null)}}},[]),u.jsx(Tr.Provider,{value:o,children:n})});function jc(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=Fc(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function Fc(t,e=Ar(),n,r){const o=e;return o[Ue]||(o[Ue]={dragDropManager:Rc(t,e,n,r)}),o[Ue]}function Ar(){return typeof global<"u"?global:window}var ot,un;function Lc(){return un||(un=1,ot=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var a=s[o];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),ot}var kc=Lc();const Uc=to(kc),ae=typeof window<"u"?i.useLayoutEffect:i.useEffect;function _r(t,e,n){const[r,o]=i.useState(()=>e(t)),s=i.useCallback(()=>{const a=e(t);Uc(r,a)||(o(a),n&&n())},[r,t,n]);return ae(s),[r,s]}function Hc(t,e,n){const[r,o]=_r(t,e,n);return ae(function(){const a=t.getHandlerId();if(a!=null)return t.subscribeToStateChange(o,{handlerIds:[a]})},[t,o]),r}function jr(t,e,n){return Hc(e,t||(()=>({})),()=>n.reconnect())}function Fr(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),i.useMemo(()=>typeof t=="function"?t():t,n)}function $c(t){return i.useMemo(()=>t.hooks.dragSource(),[t])}function Bc(t){return i.useMemo(()=>t.hooks.dragPreview(),[t])}let st=!1,it=!1;class Gc{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){O(!st,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return st=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{st=!1}}isDragging(){if(!this.sourceId)return!1;O(!it,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return it=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{it=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let at=!1;class Kc{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;O(!at,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return at=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{at=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function Wc(t,e,n){const r=n.getRegistry(),o=r.addTarget(t,e);return[o,()=>r.removeTarget(o)]}function Vc(t,e,n){const r=n.getRegistry(),o=r.addSource(t,e);return[o,()=>r.removeSource(o)]}function vt(t,e,n,r){let o;if(o!==void 0)return!!o;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const s=Object.keys(t),a=Object.keys(e);if(s.length!==a.length)return!1;const c=Object.prototype.hasOwnProperty.bind(e);for(let d=0;d<s.length;d++){const l=s[d];if(!c(l))return!1;const f=t[l],h=e[l];if(o=void 0,o===!1||o===void 0&&f!==h)return!1}return!0}function yt(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Yc(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function Xc(t){return(e=null,n=null)=>{if(!i.isValidElement(e)){const s=e;return t(s,n),s}const r=e;return Yc(r),zc(r,n?s=>t(s,n):t)}}function Lr(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const o=Xc(r);e[n]=()=>o}}),e}function ln(t,e){typeof t=="function"?t(e):t.current=e}function zc(t,e){const n=t.ref;return O(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?i.cloneElement(t,{ref:r=>{ln(n,r),ln(e,r)}}):i.cloneElement(t,{ref:e})}class qc{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!vt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!vt(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Lr({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,yt(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,yt(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class Zc{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!vt(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Lr({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,yt(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function de(){const{dragDropManager:t}=i.useContext(Tr);return O(t!=null,"Expected drag drop context"),t}function Qc(t,e){const n=de(),r=i.useMemo(()=>new qc(n.getBackend()),[n]);return ae(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),ae(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function Jc(){const t=de();return i.useMemo(()=>new Gc(t),[t])}class eu{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,o=this.monitor,{isDragging:s}=r;return s?s(o):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:o}=e;o&&o(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function tu(t,e,n){const r=i.useMemo(()=>new eu(t,e,n),[e,n]);return i.useEffect(()=>{r.spec=t},[t]),r}function nu(t){return i.useMemo(()=>{const e=t.type;return O(e!=null,"spec.type must be defined"),e},[t])}function ru(t,e,n){const r=de(),o=tu(t,e,n),s=nu(t);ae(function(){if(s!=null){const[c,d]=Vc(s,o,r);return e.receiveHandlerId(c),n.receiveHandlerId(c),d}},[r,e,n,o,s])}function kr(t,e){const n=Fr(t,e);O(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=Jc(),o=Qc(n.options,n.previewOptions);return ru(n,r,o),[jr(n.collect,r,o),$c(o),Bc(o)]}function ou(t){const n=de().getMonitor(),[r,o]=_r(n,t);return i.useEffect(()=>n.subscribeToOffsetChange(o)),i.useEffect(()=>n.subscribeToStateChange(o)),r}function su(t){return i.useMemo(()=>t.hooks.dropTarget(),[t])}function iu(t){const e=de(),n=i.useMemo(()=>new Zc(e.getBackend()),[e]);return ae(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function au(){const t=de();return i.useMemo(()=>new Kc(t),[t])}function cu(t){const{accept:e}=t;return i.useMemo(()=>(O(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class uu{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function lu(t,e){const n=i.useMemo(()=>new uu(t,e),[e]);return i.useEffect(()=>{n.spec=t},[t]),n}function du(t,e,n){const r=de(),o=lu(t,e),s=cu(t);ae(function(){const[c,d]=Wc(s,o,r);return e.receiveHandlerId(c),n.receiveHandlerId(c),d},[r,e,o,n,s.map(a=>a.toString()).join("|")])}function fu(t,e){const n=Fr(t,e),r=au(),o=iu(n.options);return du(n,r,o),[jr(n.collect,r,o),su(o)]}function Ur(t){let e=null;return()=>(e==null&&(e=t()),e)}function gu(t,e){return t.filter(n=>n!==e)}function hu(t,e){const n=new Set,r=s=>n.add(s);t.forEach(r),e.forEach(r);const o=[];return n.forEach(s=>o.push(s)),o}class pu{enter(e){const n=this.entered.length,r=o=>this.isNodeInDocument(o)&&(!o.contains||o.contains(e));return this.entered=hu(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=gu(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class mu{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const o=this.config.exposeProperties[r];o!=null&&(n[r]={value:o(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Hr="__NATIVE_FILE__",$r="__NATIVE_URL__",Br="__NATIVE_TEXT__",Gr="__NATIVE_HTML__",dn=Object.freeze(Object.defineProperty({__proto__:null,FILE:Hr,HTML:Gr,TEXT:Br,URL:$r},Symbol.toStringTag,{value:"Module"}));function ct(t,e,n){const r=e.reduce((o,s)=>o||t.getData(s),"");return r??n}const Ct={[Hr]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[Gr]:{exposeProperties:{html:(t,e)=>ct(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[$r]:{exposeProperties:{urls:(t,e)=>ct(t,e,"").split(`
|
|
5
|
-
`),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Br]:{exposeProperties:{text:(t,e)=>ct(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function vu(t,e){const n=Ct[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new mu(n);return r.loadDataTransfer(e),r}function ut(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(Ct).filter(n=>{const r=Ct[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(o=>e.indexOf(o)>-1):!1})[0]||null}const yu=Ur(()=>/firefox/i.test(navigator.userAgent)),Kr=Ur(()=>!!window.safari);class fn{interpolate(e){const{xs:n,ys:r,c1s:o,c2s:s,c3s:a}=this;let c=n.length-1;if(e===n[c])return r[c];let d=0,l=a.length-1,f;for(;d<=l;){f=Math.floor(.5*(d+l));const m=n[f];if(m<e)d=f+1;else if(m>e)l=f-1;else return r[f]}c=Math.max(0,l);const h=e-n[c],g=h*h;return r[c]+o[c]*h+s[c]*g+a[c]*h*g}constructor(e,n){const{length:r}=e,o=[];for(let m=0;m<r;m++)o.push(m);o.sort((m,C)=>e[m]<e[C]?-1:1);const s=[],a=[];let c,d;for(let m=0;m<r-1;m++)c=e[m+1]-e[m],d=n[m+1]-n[m],s.push(c),a.push(d/c);const l=[a[0]];for(let m=0;m<s.length-1;m++){const C=a[m],p=a[m+1];if(C*p<=0)l.push(0);else{c=s[m];const v=s[m+1],y=c+v;l.push(3*y/((y+v)/C+(y+c)/p))}}l.push(a[a.length-1]);const f=[],h=[];let g;for(let m=0;m<l.length-1;m++){g=a[m];const C=l[m],p=1/s[m],v=C+l[m+1]-g-g;f.push((g-C-v)*p),h.push(v*p*p)}this.xs=e,this.ys=n,this.c1s=l,this.c2s=f,this.c3s=h}}const Cu=1;function Wr(t){const e=t.nodeType===Cu?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Le(t){return{x:t.clientX,y:t.clientY}}function xu(t){var e;return t.nodeName==="IMG"&&(yu()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function Su(t,e,n,r){let o=t?e.width:n,s=t?e.height:r;return Kr()&&t&&(s/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:s}}function bu(t,e,n,r,o){const s=xu(e),c=Wr(s?t:e),d={x:n.x-c.x,y:n.y-c.y},{offsetWidth:l,offsetHeight:f}=t,{anchorX:h,anchorY:g}=r,{dragPreviewWidth:m,dragPreviewHeight:C}=Su(s,e,l,f),p=()=>{let R=new fn([0,.5,1],[d.y,d.y/f*C,d.y+C-f]).interpolate(g);return Kr()&&s&&(R+=(window.devicePixelRatio-1)*C),R},v=()=>new fn([0,.5,1],[d.x,d.x/l*m,d.x+m-l]).interpolate(h),{offsetX:y,offsetY:w}=o,b=y===0||y,E=w===0||w;return{x:b?y:v(),y:E?w:p()}}class wu{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function Eu(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Eu(t,o,n[o])})}return t}class Du{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const o=a=>this.handleDragStart(a,e),s=a=>this.handleSelectStart(a);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=a=>this.handleDragEnter(a,e),o=a=>this.handleDragOver(a,e),s=a=>this.handleDrop(a,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",o),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",o),n.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return gn({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return gn({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(dn).some(n=>dn[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=vu(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=o=>{const s=this.sourceNodes.get(o);return s&&Wr(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=o=>!!(o&&this.document&&this.document.body&&this.document.body.contains(o)),this.endDragIfSourceWasRemovedFromDOM=()=>{const o=this.currentDragSourceNode;o==null||this.isNodeInDocument(o)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=o=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(o||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=o=>{if(o.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const a=Le(o);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:c}=o,d=ut(c);if(this.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){const f=this.monitor.getSourceId(),h=this.sourceNodes.get(f),g=this.sourcePreviewNodes.get(f)||h;if(g){const{anchorX:m,anchorY:C,offsetX:p,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),b=bu(h,g,a,{anchorX:m,anchorY:C},{offsetX:p,offsetY:v});c.setDragImage(g,b.x,b.y)}}try{c==null||c.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(o.target);const{captureDraggingState:l}=this.getCurrentSourcePreviewNodeOptions();l?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(d)this.beginDragNativeItem(d);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=o=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}if(!this.enterLeaveCounter.enter(o.target)||this.monitor.isDragging())return;const{dataTransfer:c}=o,d=ut(c);d&&this.beginDragNativeItem(d,c)},this.handleTopDragEnter=o=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=o.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Le(o)}),s.some(c=>this.monitor.canDropOnTarget(c))&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=o=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}},this.handleTopDragOver=o=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}this.altKeyPressed=o.altKey,this.lastClientOffset=Le(o),this.scheduleHover(s),(s||[]).some(c=>this.monitor.canDropOnTarget(c))?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=o=>{this.isDraggingNativeItem()&&o.preventDefault(),this.enterLeaveCounter.leave(o.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=o=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;o.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}else ut(o.dataTransfer)&&o.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=o=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Le(o)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=o=>{const s=o.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(o.preventDefault(),s.dragDrop()))},this.options=new wu(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new pu(this.isNodeInDocument)}}let ke;function Vr(){return ke||(ke=new Image,ke.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ke}const Tu=function(e,n,r){return new Du(e,n,r)};function ce({file:t,className:e,style:n}){const r=k(D=>D.selectedFile),o=k(D=>D.setSelectedFile),s=k(D=>D.activeRange),a=k(D=>D.setActiveRange),c=k(D=>D.inActiveRange),d=Qe(D=>D.addTab),l=Qe(D=>D.selectTab),f=Qe(D=>D.createTab),[h,g]=i.useState(!1),m=mn(()=>g(!0),{threshold:50,onFinish(){g(!1)},onCancel(){g(!1)}}),{setArtifactRename:C,renameArtifact:p,artifactRename:v,selectArtifactsInRange:y,removeArtifactWithConfirmation:w}=Ge(),[b,E]=i.useState(!1),[{isDragging:I},R,T]=kr(()=>({type:"artifact",item:t,end(){g(!1)},canDrag(){return v!==t&&h},collect(D){return{isDragging:D.isDragging()}}}),[t,v,h]);i.useEffect(()=>{T(Vr(),{captureDraggingState:!0})},[T]);function M(D){D.stopPropagation(),D.shiftKey&&D.preventDefault();let A=s;D.metaKey?(c(t)?A=A.filter(G=>G!==t):A.push(t),a(A)):D.shiftKey&&A.length>0?y(t):(A.length>0&&(A=[]),A.push(t),a(A),o(t))}function _(){const D=f(t);d(D),l(D)}const F=s.length>1&&c(t);return u.jsx("div",{...m,ref:R,children:u.jsxs(K.Container,{artifact:t,isSelected:r===t,className:L(v===t&&"bg-primary-10",b&&"bg-primary-10",h&&"bg-primary-10 !cursor-grabbing outline-2 !outline-primary-500",I&&"opacity-50",e),style:n,onDoubleClick:D=>{D.stopPropagation(),_()},handleSelect:M,children:[u.jsx(ce.Icons,{}),v===t?u.jsx(K.Rename,{artifact:v,rename:p,close:()=>C(void 0)}):u.jsxs(K.ContextMenu,{trigger:u.jsx(K.ContextMenuTrigger,{children:u.jsx(ce.Display,{file:t})}),onOpenChange:E,children:[r!==t&&u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",F?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:F,onClick:D=>{D.stopPropagation()},onSelect:D=>{D.stopPropagation(),_()},children:["Open in New Tab",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",F?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:F,onClick:D=>{D.stopPropagation()},onSelect:D=>{D.stopPropagation(),C(t)},children:["Rename",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-danger-500 hover:bg-danger-500 hover:text-light",onSelect:D=>{D.stopPropagation(),w(t)},children:["Remove ",c(t)?s.length:"",u.jsx("div",{className:"ml-auto pl-5"})]})]})]})})}function Ou({file:t}){return u.jsx("span",{title:t.name,className:L("inline-block overflow-hidden overflow-ellipsis py-[0.125rem]"),children:pn(t.name,50,20)})}function Iu(){return u.jsx("div",{className:"flex items-center",children:u.jsx(No,{className:"inline-block w-3 ml-1 mr-2"})})}ce.Display=Ou;ce.Icons=Iu;const De=function t({directory:e,className:n,style:r}){const o=k(S=>S.selectedFile),s=k(S=>S.activeRange),a=k(S=>S.setActiveRange),c=k(S=>S.inActiveRange),[d,l]=i.useState(e.isOpened),[f,h]=i.useState(!1),[g,m]=i.useState(!1),C=mn(()=>m(!0),{threshold:50,onFinish(){m(!1)},onCancel(){m(!1)}}),{setArtifactRename:p,renameArtifact:v,artifactRename:y,createDirectory:w,createFile:b,moveArtifacts:E,removeArtifactWithConfirmation:I,selectArtifactsInRange:R}=Ge(),[{isOver:T},M]=fu(()=>({accept:"artifact",drop(S,x){if(X(x.canDrop()))return;const N=c(S)?s:[S];E(N,e),e.open()},canDrop(S,x){const N=c(S)?s:[S];return x.isOver({shallow:!0})&&ro(N)&&N.reduce((j,H)=>!(X(j)||H.parent===e||H===e||H instanceof lt&&H.hasDirectory(e)),!0)},collect(S){return{isOver:S.isOver({shallow:!0})&&S.canDrop()}}}),[s]),[{isDragging:_},F,D]=kr(()=>({type:"artifact",item:e,end(){m(!1)},canDrag(){return y!==e&&g},collect(S){return{isDragging:S.isDragging()}}}),[e,y,g]),[A,G,ee,te]=i.useMemo(()=>{if(s.length<2)return[!1,!1,!1,!1];let S=!0,x=!0,N=!0;for(const j of Array.from(s))j instanceof lt&&S?(x&&(x=j.isOpened),N&&(N=j.isClosed)):S=!1;return[S,x,N,X(x)&&X(N)]},[s]);i.useEffect(()=>{e.syncStateOpen=l},[e]),i.useEffect(()=>{D(Vr(),{captureDraggingState:!0})},[D]),i.useEffect(()=>{no(o)||d||e.hasFile(o)&&e.open()},[o]);function V(S){S.stopPropagation(),S.shiftKey||S.metaKey?S.preventDefault():e.toggle();let x=s;S.metaKey?(c(e)?x=x.filter(N=>N!==e):x.push(e),a(x)):S.shiftKey&&x.length>0?R(e):(x.length>0&&(x=[]),x.push(e),a(x))}const U=s.length>1&&c(e);return u.jsx("div",{className:L("h-full",_&&"opacity-50"),children:u.jsxs("div",{ref:M,className:L(T&&X(_)&&"bg-primary-5"),children:[e.withParent&&u.jsx("div",{...C,ref:e.withParent?F:void 0,children:u.jsxs(K.Container,{artifact:e,className:L(y===e&&"bg-primary-10",g&&"bg-primary-10 !cursor-grabbing",f&&"bg-primary-10",n),style:r,handleSelect:V,children:[u.jsx(t.Icons,{isOpen:d||T&&X(_)}),y===e?u.jsx(K.Rename,{artifact:y,rename:v,close:()=>p(void 0)}):u.jsxs(K.ContextMenu,{trigger:u.jsx(K.ContextMenuTrigger,{children:u.jsx(t.Display,{directory:e})}),onOpenChange:h,children:[u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U&&X(A)?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U&&X(A),onSelect:S=>{S.stopPropagation(),s.length>1&&c(e)?s.forEach(x=>{G?x.collapse():ee?x.expand():te&&(x.isOpened?x.collapse():x.expand())}):e.isOpened?e.collapse():e.expand(),a([])},children:[A&&G&&"Collapse All",A&&ee&&"Expand All",A&&te&&"Toggle All",X(A)&&e.isOpened&&"Collapse",X(A)&&e.isClosed&&"Expand",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsx(Qt,{className:"h-[1px] bg-accent-200 m-2"}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onSelect:S=>{S.stopPropagation(),b(e)},children:["New File",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onSelect:S=>{S.stopPropagation(),w(e)},children:["New Folder",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsx(Qt,{className:"h-[1px] bg-accent-200 m-2"}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onClick:S=>{S.stopPropagation()},onSelect:S=>{S.stopPropagation(),p(e)},children:["Rename",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-danger-500 hover:bg-danger-500 hover:text-light",onSelect:S=>{S.stopPropagation(),I(e)},children:["Remove ",c(e)?s.length:"",u.jsx("div",{className:"ml-auto pl-5"})]})]})]})}),(T&&X(_)||d||!e.withParent)&&e.withDirectories&&u.jsx("ul",{className:L(c(e)&&"bg-primary-5"),children:e.directories.map(S=>u.jsx("li",{title:S.name,children:u.jsx(t,{directory:S,style:{paddingLeft:e.withParent?`${e.level/2+.25}rem`:0}},S.id)},S.id))}),(T&&X(_)||d||!e.withParent)&&e.withFiles&&u.jsx("ul",{className:L(c(e)&&"bg-primary-5"),children:e.files.map(S=>u.jsx("li",{title:S.name,children:u.jsx(ce,{file:S,style:{paddingLeft:e.withParent?`${e.level/2+.25}rem`:0}},S.id)},S.id))})]})})};function Pu({directory:t}){return u.jsxs("div",{className:"w-full flex justify-between items-center py-[0.125rem]",children:[u.jsx("span",{title:t.name,className:"overflow-hidden overflow-ellipsis whitespace-nowrap",children:pn(t.name,50,20)}),u.jsx("span",{className:"inline-block text-xs rounded-full px-2 bg-neutral-10 ml-2",children:t.directories.length+t.files.length})]})}function Ru({hasChevron:t=!0,hasFolder:e=!0,isOpen:n=!1,className:r}){const o=n?Po:Ro,s=n?_o:Fo;return u.jsxs("div",{className:L("flex items-center mr-2",r),children:[t&&u.jsx(o,{className:"inline-block w-5"}),e&&u.jsx(s,{className:"inline-block w-4 fill-primary-500"})]})}De.Icons=Ru;De.Display=Pu;const Mu={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"};function Nu(){const t=k(a=>a.activeRange),e=k(a=>a.inActiveRange),{isDragging:n,currentOffset:r,artifact:o}=ou(a=>({artifact:a.getItem(),isDragging:a.isDragging(),currentOffset:a.getSourceClientOffset()})),s=i.useMemo(()=>Array.from(e(o)?t:new Set([o])).filter(Boolean),[t,o]);return u.jsx(u.Fragment,{children:n&&u.jsx("div",{style:Mu,children:u.jsx("div",{style:Au(r),className:"!cursor-grabbing !rounded-lg overflow-hidden",children:s.map(a=>u.jsxs("span",{children:[a instanceof lt&&u.jsxs(K.Container,{artifact:a,className:"bg-theme",children:[u.jsx(De.Icons,{hasChevron:!1}),u.jsx(De.Display,{directory:a})]},a.path),a instanceof Oo&&u.jsxs(K.Container,{artifact:a,className:"bg-theme",children:[u.jsx(ce.Icons,{}),u.jsx(ce.Display,{file:a})]},a.path)]},a.id))})})})}function Au(t){if(t==null)return{display:"none"};const{x:e,y:n}=t;return{display:"inline-block",transform:`translate(${e}px, ${n}px)`,filter:"drop-shadow(0 2px 12px rgba(0,0,0,0.45))"}}const K=function t({className:e}){const n=k(g=>g.project),r=k(g=>g.setSelectedFile),o=k(g=>g.activeRange),s=k(g=>g.setActiveRange),a=oo(g=>g.addConfirmation),{isFetching:c}=so(),{removeArtifacts:d,createDirectory:l,createFile:f}=Ge();function h(g){g.key==="Escape"&&s([]),g.ctrlKey&&g.key==="Backspace"&&o.length>0&&a({headline:"Removing Selected Files/Directories",description:`Are you sure you want to remove ${o.length} items?`,yesText:"Yes, Remove",noText:"No, Cancel",details:Array.from(o).map(m=>m.path),action:()=>{d(o)}})}return u.jsx("div",{tabIndex:0,className:L("flex flex-col w-full h-full overflow-hidden text-sm text-neutral-500 dark:text-neutral-400 font-regular select-none",e),onKeyDown:h,children:c?u.jsx("div",{className:"flex justify-center items-center w-full h-full",children:u.jsxs(io,{className:"inline-block",children:[u.jsx(ao,{className:"w-3 h-3 border border-neutral-10 mr-2"}),u.jsx("h3",{className:"text-md",children:"Getting Project Files..."})]})}):u.jsxs(u.Fragment,{children:[u.jsx(Io,{list:n.allFiles,searchBy:"path",displayBy:"name",size:co.sm,onSelect:r,direction:"top",isFullWidth:!0}),u.jsxs(t.ContextMenu,{trigger:u.jsx(t.ContextMenuTrigger,{className:"h-full pb-1",children:u.jsx(_c,{backend:Tu,children:u.jsxs("div",{className:"w-full relative h-full px-1 overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical",children:[u.jsx(Nu,{}),u.jsx(De,{className:"z-20 relative",directory:n},n.id)]})})}),children:[u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 hover:bg-accent-500 hover:text-light",onSelect:g=>{g.stopPropagation(),f(n)},children:["New File",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 hover:bg-accent-500 hover:text-light",onSelect:g=>{g.stopPropagation(),l(n)},children:["New Folder",u.jsx("div",{className:"ml-auto pl-5"})]})]},n.id)]})})};function _u({trigger:t,children:e,onOpenChange:n}){return u.jsxs(ha,{onOpenChange:n,children:[t,u.jsx(ma,{children:u.jsx(va,{className:"bg-light rounded-md overflow-hidden shadow-lg py-2 px-1 z-50",onClick:r=>{r.stopPropagation()},children:e})})]})}function ju({children:t,className:e}){return u.jsx(pa,{className:L("flex w-full overflow-hidden",e),onContextMenu:n=>{n.stopPropagation()},children:t})}function Fu({artifact:t,rename:e,close:n}){const r=re.useRef(null),[o,s]=i.useState("");return i.useEffect(()=>{s(t.name),setTimeout(()=>{var a;(a=r.current)==null||a.focus()},100)},[t]),u.jsx("div",{className:"w-full flex items-center py-[0.125rem] pr-2",children:u.jsx("input",{ref:r,type:"text",className:"w-full overflow-hidden overflow-ellipsis bg-primary-900 text-primary-100",value:o,onInput:a=>{a.stopPropagation(),s(a.target.value)},onBlur:a=>{a.stopPropagation(),n()},onKeyDown:a=>{a.key==="Enter"&&(a.stopPropagation(),o.trim()!==""&&o!==t.name&&e(t,o),n()),a.key==="Escape"&&(a.stopPropagation(),n())}})})}function Lu({artifact:t,children:e,isSelected:n=!1,className:r,style:o,handleSelect:s,onDoubleClick:a}){const{setArtifactRename:c,isBottomGroupInActiveRange:d,isTopGroupInActiveRange:l,isMiddleGroupInActiveRange:f}=Ge(),h=k(m=>m.activeRange),g=k(m=>m.inActiveRange);return u.jsx("span",{tabIndex:0,className:L("w-full flex items-center group/file px-2",r,l(t)?"rounded-t-md":d(t)?"rounded-b-md":f(t)?"":g(t)&&"rounded-md",g(t)&&h.length>1&&h.indexOf(t)<h.length-1?"border-b border-primary-400":"border-b border-transparent",g(t)?"bg-primary-10 dark:bg-primary-20":n&&"rounded-md bg-neutral-10 text-neutral-600 dark:bg-dark-lighter dark:text-primary-500"),style:o,onClick:s,onDoubleClick:a,onKeyDown:m=>{m.key==="Enter"&&(m.stopPropagation(),c(t),s==null||s(m)),m.key===" "&&(m.stopPropagation(),s==null||s(m))},children:e})}K.ContextMenu=_u;K.ContextMenuTrigger=ju;K.Rename=Fu;K.Container=Lu;export{K as default};
|
|
4
|
+
`)},Qs=0,ge=[];function Js(t){var e=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(Qs++)[0],s=i.useState(wo)[0],a=i.useRef(t);i.useEffect(function(){a.current=t},[t]),i.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var p=eo([t.lockRef.current],(t.shards||[]).map(zt),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var c=i.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var y=je(p),w=n.current,b="deltaX"in p?p.deltaX:w[0]-y[0],E="deltaY"in p?p.deltaY:w[1]-y[1],I,R=p.target,T=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in p&&T==="h"&&R.type==="range")return!1;var M=Yt(T,R);if(!M)return!0;if(M?I=T:(I=T==="v"?"h":"v",M=Yt(T,R)),!M)return!1;if(!r.current&&"changedTouches"in p&&(b||E)&&(r.current=I),!I)return!0;var _=r.current||I;return zs(_,v,p,_==="h"?b:E)},[]),d=i.useCallback(function(p){var v=p;if(!(!ge.length||ge[ge.length-1]!==s)){var y="deltaY"in v?Xt(v):je(v),w=e.current.filter(function(I){return I.name===v.type&&(I.target===v.target||v.target===I.shadowParent)&&qs(I.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(a.current.shards||[]).map(zt).filter(Boolean).filter(function(I){return I.contains(v.target)}),E=b.length>0?c(v,b[0]):!a.current.noIsolation;E&&v.cancelable&&v.preventDefault()}}},[]),l=i.useCallback(function(p,v,y,w){var b={name:p,delta:v,target:y,should:w,shadowParent:ei(y)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(E){return E!==b})},1)},[]),f=i.useCallback(function(p){n.current=je(p),r.current=void 0},[]),h=i.useCallback(function(p){l(p.type,Xt(p),p.target,c(p,t.lockRef.current))},[]),g=i.useCallback(function(p){l(p.type,je(p),p.target,c(p,t.lockRef.current))},[]);i.useEffect(function(){return ge.push(s),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",d,fe),document.addEventListener("touchmove",d,fe),document.addEventListener("touchstart",f,fe),function(){ge=ge.filter(function(p){return p!==s}),document.removeEventListener("wheel",d,fe),document.removeEventListener("touchmove",d,fe),document.removeEventListener("touchstart",f,fe)}},[]);var m=t.removeScrollBar,C=t.inert;return i.createElement(i.Fragment,null,C?i.createElement(s,{styles:Zs(o)}):null,m?i.createElement(Eo,{gapMode:t.gapMode}):null)}function ei(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ti=Do(Gn,Js);var Yn=i.forwardRef(function(t,e){return i.createElement(Ke,pe({},t,{ref:e,sideCar:ti}))});Yn.classNames=Ke.classNames;var ht=["Enter"," "],ni=["ArrowDown","PageUp","Home"],Xn=["ArrowUp","PageDown","End"],ri=[...ni,...Xn],oi={ltr:[...ht,"ArrowRight"],rtl:[...ht,"ArrowLeft"]},si={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pe="Menu",[we,ii,ai]=yn(Pe),[ue,zn]=Te(Pe,[ai,On,kn]),We=On(),qn=kn(),[ci,le]=ue(Pe),[ui,Re]=ue(Pe),Zn=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=t,c=We(e),[d,l]=i.useState(null),f=i.useRef(!1),h=J(s),g=Cn(o);return i.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),u.jsx(Cs,{...c,children:u.jsx(ci,{scope:e,open:n,onOpenChange:h,content:d,onContentChange:l,children:u.jsx(ui,{scope:e,onClose:i.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:g,modal:a,children:r})})})};Zn.displayName=Pe;var li="MenuAnchor",bt=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=We(n);return u.jsx(xs,{...o,...r,ref:e})});bt.displayName=li;var wt="MenuPortal",[di,Qn]=ue(wt,{forceMount:void 0}),Jn=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=le(wt,e);return u.jsx(di,{scope:e,forceMount:n,children:u.jsx(Oe,{present:n||s.open,children:u.jsx(Fn,{asChild:!0,container:o,children:r})})})};Jn.displayName=wt;var Z="MenuContent",[fi,Et]=ue(Z),er=i.forwardRef((t,e)=>{const n=Qn(Z,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,s=le(Z,t.__scopeMenu),a=Re(Z,t.__scopeMenu);return u.jsx(we.Provider,{scope:t.__scopeMenu,children:u.jsx(Oe,{present:r||s.open,children:u.jsx(we.Slot,{scope:t.__scopeMenu,children:a.modal?u.jsx(gi,{...o,ref:e}):u.jsx(hi,{...o,ref:e})})})})}),gi=i.forwardRef((t,e)=>{const n=le(Z,t.__scopeMenu),r=i.useRef(null),o=$(e,r);return i.useEffect(()=>{const s=r.current;if(s)return To(s)},[]),u.jsx(Dt,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hi=i.forwardRef((t,e)=>{const n=le(Z,t.__scopeMenu);return u.jsx(Dt,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pi=He("MenuContent.ScrollLock"),Dt=i.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,disableOutsideScroll:C,...p}=t,v=le(Z,n),y=Re(Z,n),w=We(n),b=qn(n),E=ii(n),[I,R]=i.useState(null),T=i.useRef(null),M=$(e,T,v.onContentChange),_=i.useRef(0),F=i.useRef(""),D=i.useRef(0),A=i.useRef(null),K=i.useRef("right"),ee=i.useRef(0),te=C?Yn:i.Fragment,V=C?{as:pi,allowPinchZoom:!0}:void 0,U=x=>{var ne,ye;const N=F.current+x,j=E().filter(Y=>!Y.disabled),H=document.activeElement,me=(ne=j.find(Y=>Y.ref.current===H))==null?void 0:ne.textValue,ve=j.map(Y=>Y.textValue),Me=Oi(ve,N,me),ie=(ye=j.find(Y=>Y.textValue===Me))==null?void 0:ye.ref.current;(function Y(Ce){F.current=Ce,window.clearTimeout(_.current),Ce!==""&&(_.current=window.setTimeout(()=>Y(""),1e3))})(N),ie&&setTimeout(()=>ie.focus())};i.useEffect(()=>()=>window.clearTimeout(_.current),[]),Jo();const S=i.useCallback(x=>{var j,H;return K.current===((j=A.current)==null?void 0:j.side)&&Pi(x,(H=A.current)==null?void 0:H.area)},[]);return u.jsx(fi,{scope:n,searchRef:F,onItemEnter:i.useCallback(x=>{S(x)&&x.preventDefault()},[S]),onItemLeave:i.useCallback(x=>{var N;S(x)||((N=T.current)==null||N.focus(),R(null))},[S]),onTriggerLeave:i.useCallback(x=>{S(x)&&x.preventDefault()},[S]),pointerGraceTimerRef:D,onPointerGraceIntentChange:i.useCallback(x=>{A.current=x},[]),children:u.jsx(te,{...V,children:u.jsx(wn,{asChild:!0,trapped:o,onMountAutoFocus:P(s,x=>{var N;x.preventDefault(),(N=T.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(Sn,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,children:u.jsx($s,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:I,onCurrentTabStopIdChange:R,onEntryFocus:P(d,x=>{y.isUsingKeyboardRef.current||x.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(Ss,{role:"menu","aria-orientation":"vertical","data-state":mr(v.open),"data-radix-menu-content":"",dir:y.dir,...w,...p,ref:M,style:{outline:"none",...p.style},onKeyDown:P(p.onKeyDown,x=>{const j=x.target.closest("[data-radix-menu-content]")===x.currentTarget,H=x.ctrlKey||x.altKey||x.metaKey,me=x.key.length===1;j&&(x.key==="Tab"&&x.preventDefault(),!H&&me&&U(x.key));const ve=T.current;if(x.target!==ve||!ri.includes(x.key))return;x.preventDefault();const ie=E().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);Xn.includes(x.key)&&ie.reverse(),Di(ie)}),onBlur:P(t.onBlur,x=>{x.currentTarget.contains(x.target)||(window.clearTimeout(_.current),F.current="")}),onPointerMove:P(t.onPointerMove,Ee(x=>{const N=x.target,j=ee.current!==x.clientX;if(x.currentTarget.contains(N)&&j){const H=x.clientX>ee.current?"right":"left";K.current=H,ee.current=x.clientX}}))})})})})})})});er.displayName=Z;var mi="MenuGroup",Tt=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx(B.div,{role:"group",...r,ref:e})});Tt.displayName=mi;var vi="MenuLabel",tr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx(B.div,{...r,ref:e})});tr.displayName=vi;var $e="MenuItem",qt="menu.itemSelect",Ve=i.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,s=i.useRef(null),a=Re($e,t.__scopeMenu),c=Et($e,t.__scopeMenu),d=$(e,s),l=i.useRef(!1),f=()=>{const h=s.current;if(!n&&h){const g=new CustomEvent(qt,{bubbles:!0,cancelable:!0});h.addEventListener(qt,m=>r==null?void 0:r(m),{once:!0}),vn(h,g),g.defaultPrevented?l.current=!1:a.onClose()}};return u.jsx(nr,{...o,ref:d,disabled:n,onClick:P(t.onClick,f),onPointerDown:h=>{var g;(g=t.onPointerDown)==null||g.call(t,h),l.current=!0},onPointerUp:P(t.onPointerUp,h=>{var g;l.current||(g=h.currentTarget)==null||g.click()}),onKeyDown:P(t.onKeyDown,h=>{const g=c.searchRef.current!=="";n||g&&h.key===" "||ht.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Ve.displayName=$e;var nr=i.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=t,a=Et($e,n),c=qn(n),d=i.useRef(null),l=$(e,d),[f,h]=i.useState(!1),[g,m]=i.useState("");return i.useEffect(()=>{const C=d.current;C&&m((C.textContent??"").trim())},[s.children]),u.jsx(we.ItemSlot,{scope:n,disabled:r,textValue:o??g,children:u.jsx(Bs,{asChild:!0,...c,focusable:!r,children:u.jsx(B.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:P(t.onPointerMove,Ee(C=>{r?a.onItemLeave(C):(a.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:P(t.onPointerLeave,Ee(C=>a.onItemLeave(C))),onFocus:P(t.onFocus,()=>h(!0)),onBlur:P(t.onBlur,()=>h(!1))})})})}),yi="MenuCheckboxItem",rr=i.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return u.jsx(cr,{scope:t.__scopeMenu,checked:n,children:u.jsx(Ve,{role:"menuitemcheckbox","aria-checked":Be(n)?"mixed":n,...o,ref:e,"data-state":It(n),onSelect:P(o.onSelect,()=>r==null?void 0:r(Be(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rr.displayName=yi;var or="MenuRadioGroup",[Ci,xi]=ue(or,{value:void 0,onValueChange:()=>{}}),sr=i.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,s=J(r);return u.jsx(Ci,{scope:t.__scopeMenu,value:n,onValueChange:s,children:u.jsx(Tt,{...o,ref:e})})});sr.displayName=or;var ir="MenuRadioItem",ar=i.forwardRef((t,e)=>{const{value:n,...r}=t,o=xi(ir,t.__scopeMenu),s=n===o.value;return u.jsx(cr,{scope:t.__scopeMenu,checked:s,children:u.jsx(Ve,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":It(s),onSelect:P(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});ar.displayName=ir;var Ot="MenuItemIndicator",[cr,Si]=ue(Ot,{checked:!1}),ur=i.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,s=Si(Ot,n);return u.jsx(Oe,{present:r||Be(s.checked)||s.checked===!0,children:u.jsx(B.span,{...o,ref:e,"data-state":It(s.checked)})})});ur.displayName=Ot;var bi="MenuSeparator",lr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx(B.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});lr.displayName=bi;var wi="MenuArrow",dr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=We(n);return u.jsx(bs,{...o,...r,ref:e})});dr.displayName=wi;var Ei="MenuSub",[zu,fr]=ue(Ei),Se="MenuSubTrigger",gr=i.forwardRef((t,e)=>{const n=le(Se,t.__scopeMenu),r=Re(Se,t.__scopeMenu),o=fr(Se,t.__scopeMenu),s=Et(Se,t.__scopeMenu),a=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,l={__scopeMenu:t.__scopeMenu},f=i.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return i.useEffect(()=>f,[f]),i.useEffect(()=>{const h=c.current;return()=>{window.clearTimeout(h),d(null)}},[c,d]),u.jsx(bt,{asChild:!0,...l,children:u.jsx(nr,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":mr(n.open),...t,ref:mn(e,o.onTriggerChange),onClick:h=>{var g;(g=t.onClick)==null||g.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:P(t.onPointerMove,Ee(h=>{s.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:P(t.onPointerLeave,Ee(h=>{var m,C;f();const g=(m=n.content)==null?void 0:m.getBoundingClientRect();if(g){const p=(C=n.content)==null?void 0:C.dataset.side,v=p==="right",y=v?-5:5,w=g[v?"left":"right"],b=g[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+y,y:h.clientY},{x:w,y:g.top},{x:b,y:g.top},{x:b,y:g.bottom},{x:w,y:g.bottom}],side:p}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:P(t.onKeyDown,h=>{var m;const g=s.searchRef.current!=="";t.disabled||g&&h.key===" "||oi[r.dir].includes(h.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),h.preventDefault())})})})});gr.displayName=Se;var hr="MenuSubContent",pr=i.forwardRef((t,e)=>{const n=Qn(Z,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,s=le(Z,t.__scopeMenu),a=Re(Z,t.__scopeMenu),c=fr(hr,t.__scopeMenu),d=i.useRef(null),l=$(e,d);return u.jsx(we.Provider,{scope:t.__scopeMenu,children:u.jsx(Oe,{present:r||s.open,children:u.jsx(we.Slot,{scope:t.__scopeMenu,children:u.jsx(Dt,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;a.isUsingKeyboardRef.current&&((h=d.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:P(t.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:P(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:P(t.onKeyDown,f=>{var m;const h=f.currentTarget.contains(f.target),g=si[a.dir].includes(f.key);h&&g&&(s.onOpenChange(!1),(m=c.trigger)==null||m.focus(),f.preventDefault())})})})})})});pr.displayName=hr;function mr(t){return t?"open":"closed"}function Be(t){return t==="indeterminate"}function It(t){return Be(t)?"indeterminate":t?"checked":"unchecked"}function Di(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Ti(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Oi(t,e,n){const o=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let a=Ti(t,Math.max(s,0));o.length===1&&(a=a.filter(l=>l!==n));const d=a.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function Ii(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const c=e[s],d=e[a],l=c.x,f=c.y,h=d.x,g=d.y;f>r!=g>r&&n<(h-l)*(r-f)/(g-f)+l&&(o=!o)}return o}function Pi(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Ii(n,e)}function Ee(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Ri=Zn,Mi=bt,Ni=Jn,Ai=er,_i=Tt,ji=tr,Fi=Ve,Li=rr,ki=sr,Ui=ar,Hi=ur,$i=lr,Bi=dr,Gi=gr,Ki=pr,Pt="ContextMenu",[Wi,qu]=Te(Pt,[zn]),G=zn(),[Vi,vr]=Wi(Pt),yr=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:s=!0}=t,[a,c]=i.useState(!1),d=G(e),l=J(r),f=i.useCallback(h=>{c(h),l(h)},[l]);return u.jsx(Vi,{scope:e,open:a,onOpenChange:f,modal:s,children:u.jsx(Ri,{...d,dir:o,open:a,onOpenChange:f,modal:s,children:n})})};yr.displayName=Pt;var Cr="ContextMenuTrigger",xr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,s=vr(Cr,n),a=G(n),c=i.useRef({x:0,y:0}),d=i.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),l=i.useRef(0),f=i.useCallback(()=>window.clearTimeout(l.current),[]),h=g=>{c.current={x:g.clientX,y:g.clientY},s.onOpenChange(!0)};return i.useEffect(()=>f,[f]),i.useEffect(()=>void(r&&f()),[r,f]),u.jsxs(u.Fragment,{children:[u.jsx(Mi,{...a,virtualRef:d}),u.jsx(B.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:P(t.onContextMenu,g=>{f(),h(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:P(t.onPointerDown,Fe(g=>{f(),l.current=window.setTimeout(()=>h(g),700)})),onPointerMove:r?t.onPointerMove:P(t.onPointerMove,Fe(f)),onPointerCancel:r?t.onPointerCancel:P(t.onPointerCancel,Fe(f)),onPointerUp:r?t.onPointerUp:P(t.onPointerUp,Fe(f))})]})});xr.displayName=Cr;var Yi="ContextMenuPortal",Sr=t=>{const{__scopeContextMenu:e,...n}=t,r=G(e);return u.jsx(Ni,{...r,...n})};Sr.displayName=Yi;var br="ContextMenuContent",wr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=vr(br,n),s=G(n),a=i.useRef(!1);return u.jsx(Ai,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var d;(d=t.onCloseAutoFocus)==null||d.call(t,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var d;(d=t.onInteractOutside)==null||d.call(t,c),!c.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wr.displayName=br;var Xi="ContextMenuGroup",zi=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(_i,{...o,...r,ref:e})});zi.displayName=Xi;var qi="ContextMenuLabel",Zi=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(ji,{...o,...r,ref:e})});Zi.displayName=qi;var Qi="ContextMenuItem",Er=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Fi,{...o,...r,ref:e})});Er.displayName=Qi;var Ji="ContextMenuCheckboxItem",ea=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Li,{...o,...r,ref:e})});ea.displayName=Ji;var ta="ContextMenuRadioGroup",na=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(ki,{...o,...r,ref:e})});na.displayName=ta;var ra="ContextMenuRadioItem",oa=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Ui,{...o,...r,ref:e})});oa.displayName=ra;var sa="ContextMenuItemIndicator",ia=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Hi,{...o,...r,ref:e})});ia.displayName=sa;var aa="ContextMenuSeparator",Dr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx($i,{...o,...r,ref:e})});Dr.displayName=aa;var ca="ContextMenuArrow",ua=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Bi,{...o,...r,ref:e})});ua.displayName=ca;var la="ContextMenuSubTrigger",da=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Gi,{...o,...r,ref:e})});da.displayName=la;var fa="ContextMenuSubContent",ga=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Ki,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ga.displayName=fa;function Fe(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var ha=yr,pa=xr,ma=Sr,va=wr,Q=Er,Zt=Dr;const Tr=i.createContext({dragDropManager:void 0});function z(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Qt=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Jt=function(){return Math.random().toString(36).substring(7).split("").join(".")},en={INIT:"@@redux/INIT"+Jt(),REPLACE:"@@redux/REPLACE"+Jt()};function ya(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Or(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(z(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(z(1));return n(Or)(t,e)}if(typeof t!="function")throw new Error(z(2));var o=t,s=e,a=[],c=a,d=!1;function l(){c===a&&(c=a.slice())}function f(){if(d)throw new Error(z(3));return s}function h(p){if(typeof p!="function")throw new Error(z(4));if(d)throw new Error(z(5));var v=!0;return l(),c.push(p),function(){if(v){if(d)throw new Error(z(6));v=!1,l();var w=c.indexOf(p);c.splice(w,1),a=null}}}function g(p){if(!ya(p))throw new Error(z(7));if(typeof p.type>"u")throw new Error(z(8));if(d)throw new Error(z(9));try{d=!0,s=o(s,p)}finally{d=!1}for(var v=a=c,y=0;y<v.length;y++){var w=v[y];w()}return p}function m(p){if(typeof p!="function")throw new Error(z(10));o=p,g({type:en.REPLACE})}function C(){var p,v=h;return p={subscribe:function(w){if(typeof w!="object"||w===null)throw new Error(z(11));function b(){w.next&&w.next(f())}b();var E=v(b);return{unsubscribe:E}}},p[Qt]=function(){return this},p}return g({type:en.INIT}),r={dispatch:g,subscribe:h,getState:f,replaceReducer:m},r[Qt]=C,r}function O(t,e,...n){if(Ca()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let o=0;r=new Error(e.replace(/%s/g,function(){return n[o++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Ca(){return typeof process<"u"&&!0}function xa(t,e,n){return e.split(".").reduce((r,o)=>r&&r[o]?r[o]:n||null,t)}function Sa(t,e){return t.filter(n=>n!==e)}function Ir(t){return typeof t=="object"}function ba(t,e){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};t.forEach(r),e.forEach(r);const o=[];return n.forEach((s,a)=>{s===1&&o.push(a)}),o}function wa(t,e){return t.filter(n=>e.indexOf(n)>-1)}const Rt="dnd-core/INIT_COORDS",Ye="dnd-core/BEGIN_DRAG",Mt="dnd-core/PUBLISH_DRAG_SOURCE",Xe="dnd-core/HOVER",ze="dnd-core/DROP",qe="dnd-core/END_DRAG";function tn(t,e){return{type:Rt,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const Ea={type:Rt,payload:{clientOffset:null,sourceClientOffset:null}};function Da(t){return function(n=[],r={publishSource:!0}){const{publishSource:o=!0,clientOffset:s,getSourceClientOffset:a}=r,c=t.getMonitor(),d=t.getRegistry();t.dispatch(tn(s)),Ta(n,c,d);const l=Pa(n,c);if(l==null){t.dispatch(Ea);return}let f=null;if(s){if(!a)throw new Error("getSourceClientOffset must be defined");Oa(a),f=a(l)}t.dispatch(tn(s,f));const g=d.getSource(l).beginDrag(c,l);if(g==null)return;Ia(g),d.pinSource(l);const m=d.getSourceType(l);return{type:Ye,payload:{itemType:m,item:g,sourceId:l,clientOffset:s||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}function Ta(t,e,n){O(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){O(n.getSource(r),"Expected sourceIds to be registered.")})}function Oa(t){O(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ia(t){O(Ir(t),"Item must be an object.")}function Pa(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function Ra(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ma(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Ra(t,o,n[o])})}return t}function Na(t){return function(n={}){const r=t.getMonitor(),o=t.getRegistry();Aa(r),Fa(r).forEach((a,c)=>{const d=_a(a,c,o,r),l={type:ze,payload:{dropResult:Ma({},n,d)}};t.dispatch(l)})}}function Aa(t){O(t.isDragging(),"Cannot call drop while not dragging."),O(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function _a(t,e,n,r){const o=n.getTarget(t);let s=o?o.drop(r,t):void 0;return ja(s),typeof s>"u"&&(s=e===0?{}:r.getDropResult()),s}function ja(t){O(typeof t>"u"||Ir(t),"Drop result must either be an object or undefined.")}function Fa(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function La(t){return function(){const n=t.getMonitor(),r=t.getRegistry();ka(n);const o=n.getSourceId();return o!=null&&(r.getSource(o,!0).endDrag(n,o),r.unpinSource()),{type:qe}}}function ka(t){O(t.isDragging(),"Cannot call endDrag while not dragging.")}function pt(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function Ua(t){return function(n,{clientOffset:r}={}){Ha(n);const o=n.slice(0),s=t.getMonitor(),a=t.getRegistry(),c=s.getItemType();return Ba(o,a,c),$a(o,s,a),Ga(o,s,a),{type:Xe,payload:{targetIds:o,clientOffset:r||null}}}}function Ha(t){O(Array.isArray(t),"Expected targetIds to be an array.")}function $a(t,e,n){O(e.isDragging(),"Cannot call hover while not dragging."),O(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const o=t[r];O(t.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(o);O(s,"Expected targetIds to be registered.")}}function Ba(t,e,n){for(let r=t.length-1;r>=0;r--){const o=t[r],s=e.getTargetType(o);pt(s,n)||t.splice(r,1)}}function Ga(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function Ka(t){return function(){if(t.getMonitor().isDragging())return{type:Mt}}}function Wa(t){return{beginDrag:Da(t),publishDragSource:Ka(t),hover:Ua(t),drop:Na(t),endDrag:La(t)}}class Va{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(s){return(...a)=>{const c=s.apply(e,a);typeof c<"u"&&n(c)}}const o=Wa(this);return Object.keys(o).reduce((s,a)=>{const c=o[a];return s[a]=r(c),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function Ya(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Pr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Xa(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:Pr(Ya(e,r),n)}function za(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:Pr(e,n)}const be=[],Nt=[];be.__IS_NONE__=!0;Nt.__IS_ALL__=!0;function qa(t,e){return t===be?!1:t===Nt||typeof e>"u"?!0:wa(e,t).length>0}class Za{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;O(typeof e=="function","listener must be a function."),O(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let o=this.store.getState().stateId;const s=()=>{const a=this.store.getState(),c=a.stateId;try{c===o||c===o+1&&!qa(a.dirtyHandlerIds,r)||e()}finally{o=c}};return this.store.subscribe(s)}subscribeToOffsetChange(e){O(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const o=this.store.getState().dragOffset;o!==n&&(n=o,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return O(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(O(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();return pt(r,o)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(O(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),o=this.getItemType();return r!==o?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const o=this.registry.getTargetType(e),s=this.getItemType();if(s&&!pt(o,s))return!1;const a=this.getTargetIds();if(!a.length)return!1;const c=a.indexOf(e);return r?c===a.length-1:c>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xa(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return za(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const nn=typeof global<"u"?global:self,Rr=nn.MutationObserver||nn.WebKitMutationObserver;function Mr(t){return function(){const n=setTimeout(o,0),r=setInterval(o,50);function o(){clearTimeout(n),clearInterval(r),t()}}}function Qa(t){let e=1;const n=new Rr(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Ja=typeof Rr=="function"?Qa:Mr;class ec{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,o=e.length-this.index;r<o;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Ja(this.flush),this.requestErrorThrow=Mr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class tc{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class nc{create(e){const n=this.freeTasks,r=n.length?n.pop():new tc(this.onError,o=>n[n.length]=o);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Nr=new ec,rc=new nc(Nr.registerPendingError);function oc(t){Nr.enqueueTask(rc.create(t))}const At="dnd-core/ADD_SOURCE",_t="dnd-core/ADD_TARGET",jt="dnd-core/REMOVE_SOURCE",Ze="dnd-core/REMOVE_TARGET";function sc(t){return{type:At,payload:{sourceId:t}}}function ic(t){return{type:_t,payload:{targetId:t}}}function ac(t){return{type:jt,payload:{sourceId:t}}}function cc(t){return{type:Ze,payload:{targetId:t}}}function uc(t){O(typeof t.canDrag=="function","Expected canDrag to be a function."),O(typeof t.beginDrag=="function","Expected beginDrag to be a function."),O(typeof t.endDrag=="function","Expected endDrag to be a function.")}function lc(t){O(typeof t.canDrop=="function","Expected canDrop to be a function."),O(typeof t.hover=="function","Expected hover to be a function."),O(typeof t.drop=="function","Expected beginDrag to be a function.")}function mt(t,e){if(e&&Array.isArray(t)){t.forEach(n=>mt(n,!1));return}O(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var q;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(q||(q={}));let dc=0;function fc(){return dc++}function gc(t){const e=fc().toString();switch(t){case q.SOURCE:return`S${e}`;case q.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function rn(t){switch(t[0]){case"S":return q.SOURCE;case"T":return q.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function on(t,e){const n=t.entries();let r=!1;do{const{done:o,value:[,s]}=n.next();if(s===e)return!0;r=!!o}while(!r);return!1}class hc{addSource(e,n){mt(e),uc(n);const r=this.addHandler(q.SOURCE,e,n);return this.store.dispatch(sc(r)),r}addTarget(e,n){mt(e,!0),lc(n);const r=this.addHandler(q.TARGET,e,n);return this.store.dispatch(ic(r)),r}containsHandler(e){return on(this.dragSources,e)||on(this.dropTargets,e)}getSource(e,n=!1){return O(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return O(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return O(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return O(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return rn(e)===q.SOURCE}isTargetId(e){return rn(e)===q.TARGET}removeSource(e){O(this.getSource(e),"Expected an existing source."),this.store.dispatch(ac(e)),oc(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){O(this.getTarget(e),"Expected an existing target."),this.store.dispatch(cc(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);O(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){O(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const o=gc(e);return this.types.set(o,n),e===q.SOURCE?this.dragSources.set(o,r):e===q.TARGET&&this.dropTargets.set(o,r),o}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const pc=(t,e)=>t===e;function mc(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function vc(t,e,n=pc){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function yc(t=be,e){switch(e.type){case Xe:break;case At:case _t:case Ze:case jt:return be;case Ye:case Mt:case qe:case ze:default:return Nt}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,o=ba(n,r);if(!(o.length>0||!vc(n,r)))return be;const a=r[r.length-1],c=n[n.length-1];return a!==c&&(a&&o.push(a),c&&o.push(c)),o}function Cc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Cc(t,o,n[o])})}return t}const sn={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Sc(t=sn,e){const{payload:n}=e;switch(e.type){case Rt:case Ye:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Xe:return mc(t.clientOffset,n.clientOffset)?t:xc({},t,{clientOffset:n.clientOffset});case qe:case ze:return sn;default:return t}}function bc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function he(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){bc(t,o,n[o])})}return t}const wc={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ec(t=wc,e){const{payload:n}=e;switch(e.type){case Ye:return he({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Mt:return he({},t,{isSourcePublic:!0});case Xe:return he({},t,{targetIds:n.targetIds});case Ze:return t.targetIds.indexOf(n.targetId)===-1?t:he({},t,{targetIds:Sa(t.targetIds,n.targetId)});case ze:return he({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case qe:return he({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Dc(t=0,e){switch(e.type){case At:case _t:return t+1;case jt:case Ze:return t-1;default:return t}}function Tc(t=0){return t+1}function Oc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ic(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Oc(t,o,n[o])})}return t}function Pc(t={},e){return{dirtyHandlerIds:yc(t.dirtyHandlerIds,{type:e.type,payload:Ic({},e.payload,{prevTargetIds:xa(t,"dragOperation.targetIds",[])})}),dragOffset:Sc(t.dragOffset,e),refCount:Dc(t.refCount,e),dragOperation:Ec(t.dragOperation,e),stateId:Tc(t.stateId)}}function Rc(t,e=void 0,n={},r=!1){const o=Mc(r),s=new Za(o,new hc(o)),a=new Va(o,s),c=t(a,e,n);return a.receiveBackend(c),a}function Mc(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Or(Pc,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function Nc(t,e){if(t==null)return{};var n=Ac(t,e),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(o=0;o<s.length;o++)r=s[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ac(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,s;for(s=0;s<r.length;s++)o=r[s],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}let an=0;const Ue=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var _c=i.memo(function(e){var{children:n}=e,r=Nc(e,["children"]);const[o,s]=jc(r);return i.useEffect(()=>{if(s){const a=Ar();return++an,()=>{--an===0&&(a[Ue]=null)}}},[]),u.jsx(Tr.Provider,{value:o,children:n})});function jc(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=Fc(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function Fc(t,e=Ar(),n,r){const o=e;return o[Ue]||(o[Ue]={dragDropManager:Rc(t,e,n,r)}),o[Ue]}function Ar(){return typeof global<"u"?global:window}var ot,cn;function Lc(){return cn||(cn=1,ot=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var a=s[o];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),ot}var kc=Lc();const Uc=to(kc),ae=typeof window<"u"?i.useLayoutEffect:i.useEffect;function _r(t,e,n){const[r,o]=i.useState(()=>e(t)),s=i.useCallback(()=>{const a=e(t);Uc(r,a)||(o(a),n&&n())},[r,t,n]);return ae(s),[r,s]}function Hc(t,e,n){const[r,o]=_r(t,e,n);return ae(function(){const a=t.getHandlerId();if(a!=null)return t.subscribeToStateChange(o,{handlerIds:[a]})},[t,o]),r}function jr(t,e,n){return Hc(e,t||(()=>({})),()=>n.reconnect())}function Fr(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),i.useMemo(()=>typeof t=="function"?t():t,n)}function $c(t){return i.useMemo(()=>t.hooks.dragSource(),[t])}function Bc(t){return i.useMemo(()=>t.hooks.dragPreview(),[t])}let st=!1,it=!1;class Gc{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){O(!st,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return st=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{st=!1}}isDragging(){if(!this.sourceId)return!1;O(!it,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return it=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{it=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let at=!1;class Kc{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;O(!at,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return at=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{at=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function Wc(t,e,n){const r=n.getRegistry(),o=r.addTarget(t,e);return[o,()=>r.removeTarget(o)]}function Vc(t,e,n){const r=n.getRegistry(),o=r.addSource(t,e);return[o,()=>r.removeSource(o)]}function vt(t,e,n,r){let o;if(o!==void 0)return!!o;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const s=Object.keys(t),a=Object.keys(e);if(s.length!==a.length)return!1;const c=Object.prototype.hasOwnProperty.bind(e);for(let d=0;d<s.length;d++){const l=s[d];if(!c(l))return!1;const f=t[l],h=e[l];if(o=void 0,o===!1||o===void 0&&f!==h)return!1}return!0}function yt(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Yc(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function Xc(t){return(e=null,n=null)=>{if(!i.isValidElement(e)){const s=e;return t(s,n),s}const r=e;return Yc(r),zc(r,n?s=>t(s,n):t)}}function Lr(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const o=Xc(r);e[n]=()=>o}}),e}function un(t,e){typeof t=="function"?t(e):t.current=e}function zc(t,e){const n=t.ref;return O(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?i.cloneElement(t,{ref:r=>{un(n,r),un(e,r)}}):i.cloneElement(t,{ref:e})}class qc{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!vt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!vt(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Lr({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,yt(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,yt(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class Zc{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!vt(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Lr({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,yt(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function de(){const{dragDropManager:t}=i.useContext(Tr);return O(t!=null,"Expected drag drop context"),t}function Qc(t,e){const n=de(),r=i.useMemo(()=>new qc(n.getBackend()),[n]);return ae(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),ae(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function Jc(){const t=de();return i.useMemo(()=>new Gc(t),[t])}class eu{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,o=this.monitor,{isDragging:s}=r;return s?s(o):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:o}=e;o&&o(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function tu(t,e,n){const r=i.useMemo(()=>new eu(t,e,n),[e,n]);return i.useEffect(()=>{r.spec=t},[t]),r}function nu(t){return i.useMemo(()=>{const e=t.type;return O(e!=null,"spec.type must be defined"),e},[t])}function ru(t,e,n){const r=de(),o=tu(t,e,n),s=nu(t);ae(function(){if(s!=null){const[c,d]=Vc(s,o,r);return e.receiveHandlerId(c),n.receiveHandlerId(c),d}},[r,e,n,o,s])}function kr(t,e){const n=Fr(t,e);O(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=Jc(),o=Qc(n.options,n.previewOptions);return ru(n,r,o),[jr(n.collect,r,o),$c(o),Bc(o)]}function ou(t){const n=de().getMonitor(),[r,o]=_r(n,t);return i.useEffect(()=>n.subscribeToOffsetChange(o)),i.useEffect(()=>n.subscribeToStateChange(o)),r}function su(t){return i.useMemo(()=>t.hooks.dropTarget(),[t])}function iu(t){const e=de(),n=i.useMemo(()=>new Zc(e.getBackend()),[e]);return ae(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function au(){const t=de();return i.useMemo(()=>new Kc(t),[t])}function cu(t){const{accept:e}=t;return i.useMemo(()=>(O(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class uu{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function lu(t,e){const n=i.useMemo(()=>new uu(t,e),[e]);return i.useEffect(()=>{n.spec=t},[t]),n}function du(t,e,n){const r=de(),o=lu(t,e),s=cu(t);ae(function(){const[c,d]=Wc(s,o,r);return e.receiveHandlerId(c),n.receiveHandlerId(c),d},[r,e,o,n,s.map(a=>a.toString()).join("|")])}function fu(t,e){const n=Fr(t,e),r=au(),o=iu(n.options);return du(n,r,o),[jr(n.collect,r,o),su(o)]}function Ur(t){let e=null;return()=>(e==null&&(e=t()),e)}function gu(t,e){return t.filter(n=>n!==e)}function hu(t,e){const n=new Set,r=s=>n.add(s);t.forEach(r),e.forEach(r);const o=[];return n.forEach(s=>o.push(s)),o}class pu{enter(e){const n=this.entered.length,r=o=>this.isNodeInDocument(o)&&(!o.contains||o.contains(e));return this.entered=hu(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=gu(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class mu{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const o=this.config.exposeProperties[r];o!=null&&(n[r]={value:o(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Hr="__NATIVE_FILE__",$r="__NATIVE_URL__",Br="__NATIVE_TEXT__",Gr="__NATIVE_HTML__",ln=Object.freeze(Object.defineProperty({__proto__:null,FILE:Hr,HTML:Gr,TEXT:Br,URL:$r},Symbol.toStringTag,{value:"Module"}));function ct(t,e,n){const r=e.reduce((o,s)=>o||t.getData(s),"");return r??n}const Ct={[Hr]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[Gr]:{exposeProperties:{html:(t,e)=>ct(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[$r]:{exposeProperties:{urls:(t,e)=>ct(t,e,"").split(`
|
|
5
|
+
`),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Br]:{exposeProperties:{text:(t,e)=>ct(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function vu(t,e){const n=Ct[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new mu(n);return r.loadDataTransfer(e),r}function ut(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(Ct).filter(n=>{const r=Ct[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(o=>e.indexOf(o)>-1):!1})[0]||null}const yu=Ur(()=>/firefox/i.test(navigator.userAgent)),Kr=Ur(()=>!!window.safari);class dn{interpolate(e){const{xs:n,ys:r,c1s:o,c2s:s,c3s:a}=this;let c=n.length-1;if(e===n[c])return r[c];let d=0,l=a.length-1,f;for(;d<=l;){f=Math.floor(.5*(d+l));const m=n[f];if(m<e)d=f+1;else if(m>e)l=f-1;else return r[f]}c=Math.max(0,l);const h=e-n[c],g=h*h;return r[c]+o[c]*h+s[c]*g+a[c]*h*g}constructor(e,n){const{length:r}=e,o=[];for(let m=0;m<r;m++)o.push(m);o.sort((m,C)=>e[m]<e[C]?-1:1);const s=[],a=[];let c,d;for(let m=0;m<r-1;m++)c=e[m+1]-e[m],d=n[m+1]-n[m],s.push(c),a.push(d/c);const l=[a[0]];for(let m=0;m<s.length-1;m++){const C=a[m],p=a[m+1];if(C*p<=0)l.push(0);else{c=s[m];const v=s[m+1],y=c+v;l.push(3*y/((y+v)/C+(y+c)/p))}}l.push(a[a.length-1]);const f=[],h=[];let g;for(let m=0;m<l.length-1;m++){g=a[m];const C=l[m],p=1/s[m],v=C+l[m+1]-g-g;f.push((g-C-v)*p),h.push(v*p*p)}this.xs=e,this.ys=n,this.c1s=l,this.c2s=f,this.c3s=h}}const Cu=1;function Wr(t){const e=t.nodeType===Cu?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Le(t){return{x:t.clientX,y:t.clientY}}function xu(t){var e;return t.nodeName==="IMG"&&(yu()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function Su(t,e,n,r){let o=t?e.width:n,s=t?e.height:r;return Kr()&&t&&(s/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:s}}function bu(t,e,n,r,o){const s=xu(e),c=Wr(s?t:e),d={x:n.x-c.x,y:n.y-c.y},{offsetWidth:l,offsetHeight:f}=t,{anchorX:h,anchorY:g}=r,{dragPreviewWidth:m,dragPreviewHeight:C}=Su(s,e,l,f),p=()=>{let R=new dn([0,.5,1],[d.y,d.y/f*C,d.y+C-f]).interpolate(g);return Kr()&&s&&(R+=(window.devicePixelRatio-1)*C),R},v=()=>new dn([0,.5,1],[d.x,d.x/l*m,d.x+m-l]).interpolate(h),{offsetX:y,offsetY:w}=o,b=y===0||y,E=w===0||w;return{x:b?y:v(),y:E?w:p()}}class wu{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function Eu(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Eu(t,o,n[o])})}return t}class Du{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const o=a=>this.handleDragStart(a,e),s=a=>this.handleSelectStart(a);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=a=>this.handleDragEnter(a,e),o=a=>this.handleDragOver(a,e),s=a=>this.handleDrop(a,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",o),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",o),n.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return fn({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return fn({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(ln).some(n=>ln[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=vu(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=o=>{const s=this.sourceNodes.get(o);return s&&Wr(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=o=>!!(o&&this.document&&this.document.body&&this.document.body.contains(o)),this.endDragIfSourceWasRemovedFromDOM=()=>{const o=this.currentDragSourceNode;o==null||this.isNodeInDocument(o)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=o=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(o||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=o=>{if(o.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const a=Le(o);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:c}=o,d=ut(c);if(this.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){const f=this.monitor.getSourceId(),h=this.sourceNodes.get(f),g=this.sourcePreviewNodes.get(f)||h;if(g){const{anchorX:m,anchorY:C,offsetX:p,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),b=bu(h,g,a,{anchorX:m,anchorY:C},{offsetX:p,offsetY:v});c.setDragImage(g,b.x,b.y)}}try{c==null||c.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(o.target);const{captureDraggingState:l}=this.getCurrentSourcePreviewNodeOptions();l?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(d)this.beginDragNativeItem(d);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=o=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}if(!this.enterLeaveCounter.enter(o.target)||this.monitor.isDragging())return;const{dataTransfer:c}=o,d=ut(c);d&&this.beginDragNativeItem(d,c)},this.handleTopDragEnter=o=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=o.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Le(o)}),s.some(c=>this.monitor.canDropOnTarget(c))&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=o=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}},this.handleTopDragOver=o=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}this.altKeyPressed=o.altKey,this.lastClientOffset=Le(o),this.scheduleHover(s),(s||[]).some(c=>this.monitor.canDropOnTarget(c))?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=o=>{this.isDraggingNativeItem()&&o.preventDefault(),this.enterLeaveCounter.leave(o.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=o=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;o.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}else ut(o.dataTransfer)&&o.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=o=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Le(o)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=o=>{const s=o.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(o.preventDefault(),s.dragDrop()))},this.options=new wu(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new pu(this.isNodeInDocument)}}let ke;function Vr(){return ke||(ke=new Image,ke.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ke}const Tu=function(e,n,r){return new Du(e,n,r)};function ce({file:t,className:e,style:n}){const r=k(D=>D.selectedFile),o=k(D=>D.setSelectedFile),s=k(D=>D.activeRange),a=k(D=>D.setActiveRange),c=k(D=>D.inActiveRange),d=Qe(D=>D.addTab),l=Qe(D=>D.selectTab),f=Qe(D=>D.createTab),[h,g]=i.useState(!1),m=pn(()=>g(!0),{threshold:50,onFinish(){g(!1)},onCancel(){g(!1)}}),{setArtifactRename:C,renameArtifact:p,artifactRename:v,selectArtifactsInRange:y,removeArtifactWithConfirmation:w}=Ge(),[b,E]=i.useState(!1),[{isDragging:I},R,T]=kr(()=>({type:"artifact",item:t,end(){g(!1)},canDrag(){return v!==t&&h},collect(D){return{isDragging:D.isDragging()}}}),[t,v,h]);i.useEffect(()=>{T(Vr(),{captureDraggingState:!0})},[T]);function M(D){D.stopPropagation(),D.shiftKey&&D.preventDefault();let A=s;D.metaKey?(c(t)?A=A.filter(K=>K!==t):A.push(t),a(A)):D.shiftKey&&A.length>0?y(t):(A.length>0&&(A=[]),A.push(t),a(A),o(t))}function _(){const D=f(t);d(D),l(D)}const F=s.length>1&&c(t);return u.jsx("div",{...m,ref:R,children:u.jsxs(W.Container,{artifact:t,isSelected:r===t,className:L(v===t&&"bg-primary-10",b&&"bg-primary-10",h&&"bg-primary-10 !cursor-grabbing outline-2 !outline-primary-500",I&&"opacity-50",e),style:n,onDoubleClick:D=>{D.stopPropagation(),_()},handleSelect:M,children:[u.jsx(ce.Icons,{}),v===t?u.jsx(W.Rename,{artifact:v,rename:p,close:()=>C(void 0)}):u.jsxs(W.ContextMenu,{trigger:u.jsx(W.ContextMenuTrigger,{children:u.jsx(ce.Display,{file:t})}),onOpenChange:E,children:[r!==t&&u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",F?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:F,onClick:D=>{D.stopPropagation()},onSelect:D=>{D.stopPropagation(),_()},children:["Open in New Tab",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",F?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:F,onClick:D=>{D.stopPropagation()},onSelect:D=>{D.stopPropagation(),C(t)},children:["Rename",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-danger-500 hover:bg-danger-500 hover:text-light",onSelect:D=>{D.stopPropagation(),w(t)},children:["Remove ",c(t)?s.length:"",u.jsx("div",{className:"ml-auto pl-5"})]})]})]})})}function Ou({file:t}){return u.jsx("span",{title:t.name,className:L("inline-block overflow-hidden overflow-ellipsis py-[0.125rem]"),children:hn(t.name,50,20)})}function Iu(){return u.jsx("div",{className:"flex items-center",children:u.jsx(No,{className:"inline-block w-3 ml-1 mr-2"})})}ce.Display=Ou;ce.Icons=Iu;const De=function t({directory:e,className:n,style:r}){const o=k(S=>S.selectedFile),s=k(S=>S.activeRange),a=k(S=>S.setActiveRange),c=k(S=>S.inActiveRange),[d,l]=i.useState(e.isOpened),[f,h]=i.useState(!1),[g,m]=i.useState(!1),C=pn(()=>m(!0),{threshold:50,onFinish(){m(!1)},onCancel(){m(!1)}}),{setArtifactRename:p,renameArtifact:v,artifactRename:y,createDirectory:w,createFile:b,moveArtifacts:E,removeArtifactWithConfirmation:I,selectArtifactsInRange:R}=Ge(),[{isOver:T},M]=fu(()=>({accept:"artifact",drop(S,x){if(X(x.canDrop()))return;const N=c(S)?s:[S];E(N,e),e.open()},canDrop(S,x){const N=c(S)?s:[S];return x.isOver({shallow:!0})&&ro(N)&&N.reduce((j,H)=>!(X(j)||H.parent===e||H===e||H instanceof lt&&H.hasDirectory(e)),!0)},collect(S){return{isOver:S.isOver({shallow:!0})&&S.canDrop()}}}),[s]),[{isDragging:_},F,D]=kr(()=>({type:"artifact",item:e,end(){m(!1)},canDrag(){return y!==e&&g},collect(S){return{isDragging:S.isDragging()}}}),[e,y,g]),[A,K,ee,te]=i.useMemo(()=>{if(s.length<2)return[!1,!1,!1,!1];let S=!0,x=!0,N=!0;for(const j of Array.from(s))j instanceof lt&&S?(x&&(x=j.isOpened),N&&(N=j.isClosed)):S=!1;return[S,x,N,X(x)&&X(N)]},[s]);i.useEffect(()=>{e.syncStateOpen=l},[e]),i.useEffect(()=>{D(Vr(),{captureDraggingState:!0})},[D]),i.useEffect(()=>{no(o)||d||e.hasFile(o)&&e.open()},[o]);function V(S){S.stopPropagation(),S.shiftKey||S.metaKey?S.preventDefault():e.toggle();let x=s;S.metaKey?(c(e)?x=x.filter(N=>N!==e):x.push(e),a(x)):S.shiftKey&&x.length>0?R(e):(x.length>0&&(x=[]),x.push(e),a(x))}const U=s.length>1&&c(e);return u.jsx("div",{className:L("h-full",_&&"opacity-50"),children:u.jsxs("div",{ref:M,className:L(T&&X(_)&&"bg-primary-5"),children:[e.withParent&&u.jsx("div",{...C,ref:e.withParent?F:void 0,children:u.jsxs(W.Container,{artifact:e,className:L(y===e&&"bg-primary-10",g&&"bg-primary-10 !cursor-grabbing",f&&"bg-primary-10",n),style:r,handleSelect:V,children:[u.jsx(t.Icons,{isOpen:d||T&&X(_)}),y===e?u.jsx(W.Rename,{artifact:y,rename:v,close:()=>p(void 0)}):u.jsxs(W.ContextMenu,{trigger:u.jsx(W.ContextMenuTrigger,{children:u.jsx(t.Display,{directory:e})}),onOpenChange:h,children:[u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U&&X(A)?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U&&X(A),onSelect:S=>{S.stopPropagation(),s.length>1&&c(e)?s.forEach(x=>{K?x.collapse():ee?x.expand():te&&(x.isOpened?x.collapse():x.expand())}):e.isOpened?e.collapse():e.expand(),a([])},children:[A&&K&&"Collapse All",A&&ee&&"Expand All",A&&te&&"Toggle All",X(A)&&e.isOpened&&"Collapse",X(A)&&e.isClosed&&"Expand",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsx(Zt,{className:"h-[1px] bg-accent-200 m-2"}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onSelect:S=>{S.stopPropagation(),b(e)},children:["New File",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onSelect:S=>{S.stopPropagation(),w(e)},children:["New Folder",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsx(Zt,{className:"h-[1px] bg-accent-200 m-2"}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onClick:S=>{S.stopPropagation()},onSelect:S=>{S.stopPropagation(),p(e)},children:["Rename",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-danger-500 hover:bg-danger-500 hover:text-light",onSelect:S=>{S.stopPropagation(),I(e)},children:["Remove ",c(e)?s.length:"",u.jsx("div",{className:"ml-auto pl-5"})]})]})]})}),(T&&X(_)||d||!e.withParent)&&e.withDirectories&&u.jsx("ul",{className:L(c(e)&&"bg-primary-5"),children:e.directories.map(S=>u.jsx("li",{title:S.name,children:u.jsx(t,{directory:S,style:{paddingLeft:e.withParent?`${e.level/2+.25}rem`:0}},S.id)},S.id))}),(T&&X(_)||d||!e.withParent)&&e.withFiles&&u.jsx("ul",{className:L(c(e)&&"bg-primary-5"),children:e.files.map(S=>u.jsx("li",{title:S.name,children:u.jsx(ce,{file:S,style:{paddingLeft:e.withParent?`${e.level/2+.25}rem`:0}},S.id)},S.id))})]})})};function Pu({directory:t}){return u.jsxs("div",{className:"w-full flex justify-between items-center py-[0.125rem]",children:[u.jsx("span",{title:t.name,className:"overflow-hidden overflow-ellipsis whitespace-nowrap",children:hn(t.name,50,20)}),u.jsx("span",{className:"inline-block text-xs rounded-full px-2 bg-neutral-10 ml-2",children:t.directories.length+t.files.length})]})}function Ru({hasChevron:t=!0,hasFolder:e=!0,isOpen:n=!1,className:r}){const o=n?Po:Ro,s=n?_o:Fo;return u.jsxs("div",{className:L("flex items-center mr-2",r),children:[t&&u.jsx(o,{className:"inline-block w-5"}),e&&u.jsx(s,{className:"inline-block w-4 fill-primary-500"})]})}De.Icons=Ru;De.Display=Pu;const Mu={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"};function Nu(){const t=k(a=>a.activeRange),e=k(a=>a.inActiveRange),{isDragging:n,currentOffset:r,artifact:o}=ou(a=>({artifact:a.getItem(),isDragging:a.isDragging(),currentOffset:a.getSourceClientOffset()})),s=i.useMemo(()=>Array.from(e(o)?t:new Set([o])).filter(Boolean),[t,o]);return u.jsx(u.Fragment,{children:n&&u.jsx("div",{style:Mu,children:u.jsx("div",{style:Au(r),className:"!cursor-grabbing !rounded-lg overflow-hidden",children:s.map(a=>u.jsxs("span",{children:[a instanceof lt&&u.jsxs(W.Container,{artifact:a,className:"bg-theme",children:[u.jsx(De.Icons,{hasChevron:!1}),u.jsx(De.Display,{directory:a})]},a.path),a instanceof Oo&&u.jsxs(W.Container,{artifact:a,className:"bg-theme",children:[u.jsx(ce.Icons,{}),u.jsx(ce.Display,{file:a})]},a.path)]},a.id))})})})}function Au(t){if(t==null)return{display:"none"};const{x:e,y:n}=t;return{display:"inline-block",transform:`translate(${e}px, ${n}px)`,filter:"drop-shadow(0 2px 12px rgba(0,0,0,0.45))"}}const W=function t({className:e}){const n=k(g=>g.project),r=k(g=>g.setSelectedFile),o=k(g=>g.activeRange),s=k(g=>g.setActiveRange),a=oo(g=>g.addConfirmation),{isFetching:c}=so(),{removeArtifacts:d,createDirectory:l,createFile:f}=Ge();function h(g){g.key==="Escape"&&s([]),g.ctrlKey&&g.key==="Backspace"&&o.length>0&&a({headline:"Removing Selected Files/Directories",description:`Are you sure you want to remove ${o.length} items?`,yesText:"Yes, Remove",noText:"No, Cancel",details:Array.from(o).map(m=>m.path),action:()=>{d(o)}})}return u.jsx("div",{tabIndex:0,className:L("flex flex-col w-full h-full overflow-hidden text-sm text-neutral-500 dark:text-neutral-400 font-regular select-none",e),onKeyDown:h,children:c?u.jsx("div",{className:"flex justify-center items-center w-full h-full",children:u.jsxs(io,{className:"inline-block",children:[u.jsx(ao,{className:"w-3 h-3 border border-neutral-10 mr-2"}),u.jsx("h3",{className:"text-md",children:"Getting Project Files..."})]})}):u.jsxs(u.Fragment,{children:[u.jsx(Io,{list:n.allFiles,searchBy:"path",displayBy:"name",size:co.sm,onSelect:r,direction:"top",isFullWidth:!0}),u.jsxs(t.ContextMenu,{trigger:u.jsx(t.ContextMenuTrigger,{className:"h-full pb-1",children:u.jsx(_c,{backend:Tu,children:u.jsxs("div",{className:"w-full relative h-full px-1 overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical",children:[u.jsx(Nu,{}),u.jsx(De,{className:"z-20 relative",directory:n},n.id)]})})}),children:[u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 hover:bg-accent-500 hover:text-light",onSelect:g=>{g.stopPropagation(),f(n)},children:["New File",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 hover:bg-accent-500 hover:text-light",onSelect:g=>{g.stopPropagation(),l(n)},children:["New Folder",u.jsx("div",{className:"ml-auto pl-5"})]})]},n.id)]})})};function _u({trigger:t,children:e,onOpenChange:n}){return u.jsxs(ha,{onOpenChange:n,children:[t,u.jsx(ma,{children:u.jsx(va,{className:"bg-light rounded-md overflow-hidden shadow-lg py-2 px-1 z-50",onClick:r=>{r.stopPropagation()},children:e})})]})}function ju({children:t,className:e}){return u.jsx(pa,{className:L("flex w-full overflow-hidden",e),onContextMenu:n=>{n.stopPropagation()},children:t})}function Fu({artifact:t,rename:e,close:n}){const r=re.useRef(null),[o,s]=i.useState("");return i.useEffect(()=>{s(t.name),setTimeout(()=>{var a;(a=r.current)==null||a.focus()},100)},[t]),u.jsx("div",{className:"w-full flex items-center py-[0.125rem] pr-2",children:u.jsx("input",{ref:r,type:"text",className:"w-full overflow-hidden overflow-ellipsis bg-primary-900 text-primary-100",value:o,onInput:a=>{a.stopPropagation(),s(a.target.value)},onBlur:a=>{a.stopPropagation(),n()},onKeyDown:a=>{a.key==="Enter"&&(a.stopPropagation(),o.trim()!==""&&o!==t.name&&e(t,o),n()),a.key==="Escape"&&(a.stopPropagation(),n())}})})}function Lu({artifact:t,children:e,isSelected:n=!1,className:r,style:o,handleSelect:s,onDoubleClick:a}){const{setArtifactRename:c,isBottomGroupInActiveRange:d,isTopGroupInActiveRange:l,isMiddleGroupInActiveRange:f}=Ge(),h=k(m=>m.activeRange),g=k(m=>m.inActiveRange);return u.jsx("span",{tabIndex:0,className:L("w-full flex items-center group/file px-2",r,l(t)?"rounded-t-md":d(t)?"rounded-b-md":f(t)?"":g(t)&&"rounded-md",g(t)&&h.length>1&&h.indexOf(t)<h.length-1?"border-b border-primary-400":"border-b border-transparent",g(t)?"bg-primary-10 dark:bg-primary-20":n&&"rounded-md bg-neutral-10 text-neutral-600 dark:bg-dark-lighter dark:text-primary-500"),style:o,onClick:s,onDoubleClick:a,onKeyDown:m=>{m.key==="Enter"&&(m.stopPropagation(),c(t),s==null||s(m)),m.key===" "&&(m.stopPropagation(),s==null||s(m))},children:e})}W.ContextMenu=_u;W.ContextMenuTrigger=ju;W.Rename=Fu;W.Container=Lu;export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,j as e,i as r}from"./index-
|
|
1
|
+
import{a as n,j as e,i as r}from"./index-C22hdM_h.js";function i(){const s=n(t=>t.version);return e.jsxs("footer",{className:"px-2 py-1 text-xs flex justify-between",children:[e.jsx("span",{children:r(s)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"SQLMesh: "}),e.jsx("span",{title:"SQLMesh Version",className:"font-black inline-block mr-4",children:s})]})}),e.jsxs("small",{className:"text-xs",children:["© ",new Date().getFullYear()," ",e.jsx("a",{href:"https://tobikodata.com/",target:"_blank",rel:"noopener noreferrer",className:"underline",title:"Tobiko Data website",children:"Tobiko Data, Inc."})," All rights reserved."]})]})}export{i as default};
|