@inkeep/open-knowledge 0.4.0-beta.12 → 0.4.0-beta.14
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 +31 -31
- package/dist/constants-DAN-q5Vg.mjs +2 -0
- package/dist/dist-BqKhpKRA.mjs +1 -0
- package/dist/{dist-CKrgdHnw.mjs → dist-C7zRUYkF.mjs} +12 -11
- package/dist/{dist-DUwUCJ4x.mjs → dist-DfIz2LcA.mjs} +15 -15
- package/dist/index.mjs +1 -1
- package/dist/init-CfMPjjjj.mjs +1 -0
- package/dist/{init-_Gm-6A7I.mjs → init-DFIKzR_a.mjs} +5 -5
- package/dist/{loader-D3rMJlRX.mjs → loader-CLqzLLmP.mjs} +3 -3
- package/dist/loader-CvkCArFH.mjs +1 -0
- package/dist/{preview-BWkh1UTl.mjs → preview-CYyF4Y9W.mjs} +2 -2
- package/dist/preview-CZVcnhT0.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-BE6FXriF.js → ActivityModeContent-DJ6-L4Kr.js} +1 -1
- package/dist/public/assets/DocumentContext-DbBJqgtS.js +37 -0
- package/dist/public/assets/{GraphPanel-y3cGwF2v.js → GraphPanel-Dg1nfluQ.js} +2 -2
- package/dist/public/assets/{OutlinePanel-BL75xt1q.js → OutlinePanel-gcmWb8gC.js} +1 -1
- package/dist/public/assets/SettingsPane-DymjUZrj.js +11 -0
- package/dist/public/assets/{SourceEditor-CTgjCTMk.js → SourceEditor-ChbvYuYH.js} +1 -1
- package/dist/public/assets/config-validation-events-BtacxwV0.js +7 -0
- package/dist/public/assets/{doc-hash-BX7QGZIs.js → doc-hash-BAwyNVVo.js} +98 -98
- package/dist/public/assets/index-CE2NorF0.css +1 -0
- package/dist/public/assets/index-Dm1y4Z6N.js +1854 -0
- package/dist/public/assets/{target-navigation-intent-R5ji_W4b.js → target-navigation-intent-Bh5w39Ar.js} +1 -1
- package/dist/public/assets/{tooltip-Yyzxa2RZ.js → tooltip-BIapPAuP.js} +1 -1
- package/dist/public/index.html +8 -8
- package/dist/src-DiAwFfNV.mjs +1 -0
- package/dist/{start-BgxWZHRt.mjs → start-BCn0MNGh.mjs} +2 -2
- package/dist/start-BbI1Pu4P.mjs +1 -0
- package/package.json +1 -1
- package/dist/constants-_LdXldOK.mjs +0 -2
- package/dist/dist-D32wD68r.mjs +0 -1
- package/dist/init-Bojgjz_b.mjs +0 -1
- package/dist/loader-CpwWl3Mq.mjs +0 -1
- package/dist/preview-B-MBEVQZ.mjs +0 -1
- package/dist/public/assets/DocumentContext-DsqszHW2.js +0 -37
- package/dist/public/assets/SettingsPane-CyMjmU3t.js +0 -6
- package/dist/public/assets/config-validation-events-CzfN197_.js +0 -1
- package/dist/public/assets/index-DOkkqO-8.css +0 -1
- package/dist/public/assets/index-DbswRka_.js +0 -1858
- package/dist/src-DOndCvDK.mjs +0 -1
- package/dist/start-CquqiNPk.mjs +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
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{A as i,Gn as a,Kn as o,M as s,Mt as c,Yt as l,_r as u,at as d,hr as f,j as p,k as m,lr as h,m as g,qn as _,rt as v,ur as y}from"./doc-hash-BAwyNVVo.js";import{C as b,f as x,h as S,l as C,m as w,r as T,t as E,u as D,w as O,x as k}from"./button-BsFpqlpT.js";import{At as A,Ft as j,X as M,dt as N,n as P}from"./DocumentContext-DbBJqgtS.js";import{a as ee,c as F,i as te,n as I,o as ne,r as L,s as re,t as R,x as z}from"./dialog-Cv1qneWl.js";var B=b(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ie=b(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),V=b(`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`}]]),H=b(`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`}]]),ae=b(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),U=r(),W=e(t(),1);function G(){let e=(0,U.c)(4),[t,n]=(0,W.useState)(null),r=(0,W.useRef)(!1),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=typeof window<`u`?window.okDesktop:void 0;if(!e)return;let t=e.onChannelChanged(e=>{let{channel:t}=e;r.current=!0,n(t)});return e.state.query().then(e=>{r.current||n(e.channel)}).catch(se),t},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,W.useEffect)(i,a);let o;return e[2]===t?o=e[3]:(o={channel:t,setChannel:oe},e[2]=t,e[3]=o),o}async function oe(e){let t=typeof window<`u`?window.okDesktop:void 0;if(!t)throw Error(`useUpdateChannel.setChannel called without desktop bridge`);await t.update.setChannel(e)}function se(e){console.warn(`[use-update-channel] bridge.state.query() failed`,e)}var K=n(),ce=e(O());function le(e,t){let n=window.okDesktop?.shell?.openExternal;n&&(e.preventDefault(),n(t))}var ue=`Label`,de=W.forwardRef((e,t)=>(0,K.jsx)(S.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));de.displayName=ue;var fe=de,pe=`Radio`,[me,he]=w(pe),[ge,_e]=me(pe),ve=W.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,form:l,...u}=e,[d,f]=W.useState(null),p=k(t,e=>f(e)),m=W.useRef(!1),h=d?l||!!d.closest(`form`):!0;return(0,K.jsxs)(ge,{scope:n,checked:i,disabled:o,children:[(0,K.jsx)(S.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":Ce(i),"data-disabled":o?``:void 0,disabled:o,value:s,...u,ref:p,onClick:x(e.onClick,e=>{i||c?.(),h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),h&&(0,K.jsx)(Se,{control:d,bubbles:!m.current,name:r,value:s,checked:i,required:a,disabled:o,form:l,style:{transform:`translateX(-100%)`}})]})});ve.displayName=pe;var ye=`RadioIndicator`,be=W.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=_e(ye,n);return(0,K.jsx)(C,{present:r||a.checked,children:(0,K.jsx)(S.span,{"data-state":Ce(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});be.displayName=ye;var xe=`RadioBubbleInput`,Se=W.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=W.useRef(null),s=k(o,a),c=A(n),l=h(t);return W.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,K.jsx)(S.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Se.displayName=xe;function Ce(e){return e?`checked`:`unchecked`}var we=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Te=`RadioGroup`,[Ee,De]=w(Te,[_,he]),Oe=_(),ke=he(),[Ae,je]=Ee(Te),Me=W.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:s=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,m=Oe(n),h=y(u),[g,_]=D({prop:a,defaultProp:i??null,onChange:f,caller:Te});return(0,K.jsx)(Ae,{scope:n,name:r,required:s,disabled:c,value:g,onValueChange:_,children:(0,K.jsx)(o,{asChild:!0,...m,orientation:l,dir:h,loop:d,children:(0,K.jsx)(S.div,{role:`radiogroup`,"aria-required":s,"aria-orientation":l,"data-disabled":c?``:void 0,dir:h,...p,ref:t})})})});Me.displayName=Te;var Ne=`RadioGroupItem`,Pe=W.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,o=je(Ne,n),s=o.disabled||r,c=Oe(n),l=ke(n),u=W.useRef(null),d=k(t,u),f=o.value===i.value,p=W.useRef(!1);return W.useEffect(()=>{let e=e=>{we.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,K.jsx)(a,{asChild:!0,...c,focusable:!s,active:f,children:(0,K.jsx)(ve,{disabled:s,required:o.required,checked:f,...l,...i,name:o.name,ref:d,onCheck:()=>o.onValueChange(i.value),onKeyDown:x(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:x(i.onFocus,()=>{p.current&&u.current?.click()})})})});Pe.displayName=Ne;var Fe=`RadioGroupIndicator`,Ie=W.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,K.jsx)(be,{...ke(n),...r,ref:t})});Ie.displayName=Fe;var Le=Me,Re=Pe,ze=Ie;function Be(e){let t=(0,U.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=T(`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}async function Ve(){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 He(){return Ue().status}function Ue(){let e=(0,U.c)(8),[t,n]=(0,W.useState)(null),[r,i]=(0,W.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){Ve().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,W.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>g(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,W.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 We=(0,W.createContext)(null);function Ge(e,t,n){let r=new N,i=new M({url:e,name:t,document:r}),a=v(i,n);return{binding:a,config:a.current(),cleanup:()=>{a.dispose(),i.destroy(),r.destroy()}}}function Ke(e){let t=new N,n=new M({url:e,name:m,document:t}),r=d(n);return{binding:r,provider:n,cleanup:()=>{r.dispose(),n.destroy(),t.destroy()}}}function qe(e){let t=(0,U.c)(25),{children:n}=e,{collabUrl:r}=P(),[a,o]=(0,W.useState)(null),[c,d]=(0,W.useState)(null),[f,m]=(0,W.useState)(null),[h,g]=(0,W.useState)(null),_,v;t[0]===r?(_=t[1],v=t[2]):(_=()=>{if(r===null)return;let e=Ge(r,s,`user`),t=Ge(r,i,`project`),n=Ge(r,p,`project-local`),a=Ke(r);o({binding:e.binding,config:e.config}),d({binding:t.binding,config:t.config}),m({binding:n.binding,config:n.config,synced:n.binding.hasSynced()}),g({binding:a.binding,synced:!1});let c=e.binding.subscribe(t=>{o(n=>n?.binding===e.binding?{...n,config:t}:n)}),l=t.binding.subscribe(e=>{d(n=>n?.binding===t.binding?{...n,config:e}:n)}),u=n.binding.subscribe(e=>{m(t=>t?.binding===n.binding?{...t,config:e}:t)}),f=n.binding.subscribeSynced(()=>{m(e=>e?.binding===n.binding?{...e,synced:!0}:e)}),h=()=>{g(e=>e?.binding===a.binding?{...e,synced:!0}:e)};return a.provider.on(`synced`,h),()=>{c(),l(),u(),f(),a.provider.off(`synced`,h),e.cleanup(),t.cleanup(),n.cleanup(),a.cleanup(),o(t=>t?.binding===e.binding?null:t),d(e=>e?.binding===t.binding?null:e),m(e=>e?.binding===n.binding?null:e),g(e=>e?.binding===a.binding?null:e)}},v=[r],t[0]=r,t[1]=_,t[2]=v),(0,W.useEffect)(_,v);let y;t[3]!==f?.config||t[4]!==c||t[5]!==a?(y=a&&c?l(a.config,c.config,f?.config):null,t[3]=f?.config,t[4]=c,t[5]=a,t[6]=y):y=t[6];let b=y,{setTheme:x}=u(),S=b?.appearance?.theme,C,w;t[7]!==x||t[8]!==S?(C=()=>{(S===`light`||S===`dark`||S===`system`)&&x(S)},w=[S,x],t[7]=x,t[8]=S,t[9]=C,t[10]=w):(C=t[9],w=t[10]),(0,W.useEffect)(C,w);let T=a?.binding??null,E=c?.binding??null,D=f?.binding??null,O=h?.binding??null,k=h?.synced??!1,A=a?.config??null,j=c?.config??null,M=f?.config??null,N=f?.synced??!1,ee;t[11]!==b||t[12]!==k||t[13]!==A||t[14]!==j||t[15]!==M||t[16]!==N||t[17]!==T||t[18]!==E||t[19]!==D||t[20]!==O?(ee={userBinding:T,projectBinding:E,projectLocalBinding:D,okignoreBinding:O,okignoreSynced:k,userConfig:A,projectConfig:j,projectLocalConfig:M,projectLocalSynced:N,merged:b},t[11]=b,t[12]=k,t[13]=A,t[14]=j,t[15]=M,t[16]=N,t[17]=T,t[18]=E,t[19]=D,t[20]=O,t[21]=ee):ee=t[21];let F=ee,te;return t[22]!==n||t[23]!==F?(te=(0,K.jsx)(We,{value:F,children:n}),t[22]=n,t[23]=F,t[24]=te):te=t[24],te}function Je(){let e=(0,W.use)(We);if(e===null)throw Error(`useConfigContext must be used within <ConfigProvider />`);return e}function Ye(){let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(F,{children:`Enable git auto-sync?`}),(0,K.jsx)(ee,{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 Xe(){let e=(0,U.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 Ze(){let e=(0,U.c)(2),{projectLocalBinding:t}=Je();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:c(n.error)}},e[0]=t,e[1]=n),n}function Qe(e){let t=(0,U.c)(10),[n,r]=(0,W.useState)(!1),i;t[0]===e?i=t[1]:(i=function(t){if(e===null)return z.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),z.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 $e(e){let t=(0,U.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=T(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(fe,{"data-slot":`label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function et(e){let t=(0,U.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=T(`grid w-full gap-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(Le,{"data-slot":`radio-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tt(e){let t=(0,U.c)(9),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=T(`group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(ze,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:(0,K.jsx)(`span`,{className:`absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground`})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,K.jsx)(Re,{"data-slot":`radio-group-item`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function nt(){var e=[...arguments];return(0,W.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var rt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function it(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function at(e){return`nodeType`in e}function q(e){return e?it(e)?e:at(e)?e.ownerDocument?.defaultView??window:window:window}function ot(e){let{Document:t}=q(e);return e instanceof t}function st(e){return it(e)?!1:e instanceof q(e).HTMLElement}function ct(e){return e instanceof q(e).SVGElement}function lt(e){return e?it(e)?e.document:at(e)?ot(e)?e:st(e)||ct(e)?e.ownerDocument:document:document:document}var J=rt?W.useLayoutEffect:W.useEffect;function ut(e){let t=(0,W.useRef)(e);return J(()=>{t.current=e}),(0,W.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function dt(){let e=(0,W.useRef)(null);return[(0,W.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,W.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function ft(e,t){t===void 0&&(t=[e]);let n=(0,W.useRef)(e);return J(()=>{n.current!==e&&(n.current=e)},t),n}function pt(e,t){let n=(0,W.useRef)();return(0,W.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function mt(e){let t=ut(e),n=(0,W.useRef)(null);return[n,(0,W.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function ht(e){let t=(0,W.useRef)();return(0,W.useEffect)(()=>{t.current=e},[e]),t.current}var gt={};function _t(e,t){return(0,W.useMemo)(()=>{if(t)return t;let n=gt[e]==null?0:gt[e]+1;return gt[e]=n,e+`-`+n},[e,t])}function vt(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 yt=vt(1),bt=vt(-1);function xt(e){return`clientX`in e&&`clientY`in e}function St(e){if(!e)return!1;let{KeyboardEvent:t}=q(e.target);return t&&e instanceof t}function Ct(e){if(!e)return!1;let{TouchEvent:t}=q(e.target);return t&&e instanceof t}function wt(e){if(Ct(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 xt(e)?{x:e.clientX,y:e.clientY}:null}var Tt=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[Tt.Translate.toString(e),Tt.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Et=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Dt(e){return e.matches(Et)?e:e.querySelector(Et)}var Ot={display:`none`};function kt(e){let{id:t,value:n}=e;return W.createElement(`div`,{id:t,style:Ot},n)}function At(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return W.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 jt(){let[e,t]=(0,W.useState)(``);return{announce:(0,W.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Mt=(0,W.createContext)(null);function Nt(e){let t=(0,W.useContext)(Mt);(0,W.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Pt(){let[e]=(0,W.useState)(()=>new Set),t=(0,W.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,W.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Ft={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
|
+
`},It={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 Lt(e){let{announcements:t=It,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Ft}=e,{announce:a,announcement:o}=jt(),s=_t(`DndLiveRegion`),[c,l]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{l(!0)},[]),Nt((0,W.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=W.createElement(W.Fragment,null,W.createElement(kt,{id:r,value:i.draggable}),W.createElement(At,{id:s,announcement:o}));return n?(0,ce.createPortal)(u,n):u}var Y;(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`})(Y||={});function Rt(){}function zt(e,t){return(0,W.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Bt(){var e=[...arguments];return(0,W.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var X=Object.freeze({x:0,y:0});function Vt(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Ht(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Ut(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Wt(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 Gt(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function Kt(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 qt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Kt(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Vt(Kt(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(Ht)},Jt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Wt(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Wt(r),o=i.reduce((e,t,r)=>e+Vt(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Ht)};function Yt(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 Xt=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=Yt(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Ut)};function Zt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Qt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:X}function $t(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 en=$t(1);function tn(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 nn(e,t,n){let r=tn(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 rn={ignoreTransform:!1};function an(e,t){t===void 0&&(t=rn);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=q(e).getComputedStyle(e);t&&(n=nn(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 on(e){return an(e,{ignoreTransform:!0})}function sn(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function cn(e,t){return t===void 0&&(t=q(e).getComputedStyle(e)),t.position===`fixed`}function ln(e,t){t===void 0&&(t=q(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 un(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(ot(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!st(i)||ct(i)||n.includes(i))return n;let a=q(e).getComputedStyle(i);return i!==e&&ln(i,a)&&n.push(i),cn(i,a)?n:r(i.parentNode)}return e?r(e):n}function dn(e){let[t]=un(e,1);return t??null}function fn(e){return!rt||!e?null:it(e)?e:at(e)?ot(e)||e===lt(e).scrollingElement?window:st(e)?e:null:null}function pn(e){return it(e)?e.scrollX:e.scrollLeft}function mn(e){return it(e)?e.scrollY:e.scrollTop}function hn(e){return{x:pn(e),y:mn(e)}}var Z;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Z||={});function gn(e){return!rt||!e?!1:e===document.scrollingElement}function _n(e){let t={x:0,y:0},n=gn(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 vn={x:.2,y:.2};function yn(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=vn);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=_n(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=Z.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Z.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Z.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Z.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function bn(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 xn(e){return e.reduce((e,t)=>yt(e,hn(t)),X)}function Sn(e){return e.reduce((e,t)=>e+pn(t),0)}function Cn(e){return e.reduce((e,t)=>e+mn(t),0)}function wn(e,t){if(t===void 0&&(t=an),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);dn(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Tn=[[`x`,[`left`,`right`],Sn],[`y`,[`top`,`bottom`],Cn]],En=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=un(t),r=xn(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Tn)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})}},Dn=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 On(e){let{EventTarget:t}=q(e);return e instanceof t?e:lt(e)}function kn(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 Q;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Q||={});function An(e){e.preventDefault()}function jn(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 Mn={start:[$.Space,$.Enter],cancel:[$.Esc],end:[$.Space,$.Enter,$.Tab]},Nn=(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}}},Pn=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 Dn(lt(t)),this.windowListeners=new Dn(q(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Q.Resize,this.handleCancel),this.windowListeners.add(Q.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Q.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&wn(n),t(X)}handleKeyDown(e){if(St(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Mn,coordinateGetter:a=Nn,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}:X;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=bt(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}=_n(n),p=bn(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,yt(bt(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()}};Pn.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Mn,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 Fn(e){return!!(e&&`distance`in e)}function In(e){return!!(e&&`delay`in e)}var Ln=class{constructor(e,t,n){n===void 0&&(n=On(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=lt(i),this.documentListeners=new Dn(this.document),this.listeners=new Dn(n),this.windowListeners=new Dn(q(i)),this.initialCoordinates=wt(r)??X,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(Q.Resize,this.handleCancel),this.windowListeners.add(Q.DragStart,An),this.windowListeners.add(Q.VisibilityChange,this.handleCancel),this.windowListeners.add(Q.ContextMenu,An),this.documentListeners.add(Q.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(In(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Fn(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(Q.Click,jn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Q.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=wt(e)??X,s=bt(n,o);if(!t&&a){if(Fn(a)){if(a.tolerance!=null&&kn(s,a.tolerance))return this.handleCancel();if(kn(s,a.distance))return this.handleStart()}if(In(a)&&kn(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()}},Rn={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},zn=class extends Ln{constructor(e){let{event:t}=e,n=lt(t.target);super(e,Rn,n)}};zn.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 Bn={move:{name:`mousemove`},end:{name:`mouseup`}},Vn;(function(e){e[e.RightClick=2]=`RightClick`})(Vn||={});var Hn=class extends Ln{constructor(e){super(e,Bn,lt(e.event.target))}};Hn.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Vn.RightClick?!1:(r?.({event:n}),!0)}}];var Un={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Wn=class extends Ln{constructor(e){super(e,Un)}static setup(){return window.addEventListener(Un.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Un.move.name,e)};function e(){}}};Wn.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 Gn;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Gn||={});var Kn;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Kn||={});function qn(e){let{acceleration:t,activator:n=Gn.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Kn.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=Yn({delta:d,disabled:!a}),[m,h]=dt(),g=(0,W.useRef)({x:0,y:0}),_=(0,W.useRef)({x:0,y:0}),v=(0,W.useMemo)(()=>{switch(n){case Gn.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Gn.DraggableRect:return i}},[n,i,c]),y=(0,W.useRef)(null),b=(0,W.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,W.useMemo)(()=>s===Kn.TreeOrder?[...l].reverse():l,[s,l]);(0,W.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}=yn(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 Jn={x:{[Z.Backward]:!1,[Z.Forward]:!1},y:{[Z.Backward]:!1,[Z.Forward]:!1}};function Yn(e){let{delta:t,disabled:n}=e,r=ht(t);return pt(e=>{if(n||!r||!e)return Jn;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Z.Backward]:e.x[Z.Backward]||i.x===-1,[Z.Forward]:e.x[Z.Forward]||i.x===1},y:{[Z.Backward]:e.y[Z.Backward]||i.y===-1,[Z.Forward]:e.y[Z.Forward]||i.y===1}}},[n,t,r])}function Xn(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return pt(e=>t==null?null:r??e??null,[r,t])}function Zn(e,t){return(0,W.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 Qn;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(Qn||={});var $n;(function(e){e.Optimized=`optimized`})($n||={});var er=new Map;function tr(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,W.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,W.useRef)(e),d=g(),f=ft(d),p=(0,W.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,W.useRef)(null),h=pt(t=>{if(d&&!n)return er;if(!t||t===er||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 En(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,W.useEffect)(()=>{u.current=e},[e]),(0,W.useEffect)(()=>{d||p()},[n,d]),(0,W.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,W.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 Qn.Always:return!1;case Qn.BeforeDragging:return n;default:return!n}}}function nr(e,t){return pt(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function rr(e,t){return nr(e,t)}function ir(e){let{callback:t,disabled:n}=e,r=ut(t),i=(0,W.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,W.useEffect)(()=>()=>i?.disconnect(),[i]),i}function ar(e){let{callback:t,disabled:n}=e,r=ut(t),i=(0,W.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,W.useEffect)(()=>()=>i?.disconnect(),[i]),i}function or(e){return new En(an(e),e)}function sr(e,t,n){t===void 0&&(t=or);let[r,i]=(0,W.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=ir({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=ar({callback:a});return J(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function cr(e){return Qt(e,nr(e))}var lr=[];function ur(e){let t=(0,W.useRef)(e),n=pt(n=>e?n&&n!==lr&&e&&t.current&&e.parentNode===t.current.parentNode?n:un(e):lr,[e]);return(0,W.useEffect)(()=>{t.current=e},[e]),n}function dr(e){let[t,n]=(0,W.useState)(null),r=(0,W.useRef)(e),i=(0,W.useCallback)(e=>{let t=fn(e.target);t&&n(e=>e?(e.set(t,hn(t)),new Map(e)):null)},[]);return(0,W.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=fn(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,hn(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=>{fn(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,W.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>yt(e,t),X):xn(e):X,[e,t])}function fr(e,t){t===void 0&&(t=[]);let n=(0,W.useRef)(null);return(0,W.useEffect)(()=>{n.current=null},t),(0,W.useEffect)(()=>{let t=e!==X;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?bt(e,n.current):X}function pr(e){(0,W.useEffect)(()=>{if(!rt)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 mr(e,t){return(0,W.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function hr(e){return(0,W.useMemo)(()=>e?sn(e):null,[e])}var gr=[];function _r(e,t){t===void 0&&(t=an);let[n]=e,r=hr(n?q(n):null),[i,a]=(0,W.useState)(gr);function o(){a(()=>e.length?e.map(e=>gn(e)?r:new En(t(e),e)):gr)}let s=ar({callback:o});return J(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function vr(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return st(t)?t:e}function yr(e){let{measure:t}=e,[n,r]=(0,W.useState)(null),i=ar({callback:(0,W.useCallback)(e=>{for(let{target:n}of e)if(st(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=mt((0,W.useCallback)(e=>{let n=vr(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,W.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var br=[{sensor:zn,options:{}},{sensor:Pn,options:{}}],xr={current:{}},Sr={draggable:{measure:on},droppable:{measure:on,strategy:Qn.WhileDragging,frequency:$n.Optimized},dragOverlay:{measure:an}},Cr=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}},wr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Rt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sr,measureDroppableContainers:Rt,windowRect:null,measuringScheduled:!1},Tr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Rt,draggableNodes:new Map,over:null,measureDroppableContainers:Rt},Er=(0,W.createContext)(Tr),Dr=(0,W.createContext)(wr);function Or(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cr}}}function kr(e,t){switch(t.type){case Y.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Y.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 Y.DragEnd:case Y.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Y.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Cr(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Y.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 Cr(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Y.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Cr(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Ar(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,W.useContext)(Er),a=ht(r),o=ht(n?.id);return(0,W.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!St(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=Dt(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function jr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Mr(e){return(0,W.useMemo)(()=>({draggable:{...Sr.draggable,...e?.draggable},droppable:{...Sr.droppable,...e?.droppable},dragOverlay:{...Sr.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Nr(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,W.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;J(()=>{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=Qt(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=dn(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Pr=(0,W.createContext)({...X,scaleX:1,scaleY:1}),Fr;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Fr||={});var Ir=(0,W.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=br,collisionDetection:o=Xt,measuring:s,modifiers:c,...l}=e,[u,d]=(0,W.useReducer)(kr,void 0,Or),[f,p]=Pt(),[m,h]=(0,W.useState)(Fr.Uninitialized),g=m===Fr.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,W.useRef)({initial:null,translated:null}),C=(0,W.useMemo)(()=>_==null?null:{id:_,data:x?.data??xr,rect:S},[_,x]),w=(0,W.useRef)(null),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(null),k=ft(l,Object.values(l)),A=_t(`DndDescribedBy`,t),j=(0,W.useMemo)(()=>b.getEnabled(),[b]),M=Mr(s),{droppableRects:N,measureDroppableContainers:P,measuringScheduled:ee}=tr(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),F=Xn(v,_),te=(0,W.useMemo)(()=>D?wt(D):null,[D]),I=we(),ne=rr(F,M.draggable.measure);Nr({activeNode:_==null?null:v.get(_),config:I.layoutShiftCompensation,initialRect:ne,measure:M.draggable.measure});let L=sr(F,M.draggable.measure,ne),re=sr(F?F.parentElement:null),R=(0,W.useRef)({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),z=b.getNodeFor(R.current.over?.id),B=yr({measure:M.dragOverlay.measure}),ie=B.nodeRef.current??F,V=g?B.rect??L:null,H=!!(B.nodeRef.current&&B.rect),ae=cr(H?null:L),U=hr(ie?q(ie):null),G=ur(g?z??F:null),oe=_r(G),se=jr(c,{transform:{x:y.x-ae.x,y:y.y-ae.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:L,containerNodeRect:re,draggingNodeRect:V,over:R.current.over,overlayNodeRect:B.rect,scrollableAncestors:G,scrollableAncestorRects:oe,windowRect:U}),K=te?yt(te,y):null,le=dr(G),ue=fr(le),de=fr(le,[L]),fe=yt(se,ue),pe=V?en(V,se):null,me=C&&pe?o({active:C,collisionRect:pe,droppableRects:N,droppableContainers:j,pointerCoordinates:K}):null,he=Gt(me,`id`),[ge,_e]=(0,W.useState)(null),ve=Zt(H?se:yt(se,de),ge?.rect??null,L),ye=(0,W.useRef)(null),be=(0,W.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;ye.current=new n({active:w.current,activeNode:i,event:a,options:r,context:R,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,ce.unstable_batchedUpdates)(()=>{r?.(i),h(Fr.Initializing),d({type:Y.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(ye.current),O(a)})},onMove(e){d({type:Y.DragMove,coordinates:e})},onEnd:o(Y.DragEnd),onCancel:o(Y.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=R.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Y.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Y.DragCancel)}w.current=null,(0,ce.unstable_batchedUpdates)(()=>{d({type:e}),h(Fr.Uninitialized),_e(null),E(null),O(null),ye.current=null;let t=e===Y.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),xe=Zn(a,(0,W.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,be(n,t))},[v,be]));pr(a),J(()=>{L&&m===Fr.Initializing&&h(Fr.Initialized)},[L,m]),(0,W.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=R.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:fe.x,y:fe.y},over:i};(0,ce.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[fe.x,fe.y]),(0,W.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=R.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(he),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,ce.unstable_batchedUpdates)(()=>{_e(s),a?.(c),f({type:`onDragOver`,event:c})})},[he]),J(()=>{R.current={activatorEvent:D,active:C,activeNode:F,collisionRect:pe,collisions:me,droppableRects:N,draggableNodes:v,draggingNode:ie,draggingNodeRect:V,droppableContainers:b,over:ge,scrollableAncestors:G,scrollAdjustedTranslate:fe},S.current={initial:V,translated:pe}},[C,F,me,pe,v,ie,V,N,b,ge,G,fe]),qn({...I,delta:y,draggingRect:pe,pointerCoordinates:K,scrollableAncestors:G,scrollableAncestorRects:oe});let Se=(0,W.useMemo)(()=>({active:C,activeNode:F,activeNodeRect:L,activatorEvent:D,collisions:me,containerNodeRect:re,dragOverlay:B,draggableNodes:v,droppableContainers:b,droppableRects:N,over:ge,measureDroppableContainers:P,scrollableAncestors:G,scrollableAncestorRects:oe,measuringConfiguration:M,measuringScheduled:ee,windowRect:U}),[C,F,L,D,me,re,B,v,b,N,ge,P,G,oe,M,ee,U]),Ce=(0,W.useMemo)(()=>({activatorEvent:D,activators:xe,active:C,activeNodeRect:L,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:ge,measureDroppableContainers:P}),[D,xe,C,L,d,A,v,ge,P]);return W.createElement(Mt.Provider,{value:p},W.createElement(Er.Provider,{value:Ce},W.createElement(Dr.Provider,{value:Se},W.createElement(Pr.Provider,{value:ve},i)),W.createElement(Ar,{disabled:n?.restoreFocus===!1})),W.createElement(Lt,{...n,hiddenTextDescribedById:A}));function we(){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}}}),Lr=(0,W.createContext)(null),Rr=`button`,zr=`Draggable`;function Br(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=_t(zr),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,W.useContext)(Er),{role:p=Rr,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,W.useContext)(g?Pr:Lr),[v,y]=mt(),[b,x]=mt(),S=mr(o,t),C=ft(n);return J(()=>(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,W.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Rr?!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 Vr(){return(0,W.useContext)(Dr)}var Hr=`Droppable`,Ur={timeout:25};function Wr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=_t(Hr),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,W.useContext)(Er),u=(0,W.useRef)({disabled:n}),d=(0,W.useRef)(!1),f=(0,W.useRef)(null),p=(0,W.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Ur,...i},_=ft(h??r),v=ar({callback:(0,W.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]=mt((0,W.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=ft(t);return(0,W.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,W.useEffect)(()=>(s({type:Y.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Y.UnregisterDroppable,key:a,id:r})),[r]),(0,W.useEffect)(()=>{n!==u.current.disabled&&(s({type:Y.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 Gr(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Kr(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function qr(e){return e!==null&&e>=0}function Jr(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 Yr(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var Xr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=Gr(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}},Zr={scaleX:1,scaleY:1},Qr=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,...Zr}:null}let s=$r(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...Zr}:r<t&&r>=a?{x:0,y:o.height+s,...Zr}:{x:0,y:0,...Zr}};function $r(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 ei=`Sortable`,ti=W.createContext({activeIndex:-1,containerId:ei,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Xr,disabled:{draggable:!1,droppable:!1}});function ni(e){let{children:t,id:n,items:r,strategy:i=Xr,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Vr(),d=_t(ei,n),f=s.rect!==null,p=(0,W.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,W.useRef)(p),v=!Jr(p,_.current),y=g!==-1&&h===-1||v,b=Yr(a);J(()=>{v&&m&&u(p)},[v,p,m,u]),(0,W.useEffect)(()=>{_.current=p},[p]);let x=(0,W.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:Kr(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return W.createElement(ti.Provider,{value:x},t)}var ri=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Gr(n,r,i).indexOf(t)},ii=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},ai={duration:200,easing:`ease`},oi=`transform`,si=Tt.Transition.toString({property:oi,duration:0,easing:`linear`}),ci={roleDescription:`sortable`};function li(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,W.useState)(null),s=(0,W.useRef)(n);return J(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=an(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,W.useEffect)(()=>{a&&o(null)},[a]),a}function ui(e){let{animateLayoutChanges:t=ii,attributes:n,disabled:r,data:i,getNewIndex:a=ri,id:o,strategy:s,resizeObserverConfig:c,transition:l=ai}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,W.useContext)(ti),y=di(r,p),b=u.indexOf(o),x=(0,W.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,W.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=Wr({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:ee,transform:F}=Br({id:o,data:x,attributes:{...ci,...n},disabled:y.draggable}),te=nt(E,j),I=!!D,ne=I&&!m&&qr(f)&&qr(g),L=!_&&N,re=ne?(L&&ne?F:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,R=qr(f)&&qr(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,z=D?.id,B=(0,W.useRef)({activeId:z,items:u,newIndex:R,containerId:d}),ie=u!==B.current.items,V=t({active:D,containerId:d,isDragging:N,isSorting:I,id:o,index:b,items:u,newIndex:B.current.newIndex,previousItems:B.current.items,previousContainerId:B.current.containerId,transition:l,wasDragging:B.current.activeId!=null}),H=li({disabled:!V,index:b,node:w,rect:C});return(0,W.useEffect)(()=>{I&&B.current.newIndex!==R&&(B.current.newIndex=R),d!==B.current.containerId&&(B.current.containerId=d),u!==B.current.items&&(B.current.items=u)},[I,R,d,u]),(0,W.useEffect)(()=>{if(z===B.current.activeId)return;if(z!=null&&B.current.activeId==null){B.current.activeId=z;return}let e=setTimeout(()=>{B.current.activeId=z},50);return()=>clearTimeout(e)},[z]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:R,items:u,isOver:T,isSorting:I,isDragging:N,listeners:M,node:w,overIndex:g,over:P,setNodeRef:te,setActivatorNodeRef:ee,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:H??re,transition:ae()};function ae(){if(H||ie&&B.current.newIndex===b)return si;if(!(L&&!St(O)||!l)&&(I||V))return Tt.Transition.toString({...l,property:oi})}}function di(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function fi(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 pi=[$.Down,$.Right,$.Up,$.Left],mi=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(pi.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=Jt({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=Gt(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=un(c).some((e,t)=>s[t]!==e),i=hi(e,t),a=gi(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:bt(u,l)}}}};function hi(e,t){return!fi(e)||!fi(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function gi(e,t){return!fi(e)||!fi(t)||!hi(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var _i=`npx @inkeep/open-knowledge install-skill`,vi=`https://inkeep.github.io/open-knowledge/guides/install-claude-cowork`;function yi(){return typeof window<`u`&&typeof window.okDesktop?.skill==`object`}function bi(e){let t=(0,U.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 xi(e){let t=(0,U.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=T(`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 Si(e){let t=(0,U.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 Ci(){let e=(0,U.c)(17),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsx)(xi,{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)(Si,{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)(B,{"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)(Si,{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)(B,{"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)(B,{"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)(Si,{n:3}),e[11]=f):f=e[11];let p;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(bi,{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)(B,{"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)(B,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),` Code execution and file creation`]}),` `,`first.`]})]}),e[16]=_):_=e[16],_}function wi(e){let t=(0,U.c)(61),{open:n,onOpenChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={kind:`idle`},t[0]=i):i=t[0];let[a,o]=(0,W.useState)(i),[s,c]=(0,W.useState)(!1),l,u;t[1]===n?(l=t[2],u=t[3]):(l=()=>{n||(o({kind:`idle`}),c(!1))},u=[n],t[1]=n,t[2]=l,t[3]=u),(0,W.useEffect)(l,u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=async function(){o({kind:`downloading`});let e=window.okDesktop?.skill;if(!e){o({kind:`error`,message:`Electron bridge unavailable. Refresh and try again.`});return}let t=await e.buildAndOpen();if(t.ok)o({kind:`handed-off`,path:t.path});else{let e=t.message??t.reason;z.error(`Install handoff failed: ${e}`),o({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]=d):d=t[4];let p=d,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=async function(){try{await navigator.clipboard.writeText(_i),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){let t=e;z.error(`Couldn't copy: ${t instanceof Error?t.message:String(t)}`)}},t[5]=m):m=t[5];let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=yi(),t[6]=g):g=t[6];let _=g,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,K.jsxs)(F,{className:`flex items-center gap-2`,children:[(0,K.jsx)(V,{"aria-hidden":`true`,className:`h-4 w-4`}),`Install for Claude Chat & Cowork`]}),t[7]=v):v=t[7];let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,K.jsxs)(re,{children:[v,(0,K.jsxs)(ee,{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[8]=y):y=t[8];let b;t[9]===a.kind?b=t[10]:(b=a.kind===`idle`&&_&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(xi,{className:`text-muted-foreground`,children:`Automatic`}),(0,K.jsxs)(`p`,{className:`text-sm`,children:[`We'll build `,(0,K.jsx)(bi,{children:`openknowledge.skill`}),`, save it to`,` `,(0,K.jsx)(bi,{children:`~/Downloads`}),`, and open the Claude Desktop App for you.`]})]}),(0,K.jsx)(Ci,{})]}),t[9]=a.kind,t[10]=b);let x;t[11]!==s||t[12]!==a.kind?(x=a.kind===`idle`&&!_&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(xi,{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:_i}),(0,K.jsx)(E,{variant:`ghost`,size:`sm`,onClick:h,"aria-label":`Copy command`,className:`h-7 gap-1`,children:s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(f,{"aria-hidden":`true`,className:`h-3 w-3`}),`Copied`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ie,{"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)(bi,{children:`~/Downloads/openknowledge.skill`}),` and opens the Claude Desktop App. Requires Node.js or Bun on your PATH.`]})]}),(0,K.jsx)(Ci,{})]}),t[11]=s,t[12]=a.kind,t[13]=x):x=t[13];let S;t[14]===a.kind?S=t[15]:(S=a.kind===`downloading`&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(j,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Building `,(0,K.jsx)(bi,{children:`openknowledge.skill`}),` and opening the Claude Desktop App…`]}),t[14]=a.kind,t[15]=S);let C;t[16]!==a.kind||t[17]!==a.path?(C=a.kind===`handed-off`&&_&&(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)(f,{"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:a.path??`~/Downloads/openknowledge.skill`})]})]}),(0,K.jsx)(Ci,{})]}),t[16]=a.kind,t[17]=a.path,t[18]=C):C=t[18];let w;t[19]===a.kind?w=t[20]:(w=a.kind===`handed-off`&&!_&&(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)(f,{"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)(bi,{children:`~/Downloads/openknowledge.skill`}),`.`]})]})]}),(0,K.jsx)(Ci,{})]}),t[19]=a.kind,t[20]=w);let T;t[21]!==a.kind||t[22]!==a.message?(T=a.kind===`error`&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-destructive`,children:a.message}),(0,K.jsx)(`a`,{href:vi,target:`_blank`,rel:`noopener noreferrer`,onClick:Oi,onAuxClick:Di,className:`text-xs underline underline-offset-2 hover:text-foreground`,children:`See the full install guide`})]}),t[21]=a.kind,t[22]=a.message,t[23]=T):T=t[23];let D;t[24]!==x||t[25]!==S||t[26]!==C||t[27]!==w||t[28]!==T||t[29]!==b?(D=(0,K.jsx)(I,{children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-6 py-2`,children:[b,x,S,C,w,T]})}),t[24]=x,t[25]=S,t[26]=C,t[27]=w,t[28]=T,t[29]=b,t[30]=D):D=t[30];let O;t[31]===a.kind?O=t[32]:(O=a.kind!==`error`&&(0,K.jsxs)(`a`,{href:vi,target:`_blank`,rel:`noopener noreferrer`,onClick:Ei,onAuxClick:Ti,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)(ae,{"aria-hidden":`true`,className:`h-3 w-3`})]}),t[31]=a.kind,t[32]=O);let k;t[33]!==r||t[34]!==a.kind?(k=a.kind===`idle`&&_&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(E,{className:`uppercase font-mono`,variant:`ghost`,onClick:()=>r(!1),children:`Cancel`}),(0,K.jsxs)(E,{onClick:p,children:[(0,K.jsx)(V,{"aria-hidden":`true`,className:`h-4 w-4`}),`Install`]})]}),t[33]=r,t[34]=a.kind,t[35]=k):k=t[35];let A;t[36]!==r||t[37]!==a.kind?(A=a.kind===`idle`&&!_&&(0,K.jsx)(E,{className:`uppercase font-mono`,variant:`ghost`,onClick:()=>r(!1),children:`Close`}),t[36]=r,t[37]=a.kind,t[38]=A):A=t[38];let M;t[39]!==r||t[40]!==a.kind?(M=a.kind===`error`&&_&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(E,{className:`uppercase font-mono`,variant:`ghost`,onClick:()=>r(!1),children:`Cancel`}),(0,K.jsxs)(E,{onClick:p,children:[(0,K.jsx)(V,{"aria-hidden":`true`,className:`h-4 w-4`}),`Try again`]})]}),t[39]=r,t[40]=a.kind,t[41]=M):M=t[41];let N;t[42]===a.kind?N=t[43]:(N=a.kind===`downloading`&&(0,K.jsxs)(E,{disabled:!0,children:[(0,K.jsx)(j,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Installing…`]}),t[42]=a.kind,t[43]=N);let P;t[44]!==r||t[45]!==a.kind?(P=a.kind===`handed-off`&&(0,K.jsx)(E,{onClick:()=>r(!1),children:`Done`}),t[44]=r,t[45]=a.kind,t[46]=P):P=t[46];let L;t[47]!==O||t[48]!==k||t[49]!==A||t[50]!==M||t[51]!==N||t[52]!==P?(L=(0,K.jsxs)(ne,{children:[O,k,A,M,N,P]}),t[47]=O,t[48]=k,t[49]=A,t[50]=M,t[51]=N,t[52]=P,t[53]=L):L=t[53];let B;t[54]!==D||t[55]!==L?(B=(0,K.jsxs)(te,{className:`sm:max-w-lg`,"data-ok-layer-spawned":``,children:[y,D,L]}),t[54]=D,t[55]=L,t[56]=B):B=t[56];let H;return t[57]!==r||t[58]!==n||t[59]!==B?(H=(0,K.jsx)(R,{open:n,onOpenChange:r,children:B}),t[57]=r,t[58]=n,t[59]=B,t[60]=H):H=t[60],H}function Ti(e){return le(e,vi)}function Ei(e){return le(e,vi)}function Di(e){return le(e,vi)}function Oi(e){return le(e,vi)}function ki(e){let t=(0,U.c)(9),{open:n,onOpenChange:r,onConfirm:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(re,{children:(0,K.jsx)(Ye,{})}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(I,{children:(0,K.jsx)(Xe,{})}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(L,{asChild:!0,children:(0,K.jsx)(E,{variant:`outline`,children:`Cancel`})}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsxs)(te,{children:[a,o,(0,K.jsxs)(ne,{children:[s,(0,K.jsx)(E,{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)(R,{open:n,onOpenChange:r,children:c}),t[5]=r,t[6]=n,t[7]=c,t[8]=l):l=t[8],l}function Ai(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 ji(e){return{lines:e.split(`
|
|
6
|
+
`).map(Ai)}}function Mi(e){return e.lines.map(e=>e.raw).join(`
|
|
7
|
+
`)}function Ni(e){return e.lines.filter(e=>e.kind===`pattern`)}function Pi(e,t){let n=t.trim();if(n.length===0)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 Fi(e,t,n){let r=n.trim();if(r.length===0)return Ii(e,t);let i=Ri(e,t);if(i<0)return e;let a=e.lines.slice();return a[i]={kind:`pattern`,raw:r,text:r},{lines:a}}function Ii(e,t){let n=Ri(e,t);if(n<0)return e;let r=e.lines.slice();return r.splice(n,1),{lines:r}}function Li(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 Ri(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 zi=new Set;function Bi(e){for(let t of zi)try{t(e)}catch(e){console.warn(`[config-ignore-nested-error-events] listener threw:`,e)}}function Vi(e){return zi.add(e),()=>{zi.delete(e)}}var Hi=new Set;function Ui(e){for(let t of Hi)try{t(e)}catch(e){console.warn(`[config-validation-events] listener threw:`,e)}}function Wi(e){return Hi.add(e),()=>{Hi.delete(e)}}export{Ye as A,V as B,Bt as C,$e as D,tt as E,Ue as F,B as H,Be as I,le as L,qe as M,Je as N,Qe as O,He as P,G as R,zt as S,et as T,ie as V,Qr as _,Pi as a,zn as b,ji as c,Mi as d,ki as f,ui as g,mi as h,Vi as i,Xe as j,Ze as k,Ii as l,ni as m,Wi as n,Fi as o,wi as p,Bi as r,Ni as s,Ui as t,Li as u,Ir as v,Tt as w,qt as x,Pn as y,H as z};
|