@inkeep/open-knowledge 0.5.0-beta.16 → 0.5.0-beta.18
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.
- package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
- package/dist/cli.mjs +38 -38
- package/dist/constants-B4KnJDAZ.mjs +2 -0
- package/dist/{dist-D5J2z1mI.mjs → dist-Be0To_ZO.mjs} +1 -1
- package/dist/{dist-V31CRf7D.mjs → dist-pXZHJhkA.mjs} +6 -6
- package/dist/index.mjs +1 -1
- package/dist/{init-Db-MJvF_.mjs → init-CJjj7SKR.mjs} +4 -4
- package/dist/init-CS6mOIgn.mjs +1 -0
- package/dist/loader-H7wE7QNZ.mjs +1 -0
- package/dist/{loader-BF1HVIAE.mjs → loader-muqLro6E.mjs} +2 -2
- package/dist/preview-BeYDA-OZ.mjs +1 -0
- package/dist/{preview-qR7FFUro.mjs → preview-viMhTOSc.mjs} +2 -2
- package/dist/public/assets/ActivityModeContent-BzC9xwru.js +2 -0
- package/dist/public/assets/{ConsentDialogBody-BYenkRKt.js → ConsentDialogBody-BpM_eICS.js} +1 -1
- package/dist/public/assets/DocumentContext-DEXQEbv8.js +52 -0
- package/dist/public/assets/{GraphPanel-DwQX9Gl9.js → GraphPanel-D39O3dBN.js} +3 -3
- package/dist/public/assets/{McpConsentDialogBody-CEvkljQ2.js → McpConsentDialogBody-BDYRADff.js} +1 -1
- package/dist/public/assets/SettingsDialog-CO7dzaPy.js +11 -0
- package/dist/public/assets/{SourceEditor-CSsFAy0n.js → SourceEditor-DRa5FCh7.js} +2 -2
- package/dist/public/assets/{agent-presence-BrTlNKmt.js → agent-presence-Beup8CI-.js} +1 -1
- package/dist/public/assets/button-B-xLb7H7.js +1 -0
- package/dist/public/assets/config-validation-events-D8UOvZmc.js +10 -0
- package/dist/public/assets/dialog-BcU1169q.js +45 -0
- package/dist/public/assets/{dist-Bej94Urx.js → dist-DETlERpz.js} +1 -1
- package/dist/public/assets/{dist-Cg-Qaqw_.js → dist-mowPQv9h.js} +1 -1
- package/dist/public/assets/{doc-hash-kxo-uZOQ.js → doc-hash-DRRChZD7.js} +51 -51
- package/dist/public/assets/index-C4KiMV-Z.js +1853 -0
- package/dist/public/assets/index-C5eHVirw.css +1 -0
- package/dist/public/assets/{input-hZk8Tm0e.js → input-UWVR4RR-.js} +1 -1
- package/dist/public/assets/{label-Dv_9VZWz.js → label-D7TT13L_.js} +1 -1
- package/dist/public/assets/mcp-consent-store-QV8NF9CY.js +1 -0
- package/dist/public/assets/{panel-8fydlQgn.js → panel-D9tzSGAf.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-Bc974sw4.js → target-navigation-intent-3OGuOhN2.js} +1 -1
- package/dist/public/assets/{textarea-gXd-JXvQ.js → textarea-2wg2OyKW.js} +1 -1
- package/dist/public/assets/toggle-group-Ba3po_CE.js +1 -0
- package/dist/public/assets/tooltip-BuhzbWzZ.js +1 -0
- package/dist/public/assets/{typing-burst-detector-D-ghtRdu.js → typing-burst-detector-KTL86FBm.js} +1 -1
- package/dist/public/index.html +19 -19
- package/dist/{repair-mcp-configs-DUU6zN1U.mjs → repair-mcp-configs-BeZWSiY1.mjs} +2 -2
- package/dist/{src-DzWkP5Kf.mjs → src-ct_-cWOI.mjs} +2 -2
- package/dist/start-CC-R8Mvd.mjs +1 -0
- package/dist/{start-DivgyWbO.mjs → start-ClRV9jYM.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-XCszYh-u.mjs +0 -2
- package/dist/init-De5O5Atd.mjs +0 -1
- package/dist/loader-C1hxiMbK.mjs +0 -1
- package/dist/preview-N6-E_vFx.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-BMLTkwc9.js +0 -2
- package/dist/public/assets/DocumentContext-BIHXIA3J.js +0 -52
- package/dist/public/assets/SettingsDialog-x6fsBA_3.js +0 -11
- package/dist/public/assets/button-C1nwPVFQ.js +0 -1
- package/dist/public/assets/config-validation-events-DCCNVo39.js +0 -10
- package/dist/public/assets/dialog-Blv3p5PJ.js +0 -45
- package/dist/public/assets/index-B3_TwSZA.css +0 -1
- package/dist/public/assets/index-BXFJIE7O.js +0 -1853
- package/dist/public/assets/mcp-consent-store-DZ1pCmhN.js +0 -1
- package/dist/public/assets/toggle-group-KbPGx9kK.js +0 -1
- package/dist/public/assets/tooltip-C-s5R-Gs.js +0 -1
- package/dist/start-D6YbKWO-.mjs +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{$ as i,Mn as a,Vt as o,hn as s,kn as c,n as l,on as u}from"./DocumentContext-DEXQEbv8.js";import{C as d,D as f,E as p,Gn as m,Jt as h,R as g,S as _,T as v,Xt as y,Yr as b,h as x,it as S,m as C,nt as w,p as T,qr as E,rt as D,tt as O,w as k,wn as A,z as j}from"./doc-hash-DRRChZD7.js";import{C as M,a as N,b as P,c as F,f as I,g as L,i as R,m as ee,o as z,p as B,r as V,s as te,t as H,u as U,v as ne,w as re,x as W,y as ie}from"./button-B-xLb7H7.js";import{n as ae}from"./dist-DETlERpz.js";import{S as oe,_ as se,a as ce,c as le,g as ue,i as de,n as G,o as fe,r as pe,s as me,t as he,v as ge,x as _e,y as ve}from"./dialog-BcU1169q.js";import{a as ye,i as be,r as xe}from"./toggle-group-Ba3po_CE.js";import{t as Se}from"./label-D7TT13L_.js";import{t as Ce}from"./input-UWVR4RR-.js";import{t as we}from"./textarea-2wg2OyKW.js";var Te=M(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ee=M(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),De=M(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Oe=M(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),ke=M(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),Ae=M(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),K=n(),q=r(),J=e(t(),1);function je(e,t){let n=(0,q.c)(7),r,i;n[0]!==e||n[1]!==t?(r=()=>{if(t!==`light`&&t!==`dark`&&t!==`system`||!e)return;let n=!1;return e.setThemeSource(t).catch(e=>{console.warn(JSON.stringify({event:`theme-source-set-failed`,themeValue:t,error:e instanceof Error?e.message:String(e)}))}).finally(()=>{if(n)return;let t=window.matchMedia(`(prefers-reduced-transparency: reduce)`).matches;e.signalThemeApplied({reducedTransparency:t})}),()=>{n=!0}},i=[e,t],n[0]=e,n[1]=t,n[2]=r,n[3]=i):(r=n[2],i=n[3]),(0,J.useEffect)(r,i);let a,o;n[4]===e?(a=n[5],o=n[6]):(a=()=>{if(!e)return;let t=window.matchMedia(`(prefers-reduced-transparency: reduce)`),n=t=>{e.signalThemeApplied({reducedTransparency:t.matches})};return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}},o=[e],n[4]=e,n[5]=a,n[6]=o),(0,J.useEffect)(a,o)}var Me=e(re());function Ne(e,t){let n=window.okDesktop?.shell?.openExternal;n&&(e.preventDefault(),n(t))}var Pe=[`Enter`,` `],Fe=[`ArrowDown`,`PageUp`,`Home`],Ie=[`ArrowUp`,`PageDown`,`End`],Le=[...Fe,...Ie],Re={ltr:[...Pe,`ArrowRight`],rtl:[...Pe,`ArrowLeft`]},ze={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Be=`Menu`,[Ve,He,Ue]=j(Be),[We,Ge]=I(Be,[Ue,f,ye]),Ke=f(),qe=ye(),[Je,Ye]=We(Be),[Xe,Ze]=We(Be),Qe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Ke(t),[c,l]=J.useState(null),u=J.useRef(!1),d=N(a),f=g(i);return J.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,K.jsx)(p,{...s,children:(0,K.jsx)(Je,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,K.jsx)(Xe,{scope:t,onClose:J.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Qe.displayName=Be;var $e=`MenuAnchor`,et=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Ke(n);return(0,K.jsx)(d,{...i,...r,ref:t})});et.displayName=$e;var tt=`MenuPortal`,[nt,rt]=We(tt,{forceMount:void 0}),it=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ye(tt,t);return(0,K.jsx)(nt,{scope:t,forceMount:n,children:(0,K.jsx)(te,{present:n||a.open,children:(0,K.jsx)(V,{asChild:!0,container:i,children:r})})})};it.displayName=tt;var at=`MenuContent`,[ot,st]=We(at),ct=J.forwardRef((e,t)=>{let n=rt(at,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ye(at,e.__scopeMenu),o=Ze(at,e.__scopeMenu);return(0,K.jsx)(Ve.Provider,{scope:e.__scopeMenu,children:(0,K.jsx)(te,{present:r||a.open,children:(0,K.jsx)(Ve.Slot,{scope:e.__scopeMenu,children:o.modal?(0,K.jsx)(lt,{...i,ref:t}):(0,K.jsx)(ut,{...i,ref:t})})})})}),lt=J.forwardRef((e,t)=>{let n=Ye(at,e.__scopeMenu),r=J.useRef(null),i=ie(t,r);return J.useEffect(()=>{let e=r.current;if(e)return ue(e)},[]),(0,K.jsx)(ft,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ut=J.forwardRef((e,t)=>{let n=Ye(at,e.__scopeMenu);return(0,K.jsx)(ft,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),dt=L(`MenuContent.ScrollLock`),ft=J.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Ye(at,n),_=Ze(at,n),y=Ke(n),b=qe(n),x=He(n),[S,C]=J.useState(null),w=J.useRef(null),T=ie(t,w,g.onContentChange),E=J.useRef(0),D=J.useRef(``),O=J.useRef(0),k=J.useRef(null),A=J.useRef(`right`),j=J.useRef(0),M=m?se:J.Fragment,N=m?{as:dt,allowPinchZoom:!0}:void 0,P=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Xt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};J.useEffect(()=>()=>window.clearTimeout(E.current),[]),ge();let F=J.useCallback(e=>A.current===k.current?.side&&Qt(e,k.current?.area),[]);return(0,K.jsx)(ot,{scope:n,searchRef:D,onItemEnter:J.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:J.useCallback(e=>{F(e)||(w.current?.focus(),C(null))},[F]),onTriggerLeave:J.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:O,onPointerGraceIntentChange:J.useCallback(e=>{k.current=e},[]),children:(0,K.jsx)(M,{...N,children:(0,K.jsx)(ve,{asChild:!0,trapped:i,onMountAutoFocus:U(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,K.jsx)(R,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,K.jsx)(be,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:U(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,K.jsx)(v,{role:`menu`,"aria-orientation":`vertical`,"data-state":Gt(g.open),"data-radix-menu-content":``,dir:_.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:U(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&P(e.key));let i=w.current;if(e.target!==i||!Le.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Ie.includes(e.key)&&a.reverse(),Jt(a)}),onBlur:U(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:U(e.onPointerMove,$t(e=>{let t=e.target,n=j.current!==e.clientX;e.currentTarget.contains(t)&&n&&(A.current=e.clientX>j.current?`right`:`left`,j.current=e.clientX)}))})})})})})})});ct.displayName=at;var pt=`MenuGroup`,mt=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,K.jsx)(B.div,{role:`group`,...r,ref:t})});mt.displayName=pt;var ht=`MenuLabel`,gt=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,K.jsx)(B.div,{...r,ref:t})});gt.displayName=ht;var _t=`MenuItem`,vt=`menu.itemSelect`,yt=J.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=J.useRef(null),o=Ze(_t,e.__scopeMenu),s=st(_t,e.__scopeMenu),c=ie(t,a),l=J.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(vt,{bubbles:!0,cancelable:!0});e.addEventListener(vt,e=>r?.(e),{once:!0}),ee(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,K.jsx)(bt,{...i,ref:c,disabled:n,onClick:U(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:U(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:U(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Pe.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});yt.displayName=_t;var bt=J.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=st(_t,n),s=qe(n),c=J.useRef(null),l=ie(t,c),[u,d]=J.useState(!1),[f,p]=J.useState(``);return J.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,K.jsx)(Ve.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,K.jsx)(xe,{asChild:!0,...s,focusable:!r,children:(0,K.jsx)(B.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:U(e.onPointerMove,$t(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,$t(e=>o.onItemLeave(e))),onFocus:U(e.onFocus,()=>d(!0)),onBlur:U(e.onBlur,()=>d(!1))})})})}),xt=`MenuCheckboxItem`,St=J.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,K.jsx)(At,{scope:e.__scopeMenu,checked:n,children:(0,K.jsx)(yt,{role:`menuitemcheckbox`,"aria-checked":Kt(n)?`mixed`:n,...i,ref:t,"data-state":qt(n),onSelect:U(i.onSelect,()=>r?.(Kt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});St.displayName=xt;var Ct=`MenuRadioGroup`,[wt,Tt]=We(Ct,{value:void 0,onValueChange:()=>{}}),Et=J.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=N(r);return(0,K.jsx)(wt,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,K.jsx)(mt,{...i,ref:t})})});Et.displayName=Ct;var Dt=`MenuRadioItem`,Ot=J.forwardRef((e,t)=>{let{value:n,...r}=e,i=Tt(Dt,e.__scopeMenu),a=n===i.value;return(0,K.jsx)(At,{scope:e.__scopeMenu,checked:a,children:(0,K.jsx)(yt,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":qt(a),onSelect:U(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ot.displayName=Dt;var kt=`MenuItemIndicator`,[At,jt]=We(kt,{checked:!1}),Mt=J.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=jt(kt,n);return(0,K.jsx)(te,{present:r||Kt(a.checked)||a.checked===!0,children:(0,K.jsx)(B.span,{...i,ref:t,"data-state":qt(a.checked)})})});Mt.displayName=kt;var Nt=`MenuSeparator`,Pt=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,K.jsx)(B.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Pt.displayName=Nt;var Ft=`MenuArrow`,It=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Ke(n);return(0,K.jsx)(k,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`MenuSub`,[Rt,zt]=We(Lt),Bt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ye(Lt,t),o=Ke(t),[s,c]=J.useState(null),[l,u]=J.useState(null),d=N(i);return J.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,K.jsx)(p,{...o,children:(0,K.jsx)(Je,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,K.jsx)(Rt,{scope:t,contentId:z(),triggerId:z(),trigger:s,onTriggerChange:c,children:n})})})};Bt.displayName=Lt;var Vt=`MenuSubTrigger`,Ht=J.forwardRef((e,t)=>{let n=Ye(Vt,e.__scopeMenu),r=Ze(Vt,e.__scopeMenu),i=zt(Vt,e.__scopeMenu),a=st(Vt,e.__scopeMenu),o=J.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=J.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return J.useEffect(()=>u,[u]),J.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,K.jsx)(et,{asChild:!0,...l,children:(0,K.jsx)(bt,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Gt(n.open),...e,ref:ne(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,$t(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:U(e.onPointerLeave,$t(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:U(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Re[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Ht.displayName=Vt;var Ut=`MenuSubContent`,Wt=J.forwardRef((e,t)=>{let n=rt(at,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ye(at,e.__scopeMenu),o=Ze(at,e.__scopeMenu),s=zt(Ut,e.__scopeMenu),c=J.useRef(null),l=ie(t,c);return(0,K.jsx)(Ve.Provider,{scope:e.__scopeMenu,children:(0,K.jsx)(te,{present:r||a.open,children:(0,K.jsx)(Ve.Slot,{scope:e.__scopeMenu,children:(0,K.jsx)(ft,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:U(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ze[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Wt.displayName=Ut;function Gt(e){return e?`open`:`closed`}function Kt(e){return e===`indeterminate`}function qt(e){return Kt(e)?`indeterminate`:e?`checked`:`unchecked`}function Jt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Yt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Xt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Yt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Zt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Qt(e,t){return t?Zt({x:e.clientX,y:e.clientY},t):!1}function $t(e){return t=>t.pointerType===`mouse`?e(t):void 0}var en=Qe,tn=et,nn=it,rn=ct,an=mt,on=gt,sn=yt,cn=St,ln=Et,un=Ot,dn=Mt,fn=Pt,pn=It,mn=Bt,hn=Ht,gn=Wt,_n=`DropdownMenu`,[vn,yn]=I(_n,[Ge]),Y=Ge(),[bn,xn]=vn(_n),Sn=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Y(t),l=J.useRef(null),[u,d]=F({prop:i,defaultProp:a??!1,onChange:o,caller:_n});return(0,K.jsx)(bn,{scope:t,triggerId:z(),triggerRef:l,contentId:z(),open:u,onOpenChange:d,onOpenToggle:J.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,K.jsx)(en,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Sn.displayName=_n;var Cn=`DropdownMenuTrigger`,wn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=xn(Cn,n),o=Y(n);return(0,K.jsx)(tn,{asChild:!0,...o,children:(0,K.jsx)(B.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:ne(t,a.triggerRef),onPointerDown:U(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:U(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});wn.displayName=Cn;var Tn=`DropdownMenuPortal`,En=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Y(t);return(0,K.jsx)(nn,{...r,...n})};En.displayName=Tn;var Dn=`DropdownMenuContent`,On=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xn(Dn,n),a=Y(n),o=J.useRef(!1);return(0,K.jsx)(rn,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:U(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});On.displayName=Dn;var kn=`DropdownMenuGroup`,An=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(an,{...i,...r,ref:t})});An.displayName=kn;var jn=`DropdownMenuLabel`,Mn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(on,{...i,...r,ref:t})});Mn.displayName=jn;var Nn=`DropdownMenuItem`,Pn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(sn,{...i,...r,ref:t})});Pn.displayName=Nn;var Fn=`DropdownMenuCheckboxItem`,In=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(cn,{...i,...r,ref:t})});In.displayName=Fn;var Ln=`DropdownMenuRadioGroup`,Rn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(ln,{...i,...r,ref:t})});Rn.displayName=Ln;var zn=`DropdownMenuRadioItem`,Bn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(un,{...i,...r,ref:t})});Bn.displayName=zn;var Vn=`DropdownMenuItemIndicator`,Hn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(dn,{...i,...r,ref:t})});Hn.displayName=Vn;var Un=`DropdownMenuSeparator`,Wn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(fn,{...i,...r,ref:t})});Wn.displayName=Un;var Gn=`DropdownMenuArrow`,Kn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(pn,{...i,...r,ref:t})});Kn.displayName=Gn;var qn=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Y(t),[s,c]=F({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,K.jsx)(mn,{...o,open:s,onOpenChange:c,children:n})},Jn=`DropdownMenuSubTrigger`,Yn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(hn,{...i,...r,ref:t})});Yn.displayName=Jn;var Xn=`DropdownMenuSubContent`,Zn=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y(n);return(0,K.jsx)(gn,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Zn.displayName=Xn;var Qn=Sn,$n=wn,er=En,tr=On,nr=Mn,rr=Pn,ir=Rn,ar=Bn,or=Hn,sr=Wn,cr=qn,lr=Yn,ur=Zn,dr=`Separator`,fr=`horizontal`,pr=[`horizontal`,`vertical`],mr=J.forwardRef((e,t)=>{let{decorative:n,orientation:r=fr,...i}=e,a=hr(r)?r:fr,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,K.jsx)(B.div,{"data-orientation":a,...o,...i,ref:t})});mr.displayName=dr;function hr(e){return pr.includes(e)}var gr=mr;function _r(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function vr(e){let t=(0,q.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,J.useState)(n),[a,o]=(0,J.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return x(()=>{o(Sr)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,J.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(br).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:`Server returned an incomplete folder response.`});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null,frontmatterSources:e.frontmatter_sources??{}}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,J.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(yr),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function yr(e){return e+1}async function br(e){if(!e.ok){let t=await e.json().catch(xr);throw Error(_(t)??`HTTP ${e.status}`)}return e.json()}function xr(){return null}function Sr(e){return e+1}function Cr(e,t,n){let r=(0,q.c)(6),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={status:`idle`},r[0]=i):i=r[0];let[a,o]=(0,J.useState)(i),s,c;return r[1]!==e||r[2]!==t||r[3]!==n?(s=()=>{if(!t){o({status:`idle`});return}if(n!==`user`&&e===null){o({status:`idle`});return}let r=!1;o({status:`loading`});let i=`?folder=${encodeURIComponent(n===`user`?``:e??``)}&name=${encodeURIComponent(t)}`;return n!==void 0&&(i+=`&target=${encodeURIComponent(n)}`),fetch(`/api/template${i}`).then(wr).then(e=>{if(!r){if(!e||typeof e!=`object`||!e.template){o({status:`error`,message:`Server returned an incomplete template response.`});return}o({status:`ready`,data:e.template})}}).catch(e=>{r||o({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{r=!0}},c=[e,t,n],r[1]=e,r[2]=t,r[3]=n,r[4]=s,r[5]=c):(s=r[4],c=r[5]),(0,J.useEffect)(s,c),a}async function wr(e){if(!e.ok){let t=await e.json().catch(Tr);throw Error(_(t)??`HTTP ${e.status}`)}return e.json()}function Tr(){return null}function Er(e){let t=(0,q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,orientation:i,decorative:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`horizontal`:i,s=a===void 0?!0:a,c;t[5]===n?c=t[6]:(c=W(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==o||t[9]!==r||t[10]!==c?(l=(0,K.jsx)(gr,{"data-slot":`separator`,decorative:s,orientation:o,className:c,...r}),t[7]=s,t[8]=o,t[9]=r,t[10]=c,t[11]=l):l=t[11],l}function Dr(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(`div`,{"data-slot":`field-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Or=P(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function kr(e){let t=(0,q.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]!==n||t[5]!==a?(o=W(Or({orientation:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,K.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":a,className:o,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function Ar(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(`div`,{"data-slot":`field-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jr(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(Se,{"data-slot":`field-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Mr(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(`div`,{"data-slot":`field-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nr(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(`p`,{"data-slot":`field-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pr(e){let t=(0,q.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,errors:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;bb0:{if(n){o=n;break bb0}if(!i?.length){o=null;break bb0}let e;t[5]===i?e=t[6]:(e=[...new Map(i.map(Ir)).values()],t[5]=i,t[6]=e);let r=e;if(r?.length===1){o=r[0]?.message;break bb0}let a;t[7]===r?a=t[8]:(a=(0,K.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:r.map(Fr)}),t[7]=r,t[8]=a),o=a}let s=o;if(!s)return null;let c;t[9]===r?c=t[10]:(c=W(`text-sm font-normal text-destructive`,r),t[9]=r,t[10]=c);let l;return t[11]!==s||t[12]!==a||t[13]!==c?(l=(0,K.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:c,...a,children:s}),t[11]=s,t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function Fr(e){return e?.message&&(0,K.jsx)(`li`,{children:e.message},e.message)}function Ir(e){return[e?.message,e]}async function Lr(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function Rr(){return zr().status}function zr(){let e=(0,q.c)(8),[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){Lr().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,J.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>C(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,J.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var Br=(0,J.createContext)(null);function Vr(e,t,n,r){console.warn(JSON.stringify({event:`ok-${e}-${n}`,docName:t,code:r?.code,reason:r?.reason??void 0}))}function Hr(e,t,n){let r=new o,a=new i({url:e,name:t,document:r,onDisconnect:({event:e})=>Vr(`config-provider`,t,`disconnect`,e),onClose:({event:e})=>Vr(`config-provider`,t,`close`,e)}),s=h(a,n);return{binding:s,config:s.current(),cleanup:()=>{s.dispose(),a.destroy(),r.destroy()}}}function Ur(e){let t=new o,n=new i({url:e,name:O,document:t,onDisconnect:({event:e})=>Vr(`okignore-provider`,O,`disconnect`,e),onClose:({event:e})=>Vr(`okignore-provider`,O,`close`,e)}),r=y(n);return{binding:r,provider:n,cleanup:()=>{r.dispose(),n.destroy(),t.destroy()}}}function Wr(e){let t=(0,q.c)(25),{children:n}=e,{collabUrl:r}=l(),[i,a]=(0,J.useState)(null),[o,s]=(0,J.useState)(null),[c,u]=(0,J.useState)(null),[d,f]=(0,J.useState)(null),p,h;t[0]===r?(p=t[1],h=t[2]):(p=()=>{if(r===null)return;let e=Hr(r,S,`user`),t=Hr(r,w,`project`),n=Hr(r,D,`project-local`),i=Ur(r);a({binding:e.binding,config:e.config}),s({binding:t.binding,config:t.config}),u({binding:n.binding,config:n.config,synced:n.binding.hasSynced()}),f({binding:i.binding,synced:!1});let o=e.binding.subscribe(t=>{a(n=>n?.binding===e.binding?{...n,config:t}:n)}),c=t.binding.subscribe(e=>{s(n=>n?.binding===t.binding?{...n,config:e}:n)}),l=n.binding.subscribe(e=>{u(t=>t?.binding===n.binding?{...t,config:e}:t)}),d=n.binding.subscribeSynced(()=>{u(e=>e?.binding===n.binding?{...e,synced:!0}:e)}),p=()=>{f(e=>e?.binding===i.binding?{...e,synced:!0}:e)};return i.provider.on(`synced`,p),()=>{o(),c(),l(),d(),i.provider.off(`synced`,p),e.cleanup(),t.cleanup(),n.cleanup(),i.cleanup(),a(t=>t?.binding===e.binding?null:t),s(e=>e?.binding===t.binding?null:e),u(e=>e?.binding===n.binding?null:e),f(e=>e?.binding===i.binding?null:e)}},h=[r],t[0]=r,t[1]=p,t[2]=h),(0,J.useEffect)(p,h);let g;t[3]!==c?.config||t[4]!==o||t[5]!==i?(g=i&&o?m(i.config,o.config,c?.config):null,t[3]=c?.config,t[4]=o,t[5]=i,t[6]=g):g=t[6];let _=g,{setTheme:v}=b(),y=_?.appearance?.theme,x,C;t[7]!==v||t[8]!==y?(x=()=>{(y===`light`||y===`dark`||y===`system`)&&v(y)},C=[y,v],t[7]=v,t[8]=y,t[9]=x,t[10]=C):(x=t[9],C=t[10]),(0,J.useEffect)(x,C),je(typeof window<`u`?window.okDesktop:void 0,y??`system`);let T=i?.binding??null,E=o?.binding??null,O=c?.binding??null,k=d?.binding??null,A=d?.synced??!1,j=i?.config??null,M=o?.config??null,N=c?.config??null,P=c?.synced??!1,F;t[11]!==_||t[12]!==A||t[13]!==j||t[14]!==M||t[15]!==N||t[16]!==P||t[17]!==T||t[18]!==E||t[19]!==O||t[20]!==k?(F={userBinding:T,projectBinding:E,projectLocalBinding:O,okignoreBinding:k,okignoreSynced:A,userConfig:j,projectConfig:M,projectLocalConfig:N,projectLocalSynced:P,merged:_},t[11]=_,t[12]=A,t[13]=j,t[14]=M,t[15]=N,t[16]=P,t[17]=T,t[18]=E,t[19]=O,t[20]=k,t[21]=F):F=t[21];let I=F,L;return t[22]!==n||t[23]!==I?(L=(0,K.jsx)(Br,{value:I,children:n}),t[22]=n,t[23]=I,t[24]=L):L=t[24],L}function Gr(){let e=(0,J.use)(Br);if(e===null)throw Error(`useConfigContext must be used within <ConfigProvider />`);return e}function Kr(){let e=(0,q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(le,{children:`Enable git auto-sync?`}),(0,K.jsx)(ce,{children:`Auto-sync periodically fetches, pulls, and pushes commits to your remote git repository so your edits stay in sync across machines.`})]}),e[0]=t):t=e[0],t}function qr(){let e=(0,q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsx)(`p`,{className:`mb-2 text-sm font-medium`,children:`Before you enable it:`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,K.jsxs)(K.Fragment,{children:[t,(0,K.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5 text-sm text-muted-foreground`,children:[(0,K.jsx)(`li`,{children:`Pulls may overwrite uncommitted local file changes.`}),(0,K.jsx)(`li`,{children:`If you do not want automatic commits in your git history, you should not enable auto-sync.`})]})]}),e[1]=n):n=e[1],n}function Jr(){let e=(0,q.c)(2),{projectLocalBinding:t}=Gr();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{enabled:e}});return n.ok?{ok:!0}:{ok:!1,error:A(n.error)}},e[0]=t,e[1]=n),n}function Yr(e){let t=(0,q.c)(10),[n,r]=(0,J.useState)(!1),i;t[0]===e?i=t[1]:(i=function(t){if(e===null)return _e.error(`Sync settings not yet loaded — try again in a moment`),!1;let n=e(t);return n.ok?!0:(console.error(`[sync] toggle failed:`,n.error),_e.error(`Failed to ${t?`enable`:`disable`} sync — ${n.error}`),!1)},t[0]=e,t[1]=i);let a=i,o;t[2]===a?o=t[3]:(o=function(e){if(e){r(!0);return}a(!1)},t[2]=a,t[3]=o);let s=o,c;t[4]===a?c=t[5]:(c=function(){a(!0)&&r(!1)},t[4]=a,t[5]=c);let l=c,u;return t[6]!==n||t[7]!==l||t[8]!==s?(u={confirmOpen:n,setConfirmOpen:r,onToggleRequest:s,onConfirm:l},t[6]=n,t[7]=l,t[8]=s,t[9]=u):u=t[9],u}function Xr(e){let t=(0,q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(Qn,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function Zr(e){let t=(0,q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)($n,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function Qr(e){let t=(0,q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`start`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=W(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,K.jsx)(er,{children:(0,K.jsx)(tr,{"data-slot":`dropdown-menu-content`,sideOffset:s,align:o,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function $r(e){let t=(0,q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=W(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,K.jsx)(rr,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function ei(e){let t=(0,q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(ir,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function ti(e){let t=(0,q.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,inset:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=W(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,K.jsx)(or,{children:(0,K.jsx)(ae,{})})}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,K.jsxs)(ar,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:o,...a,children:[s,n]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function ni(e){let t=(0,q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=W(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,K.jsx)(nr,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function ri(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(sr,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ii(e){let t=(0,q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(cr,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function ai(e){let t=(0,q.c)(13),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,inset:i,children:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s;t[5]===r?s=t[6]:(s=W(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(a,{className:`ml-auto`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,K.jsxs)(lr,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":i,className:s,...o,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function oi(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=W(`z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(ur,{"data-slot":`dropdown-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function si(){var e=[...arguments];return(0,J.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var ci=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function li(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function ui(e){return`nodeType`in e}function X(e){return e?li(e)?e:ui(e)?e.ownerDocument?.defaultView??window:window:window}function di(e){let{Document:t}=X(e);return e instanceof t}function fi(e){return li(e)?!1:e instanceof X(e).HTMLElement}function pi(e){return e instanceof X(e).SVGElement}function mi(e){return e?li(e)?e.document:ui(e)?di(e)?e:fi(e)||pi(e)?e.ownerDocument:document:document:document}var hi=ci?J.useLayoutEffect:J.useEffect;function gi(e){let t=(0,J.useRef)(e);return hi(()=>{t.current=e}),(0,J.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function _i(){let e=(0,J.useRef)(null);return[(0,J.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,J.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function vi(e,t){t===void 0&&(t=[e]);let n=(0,J.useRef)(e);return hi(()=>{n.current!==e&&(n.current=e)},t),n}function yi(e,t){let n=(0,J.useRef)();return(0,J.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function bi(e){let t=gi(e),n=(0,J.useRef)(null);return[n,(0,J.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function xi(e){let t=(0,J.useRef)();return(0,J.useEffect)(()=>{t.current=e},[e]),t.current}var Si={};function Ci(e,t){return(0,J.useMemo)(()=>{if(t)return t;let n=Si[e]==null?0:Si[e]+1;return Si[e]=n,e+`-`+n},[e,t])}function wi(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Ti=wi(1),Ei=wi(-1);function Di(e){return`clientX`in e&&`clientY`in e}function Oi(e){if(!e)return!1;let{KeyboardEvent:t}=X(e.target);return t&&e instanceof t}function ki(e){if(!e)return!1;let{TouchEvent:t}=X(e.target);return t&&e instanceof t}function Ai(e){if(ki(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Di(e)?{x:e.clientX,y:e.clientY}:null}var ji=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[ji.Translate.toString(e),ji.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Mi=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ni(e){return e.matches(Mi)?e:e.querySelector(Mi)}var Pi={display:`none`};function Fi(e){let{id:t,value:n}=e;return J.createElement(`div`,{id:t,style:Pi},n)}function Ii(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return J.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Li(){let[e,t]=(0,J.useState)(``);return{announce:(0,J.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Ri=(0,J.createContext)(null);function zi(e){let t=(0,J.useContext)(Ri);(0,J.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Bi(){let[e]=(0,J.useState)(()=>new Set),t=(0,J.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,J.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Vi={draggable:`
|
|
2
|
+
To pick up a draggable item, press the space bar.
|
|
3
|
+
While dragging, use the arrow keys to move the item.
|
|
4
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
+
`},Hi={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Ui(e){let{announcements:t=Hi,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Vi}=e,{announce:a,announcement:o}=Li(),s=Ci(`DndLiveRegion`),[c,l]=(0,J.useState)(!1);if((0,J.useEffect)(()=>{l(!0)},[]),zi((0,J.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=J.createElement(J.Fragment,null,J.createElement(Fi,{id:r,value:i.draggable}),J.createElement(Ii,{id:s,announcement:o}));return n?(0,Me.createPortal)(u,n):u}var Z;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(Z||={});function Wi(){}function Gi(e,t){return(0,J.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Ki(){var e=[...arguments];return(0,J.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var qi=Object.freeze({x:0,y:0});function Ji(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Yi(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Xi(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Zi(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Qi(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function $i(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var ea=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=$i(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Ji($i(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(Yi)},ta=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Zi(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Zi(r),o=i.reduce((e,t,r)=>e+Ji(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Yi)};function na(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var ra=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=na(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Xi)};function ia(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function aa(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:qi}function oa(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var sa=oa(1);function ca(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function la(e,t,n){let r=ca(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var ua={ignoreTransform:!1};function da(e,t){t===void 0&&(t=ua);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=X(e).getComputedStyle(e);t&&(n=la(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function fa(e){return da(e,{ignoreTransform:!0})}function pa(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function ma(e,t){return t===void 0&&(t=X(e).getComputedStyle(e)),t.position===`fixed`}function ha(e,t){t===void 0&&(t=X(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function ga(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(di(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!fi(i)||pi(i)||n.includes(i))return n;let a=X(e).getComputedStyle(i);return i!==e&&ha(i,a)&&n.push(i),ma(i,a)?n:r(i.parentNode)}return e?r(e):n}function _a(e){let[t]=ga(e,1);return t??null}function va(e){return!ci||!e?null:li(e)?e:ui(e)?di(e)||e===mi(e).scrollingElement?window:fi(e)?e:null:null}function ya(e){return li(e)?e.scrollX:e.scrollLeft}function ba(e){return li(e)?e.scrollY:e.scrollTop}function xa(e){return{x:ya(e),y:ba(e)}}var Q;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Q||={});function Sa(e){return!ci||!e?!1:e===document.scrollingElement}function Ca(e){let t={x:0,y:0},n=Sa(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var wa={x:.2,y:.2};function Ta(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=wa);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Ca(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=Q.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Q.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Q.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Q.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Ea(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Da(e){return e.reduce((e,t)=>Ti(e,xa(t)),qi)}function Oa(e){return e.reduce((e,t)=>e+ya(t),0)}function ka(e){return e.reduce((e,t)=>e+ba(t),0)}function Aa(e,t){if(t===void 0&&(t=da),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);_a(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var ja=[[`x`,[`left`,`right`],Oa],[`y`,[`top`,`bottom`],ka]],Ma=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=ga(t),r=Da(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of ja)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},Na=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Pa(e){let{EventTarget:t}=X(e);return e instanceof t?e:mi(e)}function Fa(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var Ia;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Ia||={});function La(e){e.preventDefault()}function Ra(e){e.stopPropagation()}var $;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})($||={});var za={start:[$.Space,$.Enter],cancel:[$.Esc],end:[$.Space,$.Enter,$.Tab]},Ba=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case $.Right:return{...n,x:n.x+25};case $.Left:return{...n,x:n.x-25};case $.Down:return{...n,y:n.y+25};case $.Up:return{...n,y:n.y-25}}},Va=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Na(mi(t)),this.windowListeners=new Na(X(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ia.Resize,this.handleCancel),this.windowListeners.add(Ia.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ia.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Aa(n),t(qi)}handleKeyDown(e){if(Oi(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=za,coordinateGetter:a=Ba,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:qi;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Ei(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Ca(n),p=Ea(n),m={x:Math.min(i===$.Right?p.right-p.width/2:p.right,Math.max(i===$.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===$.Down?p.bottom-p.height/2:p.bottom,Math.max(i===$.Down?p.top:p.top+p.height/2,u.y))},h=i===$.Right&&!s||i===$.Left&&!c,g=i===$.Down&&!l||i===$.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===$.Right&&e<=d.x||i===$.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===$.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===$.Down&&e<=d.y||i===$.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===$.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Ti(Ei(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Va.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=za,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Ha(e){return!!(e&&`distance`in e)}function Ua(e){return!!(e&&`delay`in e)}var Wa=class{constructor(e,t,n){n===void 0&&(n=Pa(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=mi(i),this.documentListeners=new Na(this.document),this.listeners=new Na(n),this.windowListeners=new Na(X(i)),this.initialCoordinates=Ai(r)??qi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Ia.Resize,this.handleCancel),this.windowListeners.add(Ia.DragStart,La),this.windowListeners.add(Ia.VisibilityChange,this.handleCancel),this.windowListeners.add(Ia.ContextMenu,La),this.documentListeners.add(Ia.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ua(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Ha(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ia.Click,Ra,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ia.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Ai(e)??qi,s=Ei(n,o);if(!t&&a){if(Ha(a)){if(a.tolerance!=null&&Fa(s,a.tolerance))return this.handleCancel();if(Fa(s,a.distance))return this.handleStart()}if(Ua(a)&&Fa(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===$.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Ga={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Ka=class extends Wa{constructor(e){let{event:t}=e,n=mi(t.target);super(e,Ga,n)}};Ka.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var qa={move:{name:`mousemove`},end:{name:`mouseup`}},Ja;(function(e){e[e.RightClick=2]=`RightClick`})(Ja||={});var Ya=class extends Wa{constructor(e){super(e,qa,mi(e.event.target))}};Ya.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Ja.RightClick?!1:(r?.({event:n}),!0)}}];var Xa={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Za=class extends Wa{constructor(e){super(e,Xa)}static setup(){return window.addEventListener(Xa.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Xa.move.name,e)};function e(){}}};Za.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Qa;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Qa||={});var $a;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})($a||={});function eo(e){let{acceleration:t,activator:n=Qa.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=$a.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=no({delta:d,disabled:!a}),[m,h]=_i(),g=(0,J.useRef)({x:0,y:0}),_=(0,J.useRef)({x:0,y:0}),v=(0,J.useMemo)(()=>{switch(n){case Qa.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Qa.DraggableRect:return i}},[n,i,c]),y=(0,J.useRef)(null),b=(0,J.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,J.useMemo)(()=>s===$a.TreeOrder?[...l].reverse():l,[s,l]);(0,J.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=Ta(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var to={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function no(e){let{delta:t,disabled:n}=e,r=xi(t);return yi(e=>{if(n||!r||!e)return to;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Q.Backward]:e.x[Q.Backward]||i.x===-1,[Q.Forward]:e.x[Q.Forward]||i.x===1},y:{[Q.Backward]:e.y[Q.Backward]||i.y===-1,[Q.Forward]:e.y[Q.Forward]||i.y===1}}},[n,t,r])}function ro(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return yi(e=>t==null?null:r??e??null,[r,t])}function io(e,t){return(0,J.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var ao;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(ao||={});var oo;(function(e){e.Optimized=`optimized`})(oo||={});var so=new Map;function co(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,J.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,J.useRef)(e),d=g(),f=vi(d),p=(0,J.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,J.useRef)(null),h=yi(t=>{if(d&&!n)return so;if(!t||t===so||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Ma(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,J.useEffect)(()=>{u.current=e},[e]),(0,J.useEffect)(()=>{d||p()},[n,d]),(0,J.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,J.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case ao.Always:return!1;case ao.BeforeDragging:return n;default:return!n}}}function lo(e,t){return yi(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function uo(e,t){return lo(e,t)}function fo(e){let{callback:t,disabled:n}=e,r=gi(t),i=(0,J.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,J.useEffect)(()=>()=>i?.disconnect(),[i]),i}function po(e){let{callback:t,disabled:n}=e,r=gi(t),i=(0,J.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,J.useEffect)(()=>()=>i?.disconnect(),[i]),i}function mo(e){return new Ma(da(e),e)}function ho(e,t,n){t===void 0&&(t=mo);let[r,i]=(0,J.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=fo({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=po({callback:a});return hi(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function go(e){return aa(e,lo(e))}var _o=[];function vo(e){let t=(0,J.useRef)(e),n=yi(n=>e?n&&n!==_o&&e&&t.current&&e.parentNode===t.current.parentNode?n:ga(e):_o,[e]);return(0,J.useEffect)(()=>{t.current=e},[e]),n}function yo(e){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(e),i=(0,J.useCallback)(e=>{let t=va(e.target);t&&n(e=>e?(e.set(t,xa(t)),new Map(e)):null)},[]);return(0,J.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=va(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,xa(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{va(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,J.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Ti(e,t),qi):Da(e):qi,[e,t])}function bo(e,t){t===void 0&&(t=[]);let n=(0,J.useRef)(null);return(0,J.useEffect)(()=>{n.current=null},t),(0,J.useEffect)(()=>{let t=e!==qi;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Ei(e,n.current):qi}function xo(e){(0,J.useEffect)(()=>{if(!ci)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function So(e,t){return(0,J.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function Co(e){return(0,J.useMemo)(()=>e?pa(e):null,[e])}var wo=[];function To(e,t){t===void 0&&(t=da);let[n]=e,r=Co(n?X(n):null),[i,a]=(0,J.useState)(wo);function o(){a(()=>e.length?e.map(e=>Sa(e)?r:new Ma(t(e),e)):wo)}let s=po({callback:o});return hi(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function Eo(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return fi(t)?t:e}function Do(e){let{measure:t}=e,[n,r]=(0,J.useState)(null),i=po({callback:(0,J.useCallback)(e=>{for(let{target:n}of e)if(fi(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=bi((0,J.useCallback)(e=>{let n=Eo(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,J.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Oo=[{sensor:Ka,options:{}},{sensor:Va,options:{}}],ko={current:{}},Ao={draggable:{measure:fa},droppable:{measure:fa,strategy:ao.WhileDragging,frequency:oo.Optimized},dragOverlay:{measure:da}},jo=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Mo={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Wi},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ao,measureDroppableContainers:Wi,windowRect:null,measuringScheduled:!1},No={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Wi,draggableNodes:new Map,over:null,measureDroppableContainers:Wi},Po=(0,J.createContext)(No),Fo=(0,J.createContext)(Mo);function Io(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jo}}}function Lo(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new jo(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Z.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new jo(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Z.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new jo(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Ro(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,J.useContext)(Po),a=xi(r),o=xi(n?.id);return(0,J.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!Oi(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Ni(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function zo(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Bo(e){return(0,J.useMemo)(()=>({draggable:{...Ao.draggable,...e?.draggable},droppable:{...Ao.droppable,...e?.droppable},dragOverlay:{...Ao.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Vo(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,J.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;hi(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=aa(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=_a(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Ho=(0,J.createContext)({...qi,scaleX:1,scaleY:1}),Uo;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Uo||={});var Wo=(0,J.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Oo,collisionDetection:o=ra,measuring:s,modifiers:c,...l}=e,[u,d]=(0,J.useReducer)(Lo,void 0,Io),[f,p]=Bi(),[m,h]=(0,J.useState)(Uo.Uninitialized),g=m===Uo.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,J.useRef)({initial:null,translated:null}),C=(0,J.useMemo)(()=>_==null?null:{id:_,data:x?.data??ko,rect:S},[_,x]),w=(0,J.useRef)(null),[T,E]=(0,J.useState)(null),[D,O]=(0,J.useState)(null),k=vi(l,Object.values(l)),A=Ci(`DndDescribedBy`,t),j=(0,J.useMemo)(()=>b.getEnabled(),[b]),M=Bo(s),{droppableRects:N,measureDroppableContainers:P,measuringScheduled:F}=co(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),I=ro(v,_),L=(0,J.useMemo)(()=>D?Ai(D):null,[D]),R=Ce(),ee=uo(I,M.draggable.measure);Vo({activeNode:_==null?null:v.get(_),config:R.layoutShiftCompensation,initialRect:ee,measure:M.draggable.measure});let z=ho(I,M.draggable.measure,ee),B=ho(I?I.parentElement:null),V=(0,J.useRef)({activatorEvent:null,active:null,activeNode:I,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),te=b.getNodeFor(V.current.over?.id),H=Do({measure:M.dragOverlay.measure}),U=H.nodeRef.current??I,ne=g?H.rect??z:null,re=!!(H.nodeRef.current&&H.rect),W=go(re?null:z),ie=Co(U?X(U):null),ae=vo(g?te??I:null),oe=To(ae),se=zo(c,{transform:{x:y.x-W.x,y:y.y-W.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:z,containerNodeRect:B,draggingNodeRect:ne,over:V.current.over,overlayNodeRect:H.rect,scrollableAncestors:ae,scrollableAncestorRects:oe,windowRect:ie}),ce=L?Ti(L,y):null,le=yo(ae),ue=bo(le),de=bo(le,[z]),G=Ti(se,ue),fe=ne?sa(ne,se):null,pe=C&&fe?o({active:C,collisionRect:fe,droppableRects:N,droppableContainers:j,pointerCoordinates:ce}):null,me=Qi(pe,`id`),[he,ge]=(0,J.useState)(null),_e=ia(re?se:Ti(se,de),he?.rect??null,z),ve=(0,J.useRef)(null),ye=(0,J.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;ve.current=new n({active:w.current,activeNode:i,event:a,options:r,context:V,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Me.unstable_batchedUpdates)(()=>{r?.(i),h(Uo.Initializing),d({type:Z.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(ve.current),O(a)})},onMove(e){d({type:Z.DragMove,coordinates:e})},onEnd:o(Z.DragEnd),onCancel:o(Z.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=V.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Z.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Z.DragCancel)}w.current=null,(0,Me.unstable_batchedUpdates)(()=>{d({type:e}),h(Uo.Uninitialized),ge(null),E(null),O(null),ve.current=null;let t=e===Z.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),be=io(a,(0,J.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,ye(n,t))},[v,ye]));xo(a),hi(()=>{z&&m===Uo.Initializing&&h(Uo.Initialized)},[z,m]),(0,J.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=V.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:G.x,y:G.y},over:i};(0,Me.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[G.x,G.y]),(0,J.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=V.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(me),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Me.unstable_batchedUpdates)(()=>{ge(s),a?.(c),f({type:`onDragOver`,event:c})})},[me]),hi(()=>{V.current={activatorEvent:D,active:C,activeNode:I,collisionRect:fe,collisions:pe,droppableRects:N,draggableNodes:v,draggingNode:U,draggingNodeRect:ne,droppableContainers:b,over:he,scrollableAncestors:ae,scrollAdjustedTranslate:G},S.current={initial:ne,translated:fe}},[C,I,pe,fe,v,U,ne,N,b,he,ae,G]),eo({...R,delta:y,draggingRect:fe,pointerCoordinates:ce,scrollableAncestors:ae,scrollableAncestorRects:oe});let xe=(0,J.useMemo)(()=>({active:C,activeNode:I,activeNodeRect:z,activatorEvent:D,collisions:pe,containerNodeRect:B,dragOverlay:H,draggableNodes:v,droppableContainers:b,droppableRects:N,over:he,measureDroppableContainers:P,scrollableAncestors:ae,scrollableAncestorRects:oe,measuringConfiguration:M,measuringScheduled:F,windowRect:ie}),[C,I,z,D,pe,B,H,v,b,N,he,P,ae,oe,M,F,ie]),Se=(0,J.useMemo)(()=>({activatorEvent:D,activators:be,active:C,activeNodeRect:z,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:he,measureDroppableContainers:P}),[D,be,C,z,d,A,v,he,P]);return J.createElement(Ri.Provider,{value:p},J.createElement(Po.Provider,{value:Se},J.createElement(Fo.Provider,{value:xe},J.createElement(Ho.Provider,{value:_e},i)),J.createElement(Ro,{disabled:n?.restoreFocus===!1})),J.createElement(Ui,{...n,hiddenTextDescribedById:A}));function Ce(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Go=(0,J.createContext)(null),Ko=`button`,qo=`Draggable`;function Jo(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Ci(qo),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,J.useContext)(Po),{role:p=Ko,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,J.useContext)(g?Ho:Go),[v,y]=bi(),[b,x]=bi(),S=So(o,t),C=vi(n);return hi(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,J.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Ko?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Yo(){return(0,J.useContext)(Fo)}var Xo=`Droppable`,Zo={timeout:25};function Qo(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Ci(Xo),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,J.useContext)(Po),u=(0,J.useRef)({disabled:n}),d=(0,J.useRef)(!1),f=(0,J.useRef)(null),p=(0,J.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Zo,...i},_=vi(h??r),v=po({callback:(0,J.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=bi((0,J.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=vi(t);return(0,J.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,J.useEffect)(()=>(s({type:Z.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Z.UnregisterDroppable,key:a,id:r})),[r]),(0,J.useEffect)(()=>{n!==u.current.disabled&&(s({type:Z.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function $o(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function es(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function ts(e){return e!==null&&e>=0}function ns(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function rs(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var is=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=$o(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},as={scaleX:1,scaleY:1},os=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...as}:null}let s=ss(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...as}:r<t&&r>=a?{x:0,y:o.height+s,...as}:{x:0,y:0,...as}};function ss(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var cs=`Sortable`,ls=J.createContext({activeIndex:-1,containerId:cs,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:is,disabled:{draggable:!1,droppable:!1}});function us(e){let{children:t,id:n,items:r,strategy:i=is,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Yo(),d=Ci(cs,n),f=s.rect!==null,p=(0,J.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,J.useRef)(p),v=!ns(p,_.current),y=g!==-1&&h===-1||v,b=rs(a);hi(()=>{v&&m&&u(p)},[v,p,m,u]),(0,J.useEffect)(()=>{_.current=p},[p]);let x=(0,J.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:es(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return J.createElement(ls.Provider,{value:x},t)}var ds=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return $o(n,r,i).indexOf(t)},fs=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},ps={duration:200,easing:`ease`},ms=`transform`,hs=ji.Transition.toString({property:ms,duration:0,easing:`linear`}),gs={roleDescription:`sortable`};function _s(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,J.useState)(null),s=(0,J.useRef)(n);return hi(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=da(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,J.useEffect)(()=>{a&&o(null)},[a]),a}function vs(e){let{animateLayoutChanges:t=fs,attributes:n,disabled:r,data:i,getNewIndex:a=ds,id:o,strategy:s,resizeObserverConfig:c,transition:l=ps}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,J.useContext)(ls),y=ys(r,p),b=u.indexOf(o),x=(0,J.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,J.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=Qo({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:P,setActivatorNodeRef:F,transform:I}=Jo({id:o,data:x,attributes:{...gs,...n},disabled:y.draggable}),L=si(E,j),R=!!D,ee=R&&!m&&ts(f)&&ts(g),z=!_&&N,B=ee?(z&&ee?I:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,V=ts(f)&&ts(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,te=D?.id,H=(0,J.useRef)({activeId:te,items:u,newIndex:V,containerId:d}),U=u!==H.current.items,ne=t({active:D,containerId:d,isDragging:N,isSorting:R,id:o,index:b,items:u,newIndex:H.current.newIndex,previousItems:H.current.items,previousContainerId:H.current.containerId,transition:l,wasDragging:H.current.activeId!=null}),re=_s({disabled:!ne,index:b,node:w,rect:C});return(0,J.useEffect)(()=>{R&&H.current.newIndex!==V&&(H.current.newIndex=V),d!==H.current.containerId&&(H.current.containerId=d),u!==H.current.items&&(H.current.items=u)},[R,V,d,u]),(0,J.useEffect)(()=>{if(te===H.current.activeId)return;if(te!=null&&H.current.activeId==null){H.current.activeId=te;return}let e=setTimeout(()=>{H.current.activeId=te},50);return()=>clearTimeout(e)},[te]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:V,items:u,isOver:T,isSorting:R,isDragging:N,listeners:M,node:w,overIndex:g,over:P,setNodeRef:L,setActivatorNodeRef:F,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:re??B,transition:W()};function W(){if(re||U&&H.current.newIndex===b)return hs;if(!(z&&!Oi(O)||!l)&&(R||ne))return ji.Transition.toString({...l,property:ms})}}function ys(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function bs(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var xs=[$.Down,$.Right,$.Up,$.Left],Ss=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(xs.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case $.Down:r.top<a.top&&t.push(n);break;case $.Up:r.top>a.top&&t.push(n);break;case $.Left:r.left>a.left&&t.push(n);break;case $.Right:r.left<a.left&&t.push(n);break}});let c=ta({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=Qi(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=ga(c).some((e,t)=>s[t]!==e),i=Cs(e,t),a=ws(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:Ei(u,l)}}}};function Cs(e,t){return!bs(e)||!bs(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function ws(e,t){return!bs(e)||!bs(t)||!Cs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}async function Ts(e){return _(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function Es(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await Ts(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Ds(e){try{let t=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await Ts(t)};let n=await t.json().catch(()=>null);return T(),{ok:!0,created:n?.created??!1,warnings:n?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Os(e,t,n){try{let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`;n!==void 0&&(r+=`&target=${encodeURIComponent(n)}`);let i=await fetch(`/api/template${r}`,{method:`DELETE`});if(!i.ok)return{ok:!1,error:await Ts(i)};let a=await i.json().catch(()=>null);return T(),{ok:!0,existed:a?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function ks(e){return e===``?`.ok/frontmatter.yml`:`${e}/.ok/frontmatter.yml`}function As(e,t){return e===``?`.ok/templates/${t}.md`:`${e}/.ok/templates/${t}.md`}function js(e){let t=(0,q.c)(22),{itemName:n,isSubmitting:r,onDelete:i,customTitle:a,customDescription:o,children:c}=e,l=n===void 0?`this item`:n,u=a??`Delete ${l}`,d;t[0]===u?d=t[1]:(d=(0,K.jsx)(le,{children:u}),t[0]=u,t[1]=d);let f=o??`Are you sure you want to delete ${l}? This action cannot be undone.`,p;t[2]===f?p=t[3]:(p=(0,K.jsx)(ce,{className:`whitespace-pre-wrap`,children:f}),t[2]=f,t[3]=p);let m;t[4]===c?m=t[5]:(m=c?(0,K.jsx)(G,{children:c}):null,t[4]=c,t[5]=m);let h;t[6]===r?h=t[7]:(h=(0,K.jsx)(pe,{asChild:!0,children:(0,K.jsx)(H,{variant:`outline`,disabled:r,children:`Cancel`})}),t[6]=r,t[7]=h);let g;t[8]===r?g=t[9]:(g=r?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(s,{className:`size-4 animate-spin`}),` Deleting`]}):`Delete`,t[8]=r,t[9]=g);let _;t[10]!==r||t[11]!==i||t[12]!==g?(_=(0,K.jsx)(H,{variant:`destructive`,onClick:i,disabled:r,children:g}),t[10]=r,t[11]=i,t[12]=g,t[13]=_):_=t[13];let v;t[14]!==h||t[15]!==_?(v=(0,K.jsxs)(fe,{children:[h,_]}),t[14]=h,t[15]=_,t[16]=v):v=t[16];let y;return t[17]!==v||t[18]!==d||t[19]!==p||t[20]!==m?(y=(0,K.jsxs)(de,{children:[d,p,m,v]}),t[17]=v,t[18]=d,t[19]=p,t[20]=m,t[21]=y):y=t[21],y}function Ms(e){let t=(0,q.c)(40),{value:n,onChange:r,onBlur:i,placeholder:a,id:o,disabled:s,"aria-describedby":c,"aria-invalid":l,ref:d}=e,f=a===void 0?`Add tag`:a,[p,m]=(0,J.useState)(``),h;t[0]!==r||t[1]!==n?(h=e=>{let t=e.trim();if(t){if(n.includes(t)){m(``);return}r([...n,t]),m(``)}},t[0]=r,t[1]=n,t[2]=h):h=t[2];let g=h,_;t[3]!==r||t[4]!==n?(_=e=>{r(n.filter((t,n)=>n!==e))},t[3]=r,t[4]=n,t[5]=_):_=t[5];let v=_,y=s&&`pointer-events-none opacity-60`,b;t[6]===y?b=t[7]:(b=W(`flex min-h-8 w-full flex-wrap items-center gap-1.5 rounded-lg border border-input bg-transparent px-2 py-1 text-sm transition-colors`,`focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,`dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,y),t[6]=y,t[7]=b);let x;if(t[8]!==s||t[9]!==v||t[10]!==n){let e;t[12]!==s||t[13]!==v?(e=(e,t)=>(0,K.jsxs)(u,{variant:`secondary`,className:`gap-1 pl-2 pr-1`,children:[(0,K.jsx)(`span`,{className:`font-mono`,children:e}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(t),"aria-label":`Remove ${e}`,className:`rounded-sm p-0.5 hover:bg-background/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,disabled:s,children:(0,K.jsx)(oe,{className:`size-3`,"aria-hidden":`true`})})]},e),t[12]=s,t[13]=v,t[14]=e):e=t[14],x=n.map(e),t[8]=s,t[9]=v,t[10]=n,t[11]=x}else x=t[11];let S;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>m(e.target.value),t[15]=S):S=t[15];let C;t[16]!==g||t[17]!==p||t[18]!==v||t[19]!==n.length?(C=e=>{e.key===`Enter`?p.trim()&&(e.preventDefault(),g(p)):e.key===`,`?(e.preventDefault(),p.trim()&&g(p)):e.key===`Tab`?p.trim()&&(e.preventDefault(),g(p)):e.key===`Backspace`&&p===``&&n.length>0&&(e.preventDefault(),v(n.length-1))},t[16]=g,t[17]=p,t[18]=v,t[19]=n.length,t[20]=C):C=t[20];let w;t[21]!==g||t[22]!==p||t[23]!==i?(w=()=>{p.trim()&&g(p),i?.()},t[21]=g,t[22]=p,t[23]=i,t[24]=w):w=t[24];let T=n.length===0?f:``,E;t[25]!==c||t[26]!==l||t[27]!==s||t[28]!==p||t[29]!==o||t[30]!==d||t[31]!==T||t[32]!==C||t[33]!==w?(E=(0,K.jsx)(`input`,{id:o,ref:d,type:`text`,value:p,onChange:S,onKeyDown:C,onBlur:w,placeholder:T,"aria-describedby":c,"aria-invalid":l,disabled:s,className:`min-w-[8ch] flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`}),t[25]=c,t[26]=l,t[27]=s,t[28]=p,t[29]=o,t[30]=d,t[31]=T,t[32]=C,t[33]=w,t[34]=E):E=t[34];let D;return t[35]!==l||t[36]!==E||t[37]!==b||t[38]!==x?(D=(0,K.jsxs)(`div`,{"data-slot":`tag-pill-input`,"aria-invalid":l,className:b,children:[x,E]}),t[35]=l,t[36]=E,t[37]=b,t[38]=x,t[39]=D):D=t[39],D}function Ns(e){let t=(0,q.c)(49),{title:n,description:r,tags:i,onTitleChange:a,onDescriptionChange:o,onTagsChange:s,requireTitle:c,disabled:l}=e,u=c===void 0?!1:c,d=l===void 0?!1:l,f=(0,J.useId)(),p=(0,J.useId)(),m=(0,J.useId)(),[h,g]=(0,J.useState)(!1),_;t[0]!==u||t[1]!==n?(_=u&&n.trim()===``,t[0]=u,t[1]=n,t[2]=_):_=t[2];let v=_&&h,y;t[3]===u?y=t[4]:(y=u?(0,K.jsx)(`span`,{className:`text-destructive`,children:`*`}):null,t[3]=u,t[4]=y);let b;t[5]!==y||t[6]!==f?(b=(0,K.jsxs)(jr,{htmlFor:f,children:[`Title`,y]}),t[5]=y,t[6]=f,t[7]=b):b=t[7];let x;t[8]===a?x=t[9]:(x=e=>a(e.target.value),t[8]=a,t[9]=x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>g(!0),t[10]=S):S=t[10];let C;t[11]!==d||t[12]!==v||t[13]!==x||t[14]!==n||t[15]!==f?(C=(0,K.jsx)(Ce,{id:f,value:n,onChange:x,onBlur:S,disabled:d,"aria-invalid":v}),t[11]=d,t[12]=v,t[13]=x,t[14]=n,t[15]=f,t[16]=C):C=t[16];let w;t[17]===v?w=t[18]:(w=v?(0,K.jsx)(Pr,{children:`Required. Title is the agent menu surface.`}):null,t[17]=v,t[18]=w);let T;t[19]!==b||t[20]!==C||t[21]!==w?(T=(0,K.jsxs)(kr,{children:[b,C,w]}),t[19]=b,t[20]=C,t[21]=w,t[22]=T):T=t[22];let E;t[23]===p?E=t[24]:(E=(0,K.jsx)(jr,{htmlFor:p,children:`Description`}),t[23]=p,t[24]=E);let D;t[25]===o?D=t[26]:(D=e=>o(e.target.value),t[25]=o,t[26]=D);let O;t[27]!==r||t[28]!==p||t[29]!==d||t[30]!==D?(O=(0,K.jsx)(we,{id:p,value:r,onChange:D,disabled:d,rows:2}),t[27]=r,t[28]=p,t[29]=d,t[30]=D,t[31]=O):O=t[31];let k;t[32]!==E||t[33]!==O?(k=(0,K.jsxs)(kr,{children:[E,O]}),t[32]=E,t[33]=O,t[34]=k):k=t[34];let A;t[35]===m?A=t[36]:(A=(0,K.jsx)(jr,{htmlFor:m,children:`Tags`}),t[35]=m,t[36]=A);let j;t[37]!==d||t[38]!==s||t[39]!==i||t[40]!==m?(j=(0,K.jsx)(Ms,{id:m,value:i,onChange:s,disabled:d}),t[37]=d,t[38]=s,t[39]=i,t[40]=m,t[41]=j):j=t[41];let M;t[42]!==A||t[43]!==j?(M=(0,K.jsxs)(kr,{children:[A,j]}),t[42]=A,t[43]=j,t[44]=M):M=t[44];let N;return t[45]!==T||t[46]!==k||t[47]!==M?(N=(0,K.jsxs)(K.Fragment,{children:[T,k,M]}),t[45]=T,t[46]=k,t[47]=M,t[48]=N):N=t[48],N}function Ps(e){let t={},n=e.title.trim();n&&(t.title=n);let r=e.description.trim();r&&(t.description=r);let i=e.tags.map(e=>e.trim()).filter(e=>e.length>0);return i.length>0&&(t.tags=i),t}function Fs(e){let t=(0,q.c)(17),{value:n,onChange:r,disabled:i,placeholder:a,rows:o}=e,s=i===void 0?!1:i,c=o===void 0?12:o,l=(0,J.useId)(),u;t[0]===l?u=t[1]:(u=(0,K.jsx)(jr,{htmlFor:l,children:`Body`}),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/70`,children:[`Allowed substitutions: `,`{{date}}`,`, `,`{{user}}`]}),t[2]=d):d=t[2];let f;t[3]===u?f=t[4]:(f=(0,K.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[u,d]}),t[3]=u,t[4]=f);let p;t[5]===r?p=t[6]:(p=e=>r(e.target.value),t[5]=r,t[6]=p);let m;t[7]!==s||t[8]!==l||t[9]!==a||t[10]!==c||t[11]!==p||t[12]!==n?(m=(0,K.jsx)(we,{id:l,value:n,onChange:p,disabled:s,rows:c,spellCheck:!1,placeholder:a,className:`font-mono text-xs leading-relaxed min-h-72`}),t[7]=s,t[8]=l,t[9]=a,t[10]=c,t[11]=p,t[12]=n,t[13]=m):m=t[13];let h;return t[14]!==f||t[15]!==m?(h=(0,K.jsxs)(kr,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var Is=/^[A-Za-z0-9_-]+$/;function Ls(e){let t=(0,q.c)(36),{mode:n,folderPath:r,initial:i,existingNames:a,onCommitted:o,target:s}=e,[c,l]=(0,J.useState)(i.name),[u,d]=(0,J.useState)(i.title),[f,p]=(0,J.useState)(i.description),[m,h]=(0,J.useState)(i.tags),[g,_]=(0,J.useState)(i.body),[v,y]=(0,J.useState)(!1),b,x,S,C;if(t[0]!==a||t[1]!==n||t[2]!==c||t[3]!==u){S=c.trim();let e;t[8]===u?e=t[9]:(e=u.trim(),t[8]=u,t[9]=e),C=e,b=n===`create`&&(S===``||!Is.test(S)),x=n===`create`&&!b&&(a?.has(S)??!1),t[0]=a,t[1]=n,t[2]=c,t[3]=u,t[4]=b,t[5]=x,t[6]=S,t[7]=C}else b=t[4],x=t[5],S=t[6],C=t[7];let w=x,T=!v&&!b&&C!==``,E;t[10]!==g||t[11]!==T||t[12]!==f||t[13]!==r||t[14]!==i.name||t[15]!==n||t[16]!==o||t[17]!==m||t[18]!==s||t[19]!==u||t[20]!==S?(E=async function(){if(!T)return;y(!0);let e=Ps({title:u,description:f,tags:m}),t={folder:r,name:n===`create`?S:i.name,frontmatter:e,body:g};s!==void 0&&(t.target=s);let a=await Ds(t);if(y(!1),!a.ok){_e.error(`${n===`create`?`Create`:`Save`} failed: ${a.error}`);return}a.warnings.length>0?_e.warning(a.warnings.join(` `)):n===`create`?_e.success(`Template "${S}" created`):_e.success(`Template saved`),o()},t[10]=g,t[11]=T,t[12]=f,t[13]=r,t[14]=i.name,t[15]=n,t[16]=o,t[17]=m,t[18]=s,t[19]=u,t[20]=S,t[21]=E):E=t[21];let D=E,O=s??`project`,k;return t[22]!==g||t[23]!==T||t[24]!==f||t[25]!==n||t[26]!==c||t[27]!==b||t[28]!==w||t[29]!==v||t[30]!==D||t[31]!==O||t[32]!==m||t[33]!==u||t[34]!==S?(k={mode:n,name:c,title:u,description:f,tags:m,body:g,setName:l,setTitle:d,setDescription:p,setTags:h,setBody:_,isSaving:v,canSubmit:T,nameInvalid:b,nameShadows:w,trimmedName:S,target:O,submit:D},t[22]=g,t[23]=T,t[24]=f,t[25]=n,t[26]=c,t[27]=b,t[28]=w,t[29]=v,t[30]=D,t[31]=O,t[32]=m,t[33]=u,t[34]=S,t[35]=k):k=t[35],k}function Rs(e){let t=(0,q.c)(21),{form:n,bodyPlaceholder:r}=e,i=(0,J.useId)(),a=n.mode===`create`&&n.trimmedName!==``&&n.nameInvalid,o;t[0]!==n||t[1]!==i||t[2]!==a?(o=n.mode===`create`?(0,K.jsxs)(kr,{children:[(0,K.jsxs)(jr,{htmlFor:i,children:[`Name`,(0,K.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,K.jsx)(Ce,{id:i,value:n.name,onChange:e=>n.setName(e.target.value),placeholder:`article`,disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":a}),a?(0,K.jsxs)(Pr,{children:[`Letters, digits, `,(0,K.jsx)(`code`,{className:`font-mono`,children:`_`}),`,`,` `,(0,K.jsx)(`code`,{className:`font-mono`,children:`-`}),` only — no slashes, dots, spaces, or`,` `,(0,K.jsx)(`code`,{className:`font-mono`,children:`.md`}),`.`]}):n.nameShadows?(0,K.jsx)(Nr,{className:`text-yellow-600 dark:text-yellow-500`,children:n.target===`user`?(0,K.jsxs)(K.Fragment,{children:[`A template named `,(0,K.jsx)(`code`,{className:`font-mono`,children:n.trimmedName}),` already exists in your user scope. Saving overwrites it. Project or folder templates with the same name will continue to shadow this one in their respective scopes.`]}):(0,K.jsxs)(K.Fragment,{children:[`A template named `,(0,K.jsx)(`code`,{className:`font-mono`,children:n.trimmedName}),` already resolves here (likely inherited). Saving creates a`,` `,(0,K.jsx)(`code`,{className:`font-mono`,children:`local`}),` shadow that supersedes it for this folder.`]})}):null]}):null,t[0]=n,t[1]=i,t[2]=a,t[3]=o):o=t[3];let s;t[4]!==n.description||t[5]!==n.isSaving||t[6]!==n.setDescription||t[7]!==n.setTags||t[8]!==n.setTitle||t[9]!==n.tags||t[10]!==n.title?(s=(0,K.jsx)(Ns,{title:n.title,description:n.description,tags:n.tags,onTitleChange:n.setTitle,onDescriptionChange:n.setDescription,onTagsChange:n.setTags,requireTitle:!0,disabled:n.isSaving}),t[4]=n.description,t[5]=n.isSaving,t[6]=n.setDescription,t[7]=n.setTags,t[8]=n.setTitle,t[9]=n.tags,t[10]=n.title,t[11]=s):s=t[11];let c;t[12]!==r||t[13]!==n.body||t[14]!==n.isSaving||t[15]!==n.setBody?(c=(0,K.jsx)(Fs,{value:n.body,onChange:n.setBody,disabled:n.isSaving,placeholder:r}),t[12]=r,t[13]=n.body,t[14]=n.isSaving,t[15]=n.setBody,t[16]=c):c=t[16];let l;return t[17]!==o||t[18]!==s||t[19]!==c?(l=(0,K.jsxs)(Dr,{children:[o,s,c]}),t[17]=o,t[18]=s,t[19]=c,t[20]=l):l=t[20],l}var zs={name:``,title:``,description:``,tags:[],body:``},Bs=`## Summary
|
|
6
|
+
|
|
7
|
+
(One-paragraph summary. Edit later via edit_document.)
|
|
8
|
+
`;function Vs(e){let t=(0,q.c)(13),{folderPath:n,existingNames:r,open:i,onOpenChange:a,onCreated:o,target:s}=e,c;t[0]!==r||t[1]!==n||t[2]!==o||t[3]!==a||t[4]!==i||t[5]!==s?(c=i?(0,K.jsx)(Hs,{folderPath:n,existingNames:r,onOpenChange:a,onCreated:o,target:s}):null,t[0]=r,t[1]=n,t[2]=o,t[3]=a,t[4]=i,t[5]=s,t[6]=c):c=t[6];let l;t[7]===c?l=t[8]:(l=(0,K.jsx)(de,{className:`sm:max-w-3xl max-h-[85vh] flex flex-col`,children:c}),t[7]=c,t[8]=l);let u;return t[9]!==a||t[10]!==i||t[11]!==l?(u=(0,K.jsx)(he,{open:i,onOpenChange:a,children:l}),t[9]=a,t[10]=i,t[11]=l,t[12]=u):u=t[12],u}function Hs(e){let t=(0,q.c)(43),{folderPath:n,existingNames:r,onOpenChange:i,onCreated:a,target:o}=e,s=o===`user`,c;t[0]!==n||t[1]!==s?(c=s?`~/.ok/templates/<name>.md`:As(n,`<name>`),t[0]=n,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]!==a||t[4]!==i?(u=()=>{a(),i(!1)},t[3]=a,t[4]=i,t[5]=u):u=t[5];let d;t[6]===o?d=t[7]:(d=o===void 0?{}:{target:o},t[6]=o,t[7]=d);let f;t[8]!==r||t[9]!==n||t[10]!==u||t[11]!==d?(f={mode:`create`,folderPath:n,initial:zs,existingNames:r,onCommitted:u,...d},t[8]=r,t[9]=n,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p=Ls(f),m=s?`New user template`:`New template`,h;t[13]===m?h=t[14]:(h=(0,K.jsx)(le,{children:m}),t[13]=m,t[14]=h);let g;t[15]===l?g=t[16]:(g=(0,K.jsx)(`code`,{className:`font-mono`,children:l}),t[15]=l,t[16]=g);let _=s?`Available across every OK project you open with this user account.`:`Agents resolve it via leaf → root walk-up — closest-wins on filename collision.`,v;t[17]!==g||t[18]!==_?(v=(0,K.jsxs)(ce,{children:[`Lands at `,g,`.`,` `,_]}),t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==h||t[21]!==v?(y=(0,K.jsxs)(me,{children:[h,v]}),t[20]=h,t[21]=v,t[22]=y):y=t[22];let b;t[23]===p?b=t[24]:(b=(0,K.jsx)(G,{children:(0,K.jsx)(Rs,{form:p,bodyPlaceholder:Bs})}),t[23]=p,t[24]=b);let x;t[25]===i?x=t[26]:(x=()=>i(!1),t[25]=i,t[26]=x);let S;t[27]!==p.isSaving||t[28]!==x?(S=(0,K.jsx)(H,{variant:`outline`,className:`font-mono uppercase`,onClick:x,disabled:p.isSaving,children:`Cancel`}),t[27]=p.isSaving,t[28]=x,t[29]=S):S=t[29];let C;t[30]===p?C=t[31]:(C=()=>void p.submit(),t[30]=p,t[31]=C);let w=!p.canSubmit,T=p.isSaving?`Creating`:`Create template`,E;t[32]!==C||t[33]!==w||t[34]!==T?(E=(0,K.jsx)(H,{onClick:C,disabled:w,children:T}),t[32]=C,t[33]=w,t[34]=T,t[35]=E):E=t[35];let D;t[36]!==S||t[37]!==E?(D=(0,K.jsxs)(fe,{children:[S,E]}),t[36]=S,t[37]=E,t[38]=D):D=t[38];let O;return t[39]!==y||t[40]!==b||t[41]!==D?(O=(0,K.jsxs)(K.Fragment,{children:[y,b,D]}),t[39]=y,t[40]=b,t[41]=D,t[42]=O):O=t[42],O}function Us(e){let t=(0,q.c)(33),{folderPath:n,template:r,onOpenChange:i,onSaved:a,target:o}=e,s=r!==null,c;t[0]===i?c=t[1]:(c=function(){i(!1)},t[0]=i,t[1]=c);let l=c,d;t[2]!==l||t[3]!==a?(d=function(){a(),l()},t[2]=l,t[3]=a,t[4]=d):d=t[4];let f=d,p;t[5]===l?p=t[6]:(p=e=>e?null:l(),t[5]=l,t[6]=p);let m=r?.title??r?.name??`Template`,h;t[7]===r?.scope?h=t[8]:(h=r?.scope===`inherited`?(0,K.jsx)(u,{variant:`gray`,className:`text-2xs`,children:`inherited`}):null,t[7]=r?.scope,t[8]=h);let g;t[9]===r?.scope?g=t[10]:(g=r?.scope===`user`?(0,K.jsx)(u,{variant:`primary`,className:`text-2xs`,children:`user`}):null,t[9]=r?.scope,t[10]=g);let _;t[11]!==m||t[12]!==h||t[13]!==g?(_=(0,K.jsxs)(le,{className:`flex items-center gap-2`,children:[`Edit `,m,h,g]}),t[11]=m,t[12]=h,t[13]=g,t[14]=_):_=t[14];let v=r?.description??`Edit template`,y;t[15]===v?y=t[16]:(y=(0,K.jsx)(ce,{className:`sr-only`,children:v}),t[15]=v,t[16]=y);let b;t[17]!==_||t[18]!==y?(b=(0,K.jsxs)(me,{children:[_,y]}),t[17]=_,t[18]=y,t[19]=b):b=t[19];let x;t[20]!==n||t[21]!==l||t[22]!==f||t[23]!==o||t[24]!==r?(x=r?(0,K.jsx)(Ws,{folderPath:n,template:r,onCancel:l,onSaved:f,target:o},`${r.source_folder}::${r.name}`):null,t[20]=n,t[21]=l,t[22]=f,t[23]=o,t[24]=r,t[25]=x):x=t[25];let S;t[26]!==b||t[27]!==x?(S=(0,K.jsxs)(de,{className:`sm:max-w-3xl max-h-[85vh] flex flex-col`,children:[b,x]}),t[26]=b,t[27]=x,t[28]=S):S=t[28];let C;return t[29]!==s||t[30]!==S||t[31]!==p?(C=(0,K.jsx)(he,{open:s,onOpenChange:p,children:S}),t[29]=s,t[30]=S,t[31]=p,t[32]=C):C=t[32],C}function Ws(e){let t=(0,q.c)(8),{folderPath:n,template:r,onCancel:i,onSaved:a,target:o}=e,s=Cr(n,r.name,o);if(s.status===`loading`||s.status===`idle`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(G,{className:`overflow-y-auto subtle-scrollbar`,children:(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsx)(_r,{className:`h-32 w-full`}),(0,K.jsx)(_r,{className:`h-48 w-full`})]})}),t[0]=e):e=t[0],e}if(s.status===`error`){let e;return t[1]===s.message?e=t[2]:(e=(0,K.jsx)(G,{className:`overflow-y-auto subtle-scrollbar`,children:(0,K.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load template: `,s.message]})}),t[1]=s.message,t[2]=e),e}let c;return t[3]!==i||t[4]!==a||t[5]!==s.data||t[6]!==o?(c=(0,K.jsx)(Gs,{detail:s.data,onCancel:i,onSaved:a,target:o}),t[3]=i,t[4]=a,t[5]=s.data,t[6]=o,t[7]=c):c=t[7],c}function Gs(e){let t=(0,q.c)(42),{detail:n,onCancel:r,onSaved:i,target:a}=e,o=n.frontmatter,s=typeof o.title==`string`?o.title:``,c=typeof o.description==`string`?o.description:``,l;t[0]===o.tags?l=t[1]:(l=Array.isArray(o.tags)?o.tags.filter(Ks):[],t[0]=o.tags,t[1]=l);let u;t[2]!==n.body||t[3]!==n.name||t[4]!==s||t[5]!==c||t[6]!==l?(u={name:n.name,title:s,description:c,tags:l,body:n.body},t[2]=n.body,t[3]=n.name,t[4]=s,t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]===a?d=t[9]:(d=a===void 0?{}:{target:a},t[8]=a,t[9]=d);let f;t[10]!==n.folder||t[11]!==i||t[12]!==u||t[13]!==d?(f={mode:`edit`,folderPath:n.folder,initial:u,onCommitted:i,...d},t[10]=n.folder,t[11]=i,t[12]=u,t[13]=d,t[14]=f):f=t[14];let p=Ls(f),m;t[15]===n.name?m=t[16]:(m=(0,K.jsxs)(`code`,{className:`font-mono`,children:[`write_document({ template: "`,n.name,`" })`]}),t[15]=n.name,t[16]=m);let h;t[17]===n.path?h=t[18]:(h=(0,K.jsx)(`code`,{className:`font-mono`,children:n.path}),t[17]=n.path,t[18]=h);let g;t[19]!==m||t[20]!==h?(g=(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Instantiate as`,` `,m,`. This template is located at `,h,`.`]}),t[19]=m,t[20]=h,t[21]=g):g=t[21];let _;t[22]===p?_=t[23]:(_=(0,K.jsx)(Rs,{form:p}),t[22]=p,t[23]=_);let v;t[24]!==_||t[25]!==g?(v=(0,K.jsx)(G,{className:`overflow-y-auto subtle-scrollbar`,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[g,_]})}),t[24]=_,t[25]=g,t[26]=v):v=t[26];let y;t[27]!==p.isSaving||t[28]!==r?(y=(0,K.jsx)(H,{variant:`outline`,className:`font-mono uppercase`,onClick:r,disabled:p.isSaving,children:`Cancel`}),t[27]=p.isSaving,t[28]=r,t[29]=y):y=t[29];let b;t[30]===p?b=t[31]:(b=()=>void p.submit(),t[30]=p,t[31]=b);let x=!p.canSubmit,S=p.isSaving?`Saving`:`Save`,C;t[32]!==b||t[33]!==x||t[34]!==S?(C=(0,K.jsx)(H,{onClick:b,disabled:x,children:S}),t[32]=b,t[33]=x,t[34]=S,t[35]=C):C=t[35];let w;t[36]!==y||t[37]!==C?(w=(0,K.jsxs)(fe,{children:[y,C]}),t[36]=y,t[37]=C,t[38]=w):w=t[38];let T;return t[39]!==v||t[40]!==w?(T=(0,K.jsxs)(K.Fragment,{children:[v,w]}),t[39]=v,t[40]=w,t[41]=T):T=t[41],T}function Ks(e){return typeof e==`string`}var qs=`npx @inkeep/open-knowledge install-skill`,Js=`https://inkeep.github.io/open-knowledge/guides/install-claude-cowork`;function Ys(){return typeof window<`u`&&typeof window.okDesktop?.skill==`object`}function Xs(e){let t=(0,q.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 font-mono text-[0.85em]`,children:n}),t[0]=n,t[1]=r),r}function Zs(e){let t=(0,q.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=W(`font-mono tracking-wide uppercase text-primary font-medium text-xs`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,K.jsx)(`p`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function Qs(e){let t=(0,q.c)(4),{n}=e,r;t[0]===n?r=t[1]:(r=n.toString().padStart(2,`0`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center text-xs font-medium text-muted-foreground font-mono tabular-nums`,children:r}),t[2]=r,t[3]=i),i}function $s(){let e=(0,q.c)(17),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsx)(Zs,{children:`In the Claude Desktop App`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,K.jsx)(Qs,{n:1}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`strong`,{className:`font-medium`,children:`Customize`}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsxs)(`li`,{className:`flex gap-3`,children:[n,(0,K.jsxs)(`span`,{children:[`Open `,r,` in the sidebar`,` `,i,` `,(0,K.jsx)(`strong`,{className:`font-medium`,children:`Skills`}),`.`]})]}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(Qs,{n:2}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(`span`,{className:`inline-flex items-center justify-center font-medium border h-5 w-5 rounded-md text-xs`,children:`+`}),e[6]=s):s=e[6];let c;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),e[7]=c):c=e[7];let l;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(`strong`,{className:`font-medium`,children:`Create skill`}),e[8]=l):l=e[8];let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),e[9]=u):u=e[9];let d;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsxs)(`li`,{className:`flex gap-3`,children:[o,(0,K.jsxs)(`span`,{children:[`Click`,` `,s,` `,c,` `,l,` `,u,` `,(0,K.jsx)(`strong`,{className:`font-medium`,children:`Upload skill`}),`.`]})]}),e[10]=d):d=e[10];let f;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(Qs,{n:3}),e[11]=f):f=e[11];let p;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(Xs,{children:`openknowledge.skill`}),e[12]=p):p=e[12];let m;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsxs)(`ol`,{className:`flex flex-col gap-4 text-sm`,children:[a,d,(0,K.jsxs)(`li`,{className:`flex gap-3`,children:[f,(0,K.jsxs)(`span`,{children:[`Pick `,p,` from your`,` `,(0,K.jsx)(`strong`,{className:`font-medium`,children:`Downloads`}),` folder. It enables automatically.`]})]})]}),e[13]=m):m=e[13];let h;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,K.jsx)(`strong`,{className:`font-medium`,children:`Skills`}),e[14]=h):h=e[14];let g;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,K.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),e[15]=g):g=e[15];let _;return e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t,m,(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-4`,children:[`Don't see `,h,`? Enable`,` `,(0,K.jsxs)(`strong`,{className:`font-medium`,children:[`Settings`,` `,g,` `,`Capabilities`,` `,(0,K.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),` Code execution and file creation`]}),` `,`first.`]})]}),e[16]=_):_=e[16],_}function ec(e){let t=(0,q.c)(68),{open:n,onOpenChange:r,reinstall:i}=e,a=i===void 0?!1:i,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={kind:`idle`},t[0]=o):o=t[0];let[l,u]=(0,J.useState)(o),[d,f]=(0,J.useState)(!1),p=a?`Reinstall`:`Install`,m,h;t[1]===n?(m=t[2],h=t[3]):(m=()=>{n||(u({kind:`idle`}),f(!1))},h=[n],t[1]=n,t[2]=m,t[3]=h),(0,J.useEffect)(m,h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=async function(){u({kind:`downloading`});let e=window.okDesktop?.skill;if(!e){u({kind:`error`,message:`Electron bridge unavailable. Refresh and try again.`});return}let t=await e.buildAndOpen();if(t.ok)u({kind:`handed-off`,path:t.path});else{let e=t.message??t.reason;_e.error(`Install handoff failed: ${e}`),u({kind:`error`,message:t.reason===`open-failed`?`The Claude Desktop App didn't open the file. Is it installed? (${e})`:`${t.reason}: ${e}`})}},t[4]=g):g=t[4];let _=g,v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=async function(){try{await navigator.clipboard.writeText(qs),f(!0),setTimeout(()=>f(!1),2e3)}catch(e){let t=e;_e.error(`Couldn't copy: ${t instanceof Error?t.message:String(t)}`)}},t[5]=v):v=t[5];let y=v,b;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(b=Ys(),t[6]=b):b=t[6];let x=b,S;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),t[7]=S):S=t[7];let C;t[8]===p?C=t[9]:(C=(0,K.jsxs)(le,{className:`flex items-center gap-2`,children:[S,p,` for Claude Chat & Cowork`]}),t[8]=p,t[9]=C);let w;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(ce,{children:[`Adds the Open Knowledge skill to the`,` `,(0,K.jsx)(`strong`,{className:`font-medium text-foreground`,children:`Claude Desktop App`}),` so it's available in Chat and Cowork sessions.`]}),t[10]=w):w=t[10];let T;t[11]===C?T=t[12]:(T=(0,K.jsxs)(me,{children:[C,w]}),t[11]=C,t[12]=T);let D;t[13]===l.kind?D=t[14]:(D=l.kind===`idle`&&x&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(Zs,{className:`text-muted-foreground`,children:`Automatic`}),(0,K.jsxs)(`p`,{className:`text-sm`,children:[`We'll build `,(0,K.jsx)(Xs,{children:`openknowledge.skill`}),`, save it to`,` `,(0,K.jsx)(Xs,{children:`~/Downloads`}),`, and open the Claude Desktop App for you.`]})]}),(0,K.jsx)($s,{})]}),t[13]=l.kind,t[14]=D);let O;t[15]!==d||t[16]!==l.kind?(O=l.kind===`idle`&&!x&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(Zs,{children:`Run this in your terminal`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-muted/40 p-2`,children:[(0,K.jsx)(`code`,{className:`flex-1 font-mono text-xs`,children:qs}),(0,K.jsx)(H,{variant:`ghost`,size:`sm`,onClick:y,"aria-label":`Copy command`,className:`h-7 gap-1`,children:d?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(E,{"aria-hidden":`true`,className:`h-3 w-3`}),`Copied`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(c,{"aria-hidden":`true`,className:`h-3 w-3`}),`Copy`]})})]}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Saves the file to `,(0,K.jsx)(Xs,{children:`~/Downloads/openknowledge.skill`}),` and opens the Claude Desktop App. Requires Node.js or Bun on your PATH.`]})]}),(0,K.jsx)($s,{})]}),t[15]=d,t[16]=l.kind,t[17]=O):O=t[17];let k;t[18]===l.kind?k=t[19]:(k=l.kind===`downloading`&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(s,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Building `,(0,K.jsx)(Xs,{children:`openknowledge.skill`}),` and opening the Claude Desktop App`]}),t[18]=l.kind,t[19]=k);let A;t[20]!==l.kind||t[21]!==l.path?(A=l.kind===`handed-off`&&x&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2`,children:[(0,K.jsx)(E,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 text-primary`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`File saved & Claude Desktop App opened`}),(0,K.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground`,children:l.path??`~/Downloads/openknowledge.skill`})]})]}),(0,K.jsx)($s,{})]}),t[20]=l.kind,t[21]=l.path,t[22]=A):A=t[22];let j;t[23]===l.kind?j=t[24]:(j=l.kind===`handed-off`&&!x&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2`,children:[(0,K.jsx)(E,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 text-primary`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Download started`}),(0,K.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`File saves to `,(0,K.jsx)(Xs,{children:`~/Downloads/openknowledge.skill`}),`.`]})]})]}),(0,K.jsx)($s,{})]}),t[23]=l.kind,t[24]=j);let M;t[25]!==l.kind||t[26]!==l.message?(M=l.kind===`error`&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-destructive`,children:l.message}),(0,K.jsx)(`a`,{href:Js,target:`_blank`,rel:`noopener noreferrer`,onClick:ic,onAuxClick:rc,className:`text-xs underline underline-offset-2 hover:text-foreground`,children:`See the full install guide`})]}),t[25]=l.kind,t[26]=l.message,t[27]=M):M=t[27];let N;t[28]!==D||t[29]!==O||t[30]!==k||t[31]!==A||t[32]!==j||t[33]!==M?(N=(0,K.jsx)(G,{children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-6 py-2`,children:[D,O,k,A,j,M]})}),t[28]=D,t[29]=O,t[30]=k,t[31]=A,t[32]=j,t[33]=M,t[34]=N):N=t[34];let P;t[35]===l.kind?P=t[36]:(P=l.kind!==`error`&&(0,K.jsxs)(`a`,{href:Js,target:`_blank`,rel:`noopener noreferrer`,onClick:nc,onAuxClick:tc,className:`inline-flex items-center gap-1 self-center text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground sm:mr-auto font-mono tracking-wide uppercase`,children:[`Full guide`,(0,K.jsx)(ke,{"aria-hidden":`true`,className:`h-3 w-3`})]}),t[35]=l.kind,t[36]=P);let F;t[37]!==r||t[38]!==l.kind||t[39]!==p?(F=l.kind===`idle`&&x&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(H,{className:`uppercase font-mono`,variant:`ghost`,onClick:()=>r(!1),children:`Cancel`}),(0,K.jsxs)(H,{onClick:_,children:[(0,K.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),p]})]}),t[37]=r,t[38]=l.kind,t[39]=p,t[40]=F):F=t[40];let I;t[41]!==r||t[42]!==l.kind?(I=l.kind===`idle`&&!x&&(0,K.jsx)(H,{className:`uppercase font-mono`,variant:`ghost`,onClick:()=>r(!1),children:`Close`}),t[41]=r,t[42]=l.kind,t[43]=I):I=t[43];let L;t[44]!==r||t[45]!==l.kind?(L=l.kind===`error`&&x&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(H,{className:`uppercase font-mono`,variant:`ghost`,onClick:()=>r(!1),children:`Cancel`}),(0,K.jsxs)(H,{onClick:_,children:[(0,K.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),`Try again`]})]}),t[44]=r,t[45]=l.kind,t[46]=L):L=t[46];let R;t[47]!==l.kind||t[48]!==a?(R=l.kind===`downloading`&&(0,K.jsxs)(H,{disabled:!0,children:[(0,K.jsx)(s,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),a?`Reinstalling`:`Installing`]}),t[47]=l.kind,t[48]=a,t[49]=R):R=t[49];let ee;t[50]!==r||t[51]!==l.kind?(ee=l.kind===`handed-off`&&(0,K.jsx)(H,{onClick:()=>r(!1),children:`Done`}),t[50]=r,t[51]=l.kind,t[52]=ee):ee=t[52];let z;t[53]!==P||t[54]!==F||t[55]!==I||t[56]!==L||t[57]!==R||t[58]!==ee?(z=(0,K.jsxs)(fe,{children:[P,F,I,L,R,ee]}),t[53]=P,t[54]=F,t[55]=I,t[56]=L,t[57]=R,t[58]=ee,t[59]=z):z=t[59];let B;t[60]!==T||t[61]!==N||t[62]!==z?(B=(0,K.jsxs)(de,{className:`sm:max-w-lg`,"data-ok-layer-spawned":``,children:[T,N,z]}),t[60]=T,t[61]=N,t[62]=z,t[63]=B):B=t[63];let V;return t[64]!==r||t[65]!==n||t[66]!==B?(V=(0,K.jsx)(he,{open:n,onOpenChange:r,children:B}),t[64]=r,t[65]=n,t[66]=B,t[67]=V):V=t[67],V}function tc(e){return Ne(e,Js)}function nc(e){return Ne(e,Js)}function rc(e){return Ne(e,Js)}function ic(e){return Ne(e,Js)}var ac=`claude-cowork`,oc=`ok:skill:cowork:installed:v`,sc=250,cc=`/api/skill/install-state`,lc=null,uc=new Set,dc=null,fc=!1,pc=()=>{Tc(Nc())},mc=e=>{e.key?.startsWith(oc)&&Tc(Nc())};function hc(){fc||typeof window>`u`||(window.addEventListener(`focus`,pc),window.addEventListener(`storage`,mc),fc=!0)}function gc(){fc&&(typeof window>`u`||(window.removeEventListener(`focus`,pc),window.removeEventListener(`storage`,mc),fc=!1))}var _c=!1,vc=!1,yc=!1,bc=!1,xc=!1,Sc=!1,Cc=!1;async function wc(e){let t=!0;if(e.detectClaudeDesktop)try{t=await e.detectClaudeDesktop()}catch(e){t=!0,_c||(_c=!0,console.warn(`[claude-desktop-integration] detectClaudeDesktop IPC rejected — falling back to desktopPresent=true`,e))}let n=await e.fetchSnapshot();if(n){let e=n.targets?.[ac]??null;return e?.version?{desktopPresent:t,skillInstalled:!0,skillVersion:e.version}:{desktopPresent:t,skillInstalled:!1,skillVersion:null}}let r=e.readLocalStorageGuard();return{desktopPresent:t,skillInstalled:r.skillInstalled,skillVersion:r.skillVersion}}async function Tc(e){return dc||(dc=(async()=>{try{lc=await wc(e);for(let e of uc)try{e()}catch(e){console.error(`[claude-desktop-integration] subscriber threw`,e)}}catch(e){console.error(`[claude-desktop-integration] probe rejected unexpectedly`,e)}finally{dc=null}})(),dc)}function Ec(e){return uc.size===0&&hc(),uc.add(e),()=>{uc.delete(e),uc.size===0&&gc()}}function Dc(){return lc}function Oc(){if(typeof window>`u`)return;let e=window.okDesktop?.skill,t=e?.detectClaudeDesktop;if(t)return()=>t.call(e)}function kc(e){let t=e?.timeoutMs??sc,n=e?.fetchImpl??(typeof fetch<`u`?fetch:void 0);return async()=>{if(!n)return null;let e;try{let r=new AbortController,i=setTimeout(()=>r.abort(),t);try{e=await n(cc,{method:`GET`,cache:`no-store`,signal:r.signal})}finally{clearTimeout(i)}}catch(e){let n=e instanceof DOMException&&e.name===`AbortError`;return n&&!yc?(yc=!0,console.warn(`[claude-desktop-integration] fetch ${cc} timed out (>${t}ms) — falling back to localStorage guard`)):!n&&!vc&&(vc=!0,console.warn(`[claude-desktop-integration] fetch ${cc} failed — falling back to localStorage guard`,e)),null}if(!e.ok)return bc||(bc=!0,console.warn(`[claude-desktop-integration] ${cc} returned ${e.status} ${e.statusText} — falling back to localStorage guard`)),null;let r;try{r=await e.json()}catch(e){return xc||(xc=!0,console.warn(`[claude-desktop-integration] ${cc} returned unparseable JSON — falling back to localStorage guard`,e)),null}return Ac(r)}}function Ac(e){if(typeof e!=`object`||!e)return jc(`not an object`);let t=e;if(typeof t.currentVersion!=`string`||t.currentVersion===``)return jc(`currentVersion not a non-empty string`);if(t.targets!==void 0){if(t.targets===null||typeof t.targets!=`object`)return jc(`targets not object`);for(let[,e]of Object.entries(t.targets)){if(e==null)continue;if(typeof e!=`object`)return jc(`target entry not object`);let t=e;if(typeof t.version!=`string`||t.version===``)return jc(`target.version not a non-empty string`)}}return t}function jc(e){return Sc||(Sc=!0,console.warn(`[claude-desktop-integration] ${cc} response failed shape validation (${e}) — falling back to localStorage guard`)),null}function Mc(){if(typeof localStorage>`u`)return{skillInstalled:!1,skillVersion:null};try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(t?.startsWith(oc))return{skillInstalled:!0,skillVersion:t.slice(27)}}}catch(e){Cc||(Cc=!0,console.warn(`[claude-desktop-integration] localStorage scan threw — falling back to skillInstalled=false`,e))}return{skillInstalled:!1,skillVersion:null}}function Nc(){return{detectClaudeDesktop:Oc(),fetchSnapshot:kc(),readLocalStorageGuard:Mc}}function Pc(){let e=(0,q.c)(5),t=(0,J.useSyncExternalStore)(Ec,Dc,Dc),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],e[0]=n):n=e[0],(0,J.useEffect)(Ic,n);let r=t?.desktopPresent??!0,i=t?.skillInstalled??!1,a=t?.skillVersion??null,o;return e[1]!==r||e[2]!==i||e[3]!==a?(o={desktopPresent:r,skillInstalled:i,skillVersion:a,refresh:Fc},e[1]=r,e[2]=i,e[3]=a,e[4]=o):o=e[4],o}function Fc(){Tc(Nc())}function Ic(){lc||Tc(Nc())}function Lc(e){let t=(0,q.c)(9),{open:n,onOpenChange:r,onConfirm:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(me,{children:(0,K.jsx)(Kr,{})}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(G,{children:(0,K.jsx)(qr,{})}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(pe,{asChild:!0,children:(0,K.jsx)(H,{variant:`outline`,children:`Cancel`})}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsxs)(de,{children:[a,o,(0,K.jsxs)(fe,{children:[s,(0,K.jsx)(H,{onClick:i,children:`Enable auto-sync`})]})]}),t[3]=i,t[4]=c);let l;return t[5]!==r||t[6]!==n||t[7]!==c?(l=(0,K.jsx)(he,{open:n,onOpenChange:r,children:c}),t[5]=r,t[6]=n,t[7]=c,t[8]=l):l=t[8],l}function Rc(e){let t=e.trim();return t.length===0?{kind:`blank`,raw:e}:t.startsWith(`#`)?{kind:`comment`,raw:e}:{kind:`pattern`,raw:e,text:t}}function zc(e){return{lines:e.split(`
|
|
9
|
+
`).map(Rc)}}function Bc(e){return e.lines.map(e=>e.raw).join(`
|
|
10
|
+
`)}function Vc(e){return e.lines.filter(e=>e.kind===`pattern`)}function Hc(e,t){let n=t.trim();if(n.length===0)return e;for(let t of e.lines)if(t.kind===`pattern`&&t.text===n)return e;let r={kind:`pattern`,raw:n,text:n},i=e.lines.slice(),a=i[i.length-1];return a&&a.kind===`blank`&&a.raw===``?i.splice(i.length-1,0,r):i.push(r,{kind:`blank`,raw:``}),{lines:i}}function Uc(e,t){let n=t.trim();if(n.length===0)return-1;let r=0;for(let t of e.lines)if(t.kind===`pattern`){if(t.text===n)return r;r++}return-1}function Wc(e,t,n){let r=n.trim();if(r.length===0)return Gc(e,t);let i=qc(e,t);if(i<0)return e;let a=e.lines.slice();return a[i]={kind:`pattern`,raw:r,text:r},{lines:a}}function Gc(e,t){let n=qc(e,t);if(n<0)return e;let r=e.lines.slice();return r.splice(n,1),{lines:r}}function Kc(e,t,n){if(t===n)return e;let r=[],i=[];if(e.lines.forEach((e,t)=>{e.kind===`pattern`&&(r.push(t),i.push(e))}),t<0||t>=i.length||n<0||n>=i.length)return e;let a=i.slice(),[o]=a.splice(t,1);if(!o)return e;a.splice(n,0,o);let s=e.lines.slice();return r.forEach((e,t)=>{let n=a[t];n&&(s[e]=n)}),{lines:s}}function qc(e,t){if(t<0)return-1;let n=0;for(let r=0;r<e.lines.length;r++)if(e.lines[r]?.kind===`pattern`){if(n===t)return r;n++}return-1}var Jc=new Set;function Yc(e){for(let t of Jc)try{t(e)}catch(e){console.warn(`[config-ignore-nested-error-events] listener threw:`,e)}}function Xc(e){return Jc.add(e),()=>{Jc.delete(e)}}var Zc=new Set;function Qc(e){for(let t of Zc)try{t(e)}catch(e){console.warn(`[config-validation-events] listener threw:`,e)}}function $c(e){return Zc.add(e),()=>{Zc.delete(e)}}export{Ar as $,Gi as A,ii as B,Ss as C,Ne as Ct,Va as D,De as Dt,Wo as E,Oe as Et,$r as F,Jr as G,ai as H,ni as I,Wr as J,Kr as K,ei as L,ji as M,Xr as N,Ka as O,Ee as Ot,Qr as P,kr as Q,ti as R,us as S,Ge as St,os as T,Ae as Tt,Zr as U,oi as V,Yr as W,Rr as X,Gr as Y,zr as Z,Vs as _,en as _t,Hc as a,_r as at,Os as b,gn as bt,Vc as c,cn as ct,Kc as d,sn as dt,Nr as et,Bc as f,dn as ft,Us as g,un as gt,ec as h,ln as ht,Xc as i,vr as it,Ki as j,ea as k,Te as kt,zc as l,rn as lt,Pc as m,nn as mt,$c as n,Mr as nt,Wc as o,tn as ot,Lc as p,on as pt,qr as q,Yc as r,Er as rt,Uc as s,pn as st,Qc as t,jr as tt,Gc as u,an as ut,js as v,fn as vt,vs as w,je as wt,Es as x,hn as xt,ks as y,mn as yt,ri as z};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{C as i,a,c as o,d as s,f as c,g as l,i as u,o as d,p as f,r as p,s as m,t as h,u as g,w as _,x as v,y}from"./button-B-xLb7H7.js";var b=i(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),x=e(t(),1),ee=e(_(),1);function S(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var C=e=>{switch(e){case`success`:return T;case`info`:return E;case`warning`:return ne;case`error`:return D;default:return null}},w=Array(12).fill(0),te=({visible:e,className:t})=>x.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},x.createElement(`div`,{className:`sonner-spinner`},w.map((e,t)=>x.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),T=x.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},x.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),ne=x.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},x.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),E=x.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},x.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),D=x.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},x.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),re=x.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},x.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),x.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ie=()=>{let[e,t]=x.useState(document.hidden);return x.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},O=1,k=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:O++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],x.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(j(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!x.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!x.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!x.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!x.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||O++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},A=(e,t)=>{let n=t?.id||O++;return k.addToast({title:e,...t,id:n}),n},j=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,ae=Object.assign(A,{success:k.success,info:k.info,warning:k.warning,error:k.error,custom:k.custom,message:k.message,promise:k.promise,dismiss:k.dismiss,loading:k.loading},{getHistory:()=>k.toasts,getToasts:()=>k.getActiveToasts()});S(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function M(e){return e.label!==void 0}var oe=3,N=`24px`,se=`16px`,ce=4e3,le=356,ue=14,de=45,fe=200;function P(...e){return e.filter(Boolean).join(` `)}function pe(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var me=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:ee,expandByDefault:S,classNames:w,icons:T,closeButtonAriaLabel:ne=`Close toast`}=e,[E,D]=x.useState(null),[O,k]=x.useState(null),[A,j]=x.useState(!1),[ae,oe]=x.useState(!1),[N,se]=x.useState(!1),[le,ue]=x.useState(!1),[me,he]=x.useState(!1),[ge,_e]=x.useState(0),[F,I]=x.useState(0),L=x.useRef(n.duration||y||ce),ve=x.useRef(null),R=x.useRef(null),ye=c===0,be=c+1<=o,z=n.type,B=n.dismissible!==!1,xe=n.className||``,Se=n.descriptionClassName||``,V=x.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),H=x.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Ce=x.useMemo(()=>n.duration||y||ce,[n.duration,y]),we=x.useRef(0),U=x.useRef(0),Te=x.useRef(0),W=x.useRef(null),[Ee,De]=b.split(`-`),G=x.useMemo(()=>s.reduce((e,t,n)=>n>=V?e:e+t.height,0),[s,V]),Oe=ie(),ke=n.invert||t,K=z===`loading`;U.current=x.useMemo(()=>V*ee+G,[V,G]),x.useEffect(()=>{L.current=Ce},[Ce]),x.useEffect(()=>{j(!0)},[]),x.useEffect(()=>{let e=R.current;if(e){let t=e.getBoundingClientRect().height;return I(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),x.useLayoutEffect(()=>{if(!A)return;let e=R.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,I(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let q=x.useCallback(()=>{oe(!0),_e(U.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},fe)},[n,d,a,U]);x.useEffect(()=>{if(n.promise&&z===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Oe?(()=>{if(Te.current<we.current){let e=new Date().getTime()-we.current;L.current-=e}Te.current=new Date().getTime()})():L.current!==1/0&&(we.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),q()},L.current)),()=>clearTimeout(e)},[u,i,n,z,Oe,q]),x.useEffect(()=>{n.delete&&(q(),n.onDismiss==null||n.onDismiss.call(n,n))},[q,n.delete]);function Ae(){return T?.loading?x.createElement(`div`,{className:P(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":z===`loading`},T.loading):x.createElement(te,{className:P(w?.loader,n?.classNames?.loader),visible:z===`loading`})}let je=n.icon||T?.[z]||C(z);return x.createElement(`li`,{tabIndex:0,ref:R,className:P(_,xe,w?.toast,n?.classNames?.toast,w?.default,w?.[z],n?.classNames?.[z]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":me,"data-removed":ae,"data-visible":be,"data-y-position":Ee,"data-x-position":De,"data-index":c,"data-front":ye,"data-swiping":N,"data-dismissible":B,"data-type":z,"data-invert":ke,"data-swipe-out":le,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${ae?ge:U.current}px`,"--initial-height":S?`auto`:`${F}px`,...m,...n.style},onDragEnd:()=>{se(!1),D(null),W.current=null},onPointerDown:e=>{e.button!==2&&(K||!B||(ve.current=new Date,_e(U.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(se(!0),W.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(le||!B)return;W.current=null;let e=Number(R.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(R.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ve.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=de||a>.11){_e(U.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),q(),ue(!0);return}else{var o,s;(o=R.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=R.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}he(!1),se(!1),D(null)},onPointerMove:t=>{var n,r;if(!W.current||!B||window.getSelection()?.toString().length>0)return;let i=t.clientY-W.current.y,a=t.clientX-W.current.x,o=e.swipeDirections??pe(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&he(!0),(n=R.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=R.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},H&&!n.jsx&&z!==`loading`?x.createElement(`button`,{"aria-label":ne,"data-disabled":K,"data-close-button":!0,onClick:K||!B?()=>{}:()=>{q(),n.onDismiss==null||n.onDismiss.call(n,n)},className:P(w?.closeButton,n?.classNames?.closeButton)},T?.close??re):null,(z||n.icon||n.promise)&&n.icon!==null&&(T?.[z]!==null||n.icon)?x.createElement(`div`,{"data-icon":``,className:P(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Ae():null,n.type===`loading`?null:je):null,x.createElement(`div`,{"data-content":``,className:P(w?.content,n?.classNames?.content)},x.createElement(`div`,{"data-title":``,className:P(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?x.createElement(`div`,{"data-description":``,className:P(v,Se,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),x.isValidElement(n.cancel)?n.cancel:n.cancel&&M(n.cancel)?x.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{M(n.cancel)&&B&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),q())},className:P(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,x.isValidElement(n.action)?n.action:n.action&&M(n.action)?x.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{M(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&q())},className:P(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function he(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function ge(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?se:N;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var _e=x.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=oe,toastOptions:g,dir:_=he(),gap:v=ue,icons:y,containerAriaLabel:b=`Notifications`}=e,[S,C]=x.useState([]),w=x.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),te=x.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[T,ne]=x.useState([]),[E,D]=x.useState(!1),[re,ie]=x.useState(!1),[O,A]=x.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),j=x.useRef(null),ae=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),M=x.useRef(null),N=x.useRef(!1),se=x.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||k.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return x.useEffect(()=>k.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{ee.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),x.useEffect(()=>{if(d!==`system`){A(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?A(`dark`):A(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{A(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{A(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),x.useEffect(()=>{S.length<=1&&D(!1)},[S]),x.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;D(!0),(t=j.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===j.current||j.current?.contains(document.activeElement))&&D(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),x.useEffect(()=>{if(j.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,N.current=!1)}},[j.current]),x.createElement(`section`,{ref:t,"aria-label":`${b} ${ae}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},te.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?x.createElement(`ol`,{key:t,dir:_===`auto`?he():_,tabIndex:-1,ref:j,className:c,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${le}px`,"--gap":`${v}px`,...m,...ge(l,u)},onBlur:e=>{N.current&&!e.currentTarget.contains(e.relatedTarget)&&(N.current=!1,M.current&&=(M.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||N.current||(N.current=!0,M.current=e.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{re||D(!1)},onDragEnd:()=>D(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ie(!0)},onPointerUp:()=>ie(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>x.createElement(me,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:re,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:se,toasts:w.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:ne,expandByDefault:o,gap:v,expanded:E,swipeDirections:e.swipeDirections}))):null}))}),F=n(),I=`focusScope.autoFocusOnMount`,L=`focusScope.autoFocusOnUnmount`,ve={bubbles:!1,cancelable:!0},R=`FocusScope`,ye=x.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[c,l]=x.useState(null),u=a(i),d=a(o),p=x.useRef(null),m=y(t,e=>l(e)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let e=function(e){if(h.paused||!c)return;let t=e.target;c.contains(t)?p.current=t:H(p.current,{select:!0})},t=function(e){if(h.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||H(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&H(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,h.paused]),x.useEffect(()=>{if(c){Ce.add(h);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(I,ve);c.addEventListener(I,u),c.dispatchEvent(t),t.defaultPrevented||(be(Te(B(c)),{select:!0}),document.activeElement===e&&H(c))}return()=>{c.removeEventListener(I,u),setTimeout(()=>{let t=new CustomEvent(L,ve);c.addEventListener(L,d),c.dispatchEvent(t),t.defaultPrevented||H(e??document.body,{select:!0}),c.removeEventListener(L,d),Ce.remove(h)},0)}}},[c,u,d,h]);let g=x.useCallback(e=>{if(!n&&!r||h.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=z(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&H(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&H(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,F.jsx)(f.div,{tabIndex:-1,...s,ref:m,onKeyDown:g})});ye.displayName=R;function be(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(H(r,{select:t}),document.activeElement!==n)return}function z(e){let t=B(e);return[xe(t,e),xe(t.reverse(),e)]}function B(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xe(e,t){for(let n of e)if(!Se(n,{upTo:t}))return n}function Se(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function V(e){return e instanceof HTMLInputElement&&`select`in e}function H(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&V(e)&&t&&e.select()}}var Ce=we();function we(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=U(e,t),e.unshift(t)},remove(t){e=U(e,t),e[0]?.resume()}}}function U(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Te(e){return e.filter(e=>e.tagName!==`A`)}var W=0;function Ee(){x.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??De()),document.body.insertAdjacentElement(`beforeend`,e[1]??De()),W++,()=>{W===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),W--}},[])}function De(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var G=function(){return G=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},G.apply(this,arguments)};function Oe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ke(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var K=`right-scroll-bar-position`,q=`width-before-scroll-bar`,Ae=`with-scroll-bars-hidden`,je=`--removed-body-scroll-bar-size`;function Me(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ne(e,t){var n=(0,x.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Pe=typeof window<`u`?x.useLayoutEffect:x.useEffect,Fe=new WeakMap;function Ie(e,t){var n=Ne(t||null,function(t){return e.forEach(function(e){return Me(e,t)})});return Pe(function(){var t=Fe.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Me(e,null)}),i.forEach(function(e){r.has(e)||Me(e,a)})}Fe.set(n,e)},[e]),n}function Le(e){return e}function Re(e,t){t===void 0&&(t=Le);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ze(e){e===void 0&&(e={});var t=Re(null);return t.options=G({async:!0,ssr:!1},e),t}var Be=function(e){var t=e.sideCar,n=Oe(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return x.createElement(r,G({},n))};Be.isSideCarExport=!0;function Ve(e,t){return e.useMedium(t),Be}var He=ze(),Ue=function(){},We=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Ue,onWheelCapture:Ue,onTouchMoveCapture:Ue}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Oe(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),ee=f,S=Ie([n,t]),C=G(G({},b),i);return x.createElement(x.Fragment,null,u&&x.createElement(ee,{sideCar:He,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?x.cloneElement(x.Children.only(s),G(G({},C),{ref:S})):x.createElement(v,G({},C,{className:c,ref:S}),s))});We.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},We.classNames={fullWidth:q,zeroRight:K};var Ge,Ke=function(){if(Ge)return Ge;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qe(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ke();return t&&e.setAttribute(`nonce`,t),e}function Je(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ye(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qe())&&(Je(t,n),Ye(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ze=function(){var e=Xe();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qe=function(){var e=Ze();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$e={left:0,top:0,right:0,gap:0},et=function(e){return parseInt(e||``,10)||0},tt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[et(n),et(r),et(i)]},nt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $e;var t=tt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rt=Qe(),it=`data-scroll-locked`,at=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${Ae} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${it}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${K} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${q} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${K} .${K} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${q} .${q} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${it}] {
|
|
36
|
+
${je}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},ot=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},st=function(){x.useEffect(function(){return document.body.setAttribute(it,(ot()+1).toString()),function(){var e=ot()-1;e<=0?document.body.removeAttribute(it):document.body.setAttribute(it,e.toString())}},[])},ct=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;st();var a=x.useMemo(function(){return nt(i)},[i]);return x.createElement(rt,{styles:at(a,!t,i,n?``:`!important`)})},lt=!1;if(typeof window<`u`)try{var ut=Object.defineProperty({},`passive`,{get:function(){return lt=!0,!0}});window.addEventListener(`test`,ut,ut),window.removeEventListener(`test`,ut,ut)}catch{lt=!1}var J=lt?{passive:!1}:!1,dt=function(e){return e.tagName===`TEXTAREA`},ft=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!dt(e)&&n[t]===`visible`)},pt=function(e){return ft(e,`overflowY`)},mt=function(e){return ft(e,`overflowX`)},ht=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),vt(e,r)){var i=yt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},_t=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},vt=function(e,t){return e===`v`?pt(t):mt(t)},yt=function(e,t){return e===`v`?gt(t):_t(t)},bt=function(e,t){return e===`h`&&t===`rtl`?-1:1},xt=function(e,t,n,r,i){var a=bt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=yt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&vt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},St=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ct=function(e){return[e.deltaX,e.deltaY]},wt=function(e){return e&&`current`in e?e.current:e},Tt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Et=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},Dt=0,Y=[];function Ot(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(Dt++)[0],a=x.useState(Qe)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ke([e.lockRef.current],(e.shards||[]).map(wt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=x.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=St(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ht(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ht(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return xt(h,t,e,h===`h`?s:c,!0)},[]),c=x.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?Ct(n):St(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Tt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(wt).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=x.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:kt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=x.useCallback(function(e){n.current=St(e),r.current=void 0},[]),d=x.useCallback(function(t){l(t.type,Ct(t),t.target,s(t,e.lockRef.current))},[]),f=x.useCallback(function(t){l(t.type,St(t),t.target,s(t,e.lockRef.current))},[]);x.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,J),document.addEventListener(`touchmove`,c,J),document.addEventListener(`touchstart`,u,J),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,J),document.removeEventListener(`touchmove`,c,J),document.removeEventListener(`touchstart`,u,J)}},[]);var p=e.removeScrollBar,m=e.inert;return x.createElement(x.Fragment,null,m?x.createElement(a,{styles:Et(i)}):null,p?x.createElement(ct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var At=Ve(He,Ot),jt=x.forwardRef(function(e,t){return x.createElement(We,G({},e,{ref:t,sideCar:At}))});jt.classNames=We.classNames;var Mt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,Nt=new WeakMap,Pt={},Ft=0,It=function(e){return e&&(e.host||It(e.parentNode))},Lt=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=It(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Rt=function(e,t,n,r){var i=Lt(t,Array.isArray(e)?e:[e]);Pt[n]||(Pt[n]=new WeakMap);var a=Pt[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Nt.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ft++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(Nt.has(e)||e.removeAttribute(r),Nt.delete(e)),i||e.removeAttribute(n)}),Ft--,Ft||(X=new WeakMap,X=new WeakMap,Nt=new WeakMap,Pt={})}},zt=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Mt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Rt(r,i,n,`aria-hidden`)):function(){return null}},Bt=`Dialog`,[Vt,Ht]=c(Bt),[Ut,Z]=Vt(Bt),Wt=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=x.useRef(null),l=x.useRef(null),[u,f]=o({prop:r,defaultProp:i??!1,onChange:a,caller:Bt});return(0,F.jsx)(Ut,{scope:t,triggerRef:c,contentRef:l,contentId:d(),titleId:d(),descriptionId:d(),open:u,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};Wt.displayName=Bt;var Gt=`DialogTrigger`,Kt=x.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(Gt,n),a=y(t,i.triggerRef);return(0,F.jsx)(f.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fn(i.open),...r,ref:a,onClick:g(e.onClick,i.onOpenToggle)})});Kt.displayName=Gt;var qt=`DialogPortal`,[Jt,Yt]=Vt(qt,{forceMount:void 0}),Xt=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Z(qt,t);return(0,F.jsx)(Jt,{scope:t,forceMount:n,children:x.Children.map(r,e=>(0,F.jsx)(m,{present:n||a.open,children:(0,F.jsx)(p,{asChild:!0,container:i,children:e})}))})};Xt.displayName=qt;var Zt=`DialogOverlay`,Qt=x.forwardRef((e,t)=>{let n=Yt(Zt,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z(Zt,e.__scopeDialog);return a.modal?(0,F.jsx)(m,{present:r||a.open,children:(0,F.jsx)(en,{...i,ref:t})}):null});Qt.displayName=Zt;var $t=l(`DialogOverlay.RemoveScroll`),en=x.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(Zt,n);return(0,F.jsx)(jt,{as:$t,allowPinchZoom:!0,shards:[i.contentRef],children:(0,F.jsx)(f.div,{"data-state":fn(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Q=`DialogContent`,tn=x.forwardRef((e,t)=>{let n=Yt(Q,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeDialog);return(0,F.jsx)(m,{present:r||a.open,children:a.modal?(0,F.jsx)(nn,{...i,ref:t}):(0,F.jsx)(rn,{...i,ref:t})})});tn.displayName=Q;var nn=x.forwardRef((e,t)=>{let n=Z(Q,e.__scopeDialog),r=x.useRef(null),i=y(t,n.contentRef,r);return x.useEffect(()=>{let e=r.current;if(e)return zt(e)},[]),(0,F.jsx)(an,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:g(e.onFocusOutside,e=>e.preventDefault())})}),rn=x.forwardRef((e,t)=>{let n=Z(Q,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return(0,F.jsx)(an,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),an=x.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Z(Q,n),c=x.useRef(null),l=y(t,c);return Ee(),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ye,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(u,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":fn(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(gn,{titleId:s.titleId}),(0,F.jsx)(vn,{contentRef:c,descriptionId:s.descriptionId})]})]})}),on=`DialogTitle`,sn=x.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(on,n);return(0,F.jsx)(f.h2,{id:i.titleId,...r,ref:t})});sn.displayName=on;var cn=`DialogDescription`,ln=x.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(cn,n);return(0,F.jsx)(f.p,{id:i.descriptionId,...r,ref:t})});ln.displayName=cn;var un=`DialogClose`,dn=x.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(un,n);return(0,F.jsx)(f.button,{type:`button`,...r,ref:t,onClick:g(e.onClick,()=>i.onOpenChange(!1))})});dn.displayName=un;function fn(e){return e?`open`:`closed`}var pn=`DialogTitleWarning`,[mn,hn]=s(pn,{contentName:Q,titleName:on,docsSlug:`dialog`}),gn=({titleId:e})=>{let t=hn(pn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
+
|
|
43
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
+
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},_n=`DialogDescriptionWarning`,vn=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hn(_n).contentName}}.`;return x.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},yn=Wt,bn=Xt,xn=Qt,Sn=tn,Cn=sn,wn=ln,Tn=dn,$=r();function En(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,F.jsx)(yn,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function Dn(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,F.jsx)(bn,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function On(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,F.jsx)(Tn,{"data-slot":`dialog-close`,className:`font-mono uppercase`,...n}),t[2]=n,t[3]=r),r}function kn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 [-webkit-app-region:no-drag]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,F.jsx)(xn,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function An(e){let t=(0,$.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?!0:a,s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(kn,{}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=v(`fixed top-1/2 left-1/2 z-50 flex w-full max-h-[calc(100dvh-2rem)] max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-6 overflow-hidden rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 [-webkit-app-region:no-drag]`,r),t[6]=r,t[7]=c);let l;t[8]===o?l=t[9]:(l=o&&(0,F.jsx)(Tn,{"data-slot":`dialog-close`,asChild:!0,children:(0,F.jsxs)(h,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,F.jsx)(b,{}),(0,F.jsx)(`span`,{className:`sr-only`,children:`Close`})]})}),t[8]=o,t[9]=l);let u;return t[10]!==n||t[11]!==i||t[12]!==c||t[13]!==l?(u=(0,F.jsxs)(Dn,{children:[s,(0,F.jsxs)(Sn,{"data-slot":`dialog-content`,className:c,...i,children:[n,l]})]}),t[10]=n,t[11]=i,t[12]=c,t[13]=l,t[14]=u):u=t[14],u}function jn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`flex shrink-0 flex-col gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,F.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Mn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`-mx-6 min-h-0 flex-1 overflow-y-auto px-6 subtle-scrollbar scroll-fade-mask`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,F.jsx)(`div`,{"data-slot":`dialog-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nn(e){let t=(0,$.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?!1:a,s;t[5]===r?s=t[6]:(s=v(`-mx-6 -mb-6 flex shrink-0 flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 px-6 py-4 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=s);let c;t[7]===o?c=t[8]:(c=o&&(0,F.jsx)(Tn,{asChild:!0,children:(0,F.jsx)(h,{variant:`outline`,children:`Close`})}),t[7]=o,t[8]=c);let l;return t[9]!==n||t[10]!==i||t[11]!==s||t[12]!==c?(l=(0,F.jsxs)(`div`,{"data-slot":`dialog-footer`,className:s,...i,children:[n,c]}),t[9]=n,t[10]=i,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function Pn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`font-heading text-base leading-none font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,F.jsx)(Cn,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Fn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=v(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,F.jsx)(wn,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{b as S,jt as _,Fn as a,_e as b,Pn as c,wn as d,xn as f,zt as g,Cn as h,An as i,Tn as l,yn as m,Mn as n,Nn as o,bn as p,On as r,jn as s,En as t,Sn as u,Ee as v,ae as x,ye as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{C as n}from"./button-
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{C as n}from"./button-B-xLb7H7.js";var r=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),i=e(t(),1);function a(e){let t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}export{r as n,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{l as n}from"./button-B-xLb7H7.js";var r=e(t(),1);function i(e){let[t,i]=r.useState(void 0);return n(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let n=t[0],r,a;if(`borderBoxSize`in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;i({width:r,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else i(void 0)},[e]),t}export{i as t};
|