spiracha 1.3.0 → 1.3.3
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/AGENTS.md +1 -0
- package/README.md +1 -1
- package/apps/ui/dist/client/assets/{analytics-B_hYz65v.js → analytics-C83LcWNb.js} +1 -1
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-DkY8EEpK.js +1 -0
- package/apps/ui/dist/client/assets/{antigravity-conversations._conversationId-z1SQC2Kg.js → antigravity-conversations._conversationId-OraHuz8j.js} +1 -1
- package/apps/ui/dist/client/assets/{antigravity-keychain-panel-dYuRWtCf.js → antigravity-keychain-panel-DnDcq1ge.js} +1 -1
- package/apps/ui/dist/client/assets/{antigravity._workspaceKey-CliqUr7o.js → antigravity._workspaceKey-CQaZscA5.js} +1 -1
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-DTs99obU.js +1 -0
- package/apps/ui/dist/client/assets/antigravity.index-DbJa715k.js +1 -0
- package/apps/ui/dist/client/assets/{antigravity.index-CakfZz_E.js → antigravity.index-P-rs6w5X.js} +1 -1
- package/apps/ui/dist/client/assets/{badge-aHE9ETVe.js → badge-wgTVp-aq.js} +1 -1
- package/apps/ui/dist/client/assets/{checkbox-DN3XnJaA.js → checkbox-BUx0Gkuf.js} +1 -1
- package/apps/ui/dist/client/assets/{cursor-threads._composerId-BMQyx8qG.js → cursor-threads._composerId-D0DFXt8t.js} +1 -1
- package/apps/ui/dist/client/assets/cursor-threads._composerId-tFa6Cf6A.js +1 -0
- package/apps/ui/dist/client/assets/{cursor._workspaceKey-bYS2syGL.js → cursor._workspaceKey-Df4PfA2k.js} +1 -1
- package/apps/ui/dist/client/assets/cursor._workspaceKey-DwrzEtnV.js +1 -0
- package/apps/ui/dist/client/assets/cursor.index-CNBf4ZiR.js +1 -0
- package/apps/ui/dist/client/assets/{cursor.index-Clsz4E_e.js → cursor.index-DP9Hy8X6.js} +1 -1
- package/apps/ui/dist/client/assets/{data-table-Cj-v-uyB.js → data-table-DeQq8xdt.js} +1 -1
- package/apps/ui/dist/client/assets/{delete-confirm-dialog-DTpzBiNK.js → delete-confirm-dialog-CPlNsLhM.js} +1 -1
- package/apps/ui/dist/client/assets/{dist-BNAn99Pu.js → dist-Ds3kS91l.js} +1 -1
- package/apps/ui/dist/client/assets/{download-P3Rp23Ad.js → download-DLuPnxpV.js} +1 -1
- package/apps/ui/dist/client/assets/{dropdown-menu-3qB5j9nt.js → dropdown-menu-lFk6zjoL.js} +1 -1
- package/apps/ui/dist/client/assets/{es2015-Dwm_turD.js → es2015-D-H_iZF6.js} +1 -1
- package/apps/ui/dist/client/assets/{export-dialog-CazdrASq.js → export-dialog-CyqyvwiP.js} +1 -1
- package/apps/ui/dist/client/assets/{formatters-BdnWuM1z.js → formatters-DbCKP02D.js} +1 -1
- package/apps/ui/dist/client/assets/index-C-ZPpKJ0.js +22 -0
- package/apps/ui/dist/client/assets/{json-panel-DLkS30sQ.js → json-panel-BsngvucB.js} +1 -1
- package/apps/ui/dist/client/assets/{metadata-section-jnIkB7dB.js → metadata-section-Dtl8dNag.js} +1 -1
- package/apps/ui/dist/client/assets/{metric-card-CBZuWLzQ.js → metric-card-DNzR1Rne.js} +1 -1
- package/apps/ui/dist/client/assets/{page-header-CnD21cPn.js → page-header-dha_O7ZL.js} +1 -1
- package/apps/ui/dist/client/assets/{projects._project-BLszwvYL.js → projects._project-B7HBhbXv.js} +1 -1
- package/apps/ui/dist/client/assets/{projects._project-DvLxYbvk.js → projects._project-DHVvuT7A.js} +1 -1
- package/apps/ui/dist/client/assets/{projects.index-COn8woBR.js → projects.index-BUUtx2AZ.js} +1 -1
- package/apps/ui/dist/client/assets/{projects.index-DYs98skV.js → projects.index-BojAe1Y4.js} +1 -1
- package/apps/ui/dist/client/assets/{refresh-ccw-BDrYXjtD.js → refresh-ccw-B-ASKHtx.js} +1 -1
- package/apps/ui/dist/client/assets/{reload-error-panel-DLAg0AW2.js → reload-error-panel-DD8M1BIY.js} +1 -1
- package/apps/ui/dist/client/assets/{routes-BtF5-coe.js → routes-q7bzFp35.js} +1 -1
- package/apps/ui/dist/client/assets/{scroll-text-CqaFm9by.js → scroll-text-TvHyiJ_N.js} +1 -1
- package/apps/ui/dist/client/assets/{select-DbnpwqL6.js → select-BFv1HMiT.js} +1 -1
- package/apps/ui/dist/client/assets/{settings-CGX3VleN.js → settings-CvegTo4F.js} +1 -1
- package/apps/ui/dist/client/assets/{text-document-panel-DPleOmmq.js → text-document-panel-D7Rws41o.js} +1 -1
- package/apps/ui/dist/client/assets/{text-filter-7M6wRo-t.js → text-filter-2q5pEoZh.js} +1 -1
- package/apps/ui/dist/client/assets/{threads._threadId-D5w76IB-.js → threads._threadId-LpZVUlPq.js} +1 -1
- package/apps/ui/dist/client/assets/{threads._threadId-Dx85sI9P.js → threads._threadId-MSmNIBkq.js} +1 -1
- package/apps/ui/dist/client/assets/{useMutation-MZ3Hr9h9.js → useMutation-BOPJU9e0.js} +1 -1
- package/apps/ui/dist/client/assets/useQuery-CbxZiVGF.js +1 -0
- package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-zvGzK-Yx.js +229 -0
- package/apps/ui/dist/server/assets/{analytics-CBNOYZwJ.js → analytics-Dc_QDZZC.js} +1 -1
- package/apps/ui/dist/server/assets/{antigravity-conversations._conversationId-BIdYNy68.js → antigravity-conversations._conversationId-C9z4AeN-.js} +2 -2
- package/apps/ui/dist/server/assets/{antigravity-conversations._conversationId-B9Rm4EXh.js → antigravity-conversations._conversationId-JEhx-f2R.js} +4 -4
- package/apps/ui/dist/server/assets/{antigravity-keychain-panel-DcLyBBwd.js → antigravity-keychain-panel-bpPoxhyp.js} +1 -1
- package/apps/ui/dist/server/assets/{antigravity-queries-CgQhlQ7J.js → antigravity-queries-DVIKyOXi.js} +2 -2
- package/apps/ui/dist/server/assets/{antigravity-server-DFUx4Khk.js → antigravity-server-Cp1lc8fp.js} +1 -1
- package/apps/ui/dist/server/assets/{antigravity._workspaceKey-D42ixtzp.js → antigravity._workspaceKey-BAoa4izU.js} +4 -4
- package/apps/ui/dist/server/assets/{antigravity._workspaceKey-DnSlSC-C.js → antigravity._workspaceKey-Dl8o1ptg.js} +2 -2
- package/apps/ui/dist/server/assets/{antigravity.index-DZVT-cac.js → antigravity.index-BOlrJasZ.js} +2 -2
- package/apps/ui/dist/server/assets/{codex-queries-eOJGfHQj.js → codex-queries-ev_mRUzr.js} +2 -2
- package/apps/ui/dist/server/assets/{codex-server-nrETIF--.js → codex-server-DIYFLozB.js} +2 -2
- package/apps/ui/dist/server/assets/{createServerRpc-BtXIw2iP.js → createServerRpc-Cg-Zr1rq.js} +1 -1
- package/apps/ui/dist/server/assets/{createSsrRpc-COf5Zuye.js → createSsrRpc-DVnVQhGx.js} +1 -1
- package/apps/ui/dist/server/assets/{cursor-queries-BMhuJeUO.js → cursor-queries-f7DjBKSD.js} +2 -2
- package/apps/ui/dist/server/assets/{cursor-server-BgylIFgn.js → cursor-server-nPzojHN3.js} +1 -1
- package/apps/ui/dist/server/assets/{cursor-threads._composerId-DXffY_CK.js → cursor-threads._composerId-B3qcsh9C.js} +2 -2
- package/apps/ui/dist/server/assets/{cursor-threads._composerId-BsxFKzoJ.js → cursor-threads._composerId-BK3iW-3e.js} +2 -2
- package/apps/ui/dist/server/assets/{cursor._workspaceKey-BP2J1x_x.js → cursor._workspaceKey-BL_CQyHQ.js} +2 -2
- package/apps/ui/dist/server/assets/{cursor._workspaceKey-BQd0e-Pd.js → cursor._workspaceKey-BhQeepXB.js} +2 -2
- package/apps/ui/dist/server/assets/{cursor.index-CQVxtCm8.js → cursor.index-CsrdckZD.js} +1 -1
- package/apps/ui/dist/server/assets/empty-plugin-adapters-D3qLMPfC.js +5 -0
- package/apps/ui/dist/server/assets/{projects._project-DUN3iWfg.js → projects._project-CqqUFr4l.js} +2 -2
- package/apps/ui/dist/server/assets/{projects._project-Dim9Y0kD.js → projects._project-DahGqNYS.js} +2 -2
- package/apps/ui/dist/server/assets/{projects.index-DjSQK5dm.js → projects.index-CkTeFWNU.js} +1 -1
- package/apps/ui/dist/server/assets/{router-DrDgc-LD.js → router-K0m7dK4T.js} +14 -14
- package/apps/ui/dist/server/assets/{routes-CNHAUMwo.js → routes-0x1U0IHq.js} +2 -2
- package/apps/ui/dist/server/assets/{routes-B-GlEe2C.js → routes-Xix3ZeSo.js} +2 -2
- package/apps/ui/dist/server/assets/{start-HeKLHD9b.js → start-bX7bXjzw.js} +1 -1
- package/apps/ui/dist/server/assets/{threads._threadId-CJzm4KrZ.js → threads._threadId-BLCkGW--.js} +2 -2
- package/apps/ui/dist/server/assets/{threads._threadId-DODTYddm.js → threads._threadId-LjgsGUh-.js} +3 -3
- package/apps/ui/dist/server/server.js +319 -207
- package/package.json +3 -3
- package/src/spiracha.ts +20 -1
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-qiyygB7e.js +0 -1
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-CnoBzyX6.js +0 -1
- package/apps/ui/dist/client/assets/antigravity.index-DY7M1KhG.js +0 -1
- package/apps/ui/dist/client/assets/cursor-threads._composerId-BTlaA-tV.js +0 -1
- package/apps/ui/dist/client/assets/cursor._workspaceKey-CrgrfevV.js +0 -1
- package/apps/ui/dist/client/assets/cursor.index-CTqZMPYU.js +0 -1
- package/apps/ui/dist/client/assets/index-BVFnfS78.js +0 -22
- package/apps/ui/dist/client/assets/useQuery-Cb4V0AT0.js +0 -1
- package/apps/ui/dist/server/assets/__23tanstack-start-plugin-adapters-BzCA6dXo.js +0 -5
- package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-CBbkUXw6.js +0 -227
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"./es2015-Dwm_turD.js";import{n as o,r as s,t as c}from"./dist-BNAn99Pu.js";import{$ as l,Bt as u,G as d,K as f,Lt as p,Q as m,U as ee,W as te,X as ne,Y as re,Z as h,dt as g,et as _,ft as v,gt as y,it as b,lt as ie,mt as x,nt as S,ot as C,q as ae,st as oe,zt as w}from"./index-BVFnfS78.js";var se=y(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),T=u(w(),1),E=p(),D=[`Enter`,` `],O=[`ArrowDown`,`PageUp`,`Home`],ce=[`ArrowUp`,`PageDown`,`End`],le=[...O,...ce],ue={ltr:[...D,`ArrowRight`],rtl:[...D,`ArrowLeft`]},k={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},A=`Menu`,[j,de,fe]=r(A),[M,N]=b(A,[fe,ae,s]),P=ae(),pe=s(),[F,I]=M(A),[me,L]=M(A),he=t=>{let{__scopeMenu:n,open:r=!1,children:i,dir:a,onOpenChange:o,modal:s=!0}=t,c=P(n),[l,u]=T.useState(null),d=T.useRef(!1),p=h(o),m=e(a);return T.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.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,E.jsx)(f,{...c,children:(0,E.jsx)(F,{scope:n,open:r,onOpenChange:p,content:l,onContentChange:u,children:(0,E.jsx)(me,{scope:n,onClose:T.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:s,children:i})})})};he.displayName=A;var ge=`MenuAnchor`,R=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=P(n);return(0,E.jsx)(ee,{...i,...r,ref:t})});R.displayName=ge;var z=`MenuPortal`,[_e,ve]=M(z,{forceMount:void 0}),ye=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=I(z,t);return(0,E.jsx)(_e,{scope:t,forceMount:n,children:(0,E.jsx)(l,{present:n||a.open,children:(0,E.jsx)(re,{asChild:!0,container:i,children:r})})})};ye.displayName=z;var B=`MenuContent`,[be,V]=M(B),xe=T.forwardRef((e,t)=>{let n=ve(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(B,e.__scopeMenu),o=L(B,e.__scopeMenu);return(0,E.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,E.jsx)(l,{present:r||a.open,children:(0,E.jsx)(j.Slot,{scope:e.__scopeMenu,children:o.modal?(0,E.jsx)(Se,{...i,ref:t}):(0,E.jsx)(Ce,{...i,ref:t})})})})}),Se=T.forwardRef((e,t)=>{let n=I(B,e.__scopeMenu),r=T.useRef(null),i=v(t,r);return T.useEffect(()=>{let e=r.current;if(e)return a(e)},[]),(0,E.jsx)(H,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ce=T.forwardRef((e,t)=>{let n=I(B,e.__scopeMenu);return(0,E.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),we=ie(`MenuContent.ScrollLock`),H=T.forwardRef((e,r)=>{let{__scopeMenu:a,loop:s=!1,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:p,onEscapeKeyDown:m,onPointerDownOutside:ee,onFocusOutside:te,onInteractOutside:re,onDismiss:h,disableOutsideScroll:g,..._}=e,y=I(B,a),b=L(B,a),ie=P(a),x=pe(a),C=de(a),[ae,oe]=T.useState(null),w=T.useRef(null),se=v(r,w,y.onContentChange),D=T.useRef(0),O=T.useRef(``),ue=T.useRef(0),k=T.useRef(null),A=T.useRef(`right`),j=T.useRef(0),fe=g?n:T.Fragment,M=g?{as:we,allowPinchZoom:!0}:void 0,N=e=>{let t=O.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=et(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};T.useEffect(()=>()=>window.clearTimeout(D.current),[]),i();let F=T.useCallback(e=>A.current===k.current?.side&&nt(e,k.current?.area),[]);return(0,E.jsx)(be,{scope:a,searchRef:O,onItemEnter:T.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:T.useCallback(e=>{F(e)||(w.current?.focus(),oe(null))},[F]),onTriggerLeave:T.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:ue,onPointerGraceIntentChange:T.useCallback(e=>{k.current=e},[]),children:(0,E.jsx)(fe,{...M,children:(0,E.jsx)(t,{asChild:!0,trapped:c,onMountAutoFocus:S(l,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:(0,E.jsx)(ne,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:m,onPointerDownOutside:ee,onFocusOutside:te,onInteractOutside:re,onDismiss:h,children:(0,E.jsx)(o,{asChild:!0,...x,dir:b.dir,orientation:`vertical`,loop:s,currentTabStopId:ae,onCurrentTabStopIdChange:oe,onEntryFocus:S(p,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,E.jsx)(d,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ze(y.open),"data-radix-menu-content":``,dir:b.dir,...ie,..._,ref:se,style:{outline:`none`,..._.style},onKeyDown:S(_.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&&N(e.key));let i=w.current;if(e.target!==i||!le.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);ce.includes(e.key)&&a.reverse(),Qe(a)}),onBlur:S(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:S(e.onPointerMove,Z(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)}))})})})})})})});xe.displayName=B;var Te=`MenuGroup`,U=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(C.div,{role:`group`,...r,ref:t})});U.displayName=Te;var Ee=`MenuLabel`,De=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(C.div,{...r,ref:t})});De.displayName=Ee;var W=`MenuItem`,Oe=`menu.itemSelect`,G=T.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=T.useRef(null),o=L(W,e.__scopeMenu),s=V(W,e.__scopeMenu),c=v(t,a),l=T.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Oe,{bubbles:!0,cancelable:!0});e.addEventListener(Oe,e=>r?.(e),{once:!0}),oe(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,E.jsx)(ke,{...i,ref:c,disabled:n,onClick:S(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:S(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:S(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});G.displayName=W;var ke=T.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=V(W,n),s=pe(n),l=T.useRef(null),u=v(t,l),[d,f]=T.useState(!1),[p,m]=T.useState(``);return T.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[a.children]),(0,E.jsx)(j.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,E.jsx)(c,{asChild:!0,...s,focusable:!r,children:(0,E.jsx)(C.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:S(e.onPointerMove,Z(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,Z(e=>o.onItemLeave(e))),onFocus:S(e.onFocus,()=>f(!0)),onBlur:S(e.onBlur,()=>f(!1))})})})}),Ae=`MenuCheckboxItem`,je=T.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,E.jsx)(Re,{scope:e.__scopeMenu,checked:n,children:(0,E.jsx)(G,{role:`menuitemcheckbox`,"aria-checked":Y(n)?`mixed`:n,...i,ref:t,"data-state":X(n),onSelect:S(i.onSelect,()=>r?.(Y(n)?!0:!n),{checkForDefaultPrevented:!1})})})});je.displayName=Ae;var Me=`MenuRadioGroup`,[Ne,Pe]=M(Me,{value:void 0,onValueChange:()=>{}}),Fe=T.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=h(r);return(0,E.jsx)(Ne,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,E.jsx)(U,{...i,ref:t})})});Fe.displayName=Me;var Ie=`MenuRadioItem`,Le=T.forwardRef((e,t)=>{let{value:n,...r}=e,i=Pe(Ie,e.__scopeMenu),a=n===i.value;return(0,E.jsx)(Re,{scope:e.__scopeMenu,checked:a,children:(0,E.jsx)(G,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":X(a),onSelect:S(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Le.displayName=Ie;var K=`MenuItemIndicator`,[Re,ze]=M(K,{checked:!1}),Be=T.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ze(K,n);return(0,E.jsx)(l,{present:r||Y(a.checked)||a.checked===!0,children:(0,E.jsx)(C.span,{...i,ref:t,"data-state":X(a.checked)})})});Be.displayName=K;var Ve=`MenuSeparator`,He=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(C.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});He.displayName=Ve;var Ue=`MenuArrow`,We=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=P(n);return(0,E.jsx)(te,{...i,...r,ref:t})});We.displayName=Ue;var q=`MenuSub`,[Ge,Ke]=M(q),qe=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=I(q,t),o=P(t),[s,c]=T.useState(null),[l,u]=T.useState(null),d=h(i);return T.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,E.jsx)(f,{...o,children:(0,E.jsx)(F,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,E.jsx)(Ge,{scope:t,contentId:m(),triggerId:m(),trigger:s,onTriggerChange:c,children:n})})})};qe.displayName=q;var J=`MenuSubTrigger`,Je=T.forwardRef((e,t)=>{let n=I(J,e.__scopeMenu),r=L(J,e.__scopeMenu),i=Ke(J,e.__scopeMenu),a=V(J,e.__scopeMenu),o=T.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=T.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return T.useEffect(()=>u,[u]),T.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,E.jsx)(R,{asChild:!0,...l,children:(0,E.jsx)(ke,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Ze(n.open),...e,ref:g(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,Z(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:S(e.onPointerLeave,Z(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:S(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||ue[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Je.displayName=J;var Ye=`MenuSubContent`,Xe=T.forwardRef((e,t)=>{let n=ve(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(B,e.__scopeMenu),o=L(B,e.__scopeMenu),s=Ke(Ye,e.__scopeMenu),c=T.useRef(null),u=v(t,c);return(0,E.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,E.jsx)(l,{present:r||a.open,children:(0,E.jsx)(j.Slot,{scope:e.__scopeMenu,children:(0,E.jsx)(H,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:u,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:S(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:S(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=k[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Xe.displayName=Ye;function Ze(e){return e?`open`:`closed`}function Y(e){return e===`indeterminate`}function X(e){return Y(e)?`indeterminate`:e?`checked`:`unchecked`}function Qe(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function et(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=$e(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 tt(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 nt(e,t){return t?tt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var rt=he,it=R,at=ye,ot=xe,st=U,ct=De,lt=G,ut=je,dt=Fe,ft=Le,pt=Be,mt=He,ht=We,gt=Je,_t=Xe,Q=`DropdownMenu`,[vt,yt]=b(Q,[N]),$=N(),[bt,xt]=vt(Q),St=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=T.useRef(null),[u,d]=_({prop:i,defaultProp:a??!1,onChange:o,caller:Q});return(0,E.jsx)(bt,{scope:t,triggerId:m(),triggerRef:l,contentId:m(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,E.jsx)(rt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};St.displayName=Q;var Ct=`DropdownMenuTrigger`,wt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=xt(Ct,n),o=$(n);return(0,E.jsx)(it,{asChild:!0,...o,children:(0,E.jsx)(C.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:g(t,a.triggerRef),onPointerDown:S(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:S(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});wt.displayName=Ct;var Tt=`DropdownMenuPortal`,Et=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,E.jsx)(at,{...r,...n})};Et.displayName=Tt;var Dt=`DropdownMenuContent`,Ot=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xt(Dt,n),a=$(n),o=T.useRef(!1);return(0,E.jsx)(ot,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:S(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)`}})});Ot.displayName=Dt;var kt=`DropdownMenuGroup`,At=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(st,{...i,...r,ref:t})});At.displayName=kt;var jt=`DropdownMenuLabel`,Mt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ct,{...i,...r,ref:t})});Mt.displayName=jt;var Nt=`DropdownMenuItem`,Pt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(lt,{...i,...r,ref:t})});Pt.displayName=Nt;var Ft=`DropdownMenuCheckboxItem`,It=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ut,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`DropdownMenuRadioGroup`,Rt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(dt,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuRadioItem`,Bt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ft,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuItemIndicator`,Ht=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(pt,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuSeparator`,Wt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(mt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuArrow`,Kt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ht,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuSubTrigger`,Jt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(gt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuSubContent`,Xt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(_t,{...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)`}})});Xt.displayName=Yt;var Zt=St,Qt=wt,$t=Et,en=Ot,tn=Pt;function nn({...e}){return(0,E.jsx)(Zt,{"data-slot":`dropdown-menu`,...e})}function rn({...e}){return(0,E.jsx)(Qt,{"data-slot":`dropdown-menu-trigger`,...e})}function an({className:e,sideOffset:t=4,...n}){return(0,E.jsx)($t,{children:(0,E.jsx)(en,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:x(`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]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n})})}function on({className:e,inset:t,variant:n=`default`,...r}){return(0,E.jsx)(tn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:x(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}export{se as a,rn as i,an as n,on as r,nn as t};
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"./es2015-D-H_iZF6.js";import{n as o,r as s,t as c}from"./dist-Ds3kS91l.js";import{$ as l,Bt as u,G as d,K as f,Lt as p,Q as m,U as ee,W as te,X as ne,Y as re,Z as h,dt as g,et as _,ft as v,gt as y,it as b,lt as ie,mt as x,nt as S,ot as C,q as ae,st as oe,zt as w}from"./index-C-ZPpKJ0.js";var se=y(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),T=u(w(),1),E=p(),D=[`Enter`,` `],O=[`ArrowDown`,`PageUp`,`Home`],ce=[`ArrowUp`,`PageDown`,`End`],le=[...O,...ce],ue={ltr:[...D,`ArrowRight`],rtl:[...D,`ArrowLeft`]},k={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},A=`Menu`,[j,de,fe]=r(A),[M,N]=b(A,[fe,ae,s]),P=ae(),pe=s(),[F,I]=M(A),[me,L]=M(A),he=t=>{let{__scopeMenu:n,open:r=!1,children:i,dir:a,onOpenChange:o,modal:s=!0}=t,c=P(n),[l,u]=T.useState(null),d=T.useRef(!1),p=h(o),m=e(a);return T.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.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,E.jsx)(f,{...c,children:(0,E.jsx)(F,{scope:n,open:r,onOpenChange:p,content:l,onContentChange:u,children:(0,E.jsx)(me,{scope:n,onClose:T.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:s,children:i})})})};he.displayName=A;var ge=`MenuAnchor`,R=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=P(n);return(0,E.jsx)(ee,{...i,...r,ref:t})});R.displayName=ge;var z=`MenuPortal`,[_e,ve]=M(z,{forceMount:void 0}),ye=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=I(z,t);return(0,E.jsx)(_e,{scope:t,forceMount:n,children:(0,E.jsx)(l,{present:n||a.open,children:(0,E.jsx)(re,{asChild:!0,container:i,children:r})})})};ye.displayName=z;var B=`MenuContent`,[be,V]=M(B),xe=T.forwardRef((e,t)=>{let n=ve(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(B,e.__scopeMenu),o=L(B,e.__scopeMenu);return(0,E.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,E.jsx)(l,{present:r||a.open,children:(0,E.jsx)(j.Slot,{scope:e.__scopeMenu,children:o.modal?(0,E.jsx)(Se,{...i,ref:t}):(0,E.jsx)(Ce,{...i,ref:t})})})})}),Se=T.forwardRef((e,t)=>{let n=I(B,e.__scopeMenu),r=T.useRef(null),i=v(t,r);return T.useEffect(()=>{let e=r.current;if(e)return a(e)},[]),(0,E.jsx)(H,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ce=T.forwardRef((e,t)=>{let n=I(B,e.__scopeMenu);return(0,E.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),we=ie(`MenuContent.ScrollLock`),H=T.forwardRef((e,r)=>{let{__scopeMenu:a,loop:s=!1,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:p,onEscapeKeyDown:m,onPointerDownOutside:ee,onFocusOutside:te,onInteractOutside:re,onDismiss:h,disableOutsideScroll:g,..._}=e,y=I(B,a),b=L(B,a),ie=P(a),x=pe(a),C=de(a),[ae,oe]=T.useState(null),w=T.useRef(null),se=v(r,w,y.onContentChange),D=T.useRef(0),O=T.useRef(``),ue=T.useRef(0),k=T.useRef(null),A=T.useRef(`right`),j=T.useRef(0),fe=g?n:T.Fragment,M=g?{as:we,allowPinchZoom:!0}:void 0,N=e=>{let t=O.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=et(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};T.useEffect(()=>()=>window.clearTimeout(D.current),[]),i();let F=T.useCallback(e=>A.current===k.current?.side&&nt(e,k.current?.area),[]);return(0,E.jsx)(be,{scope:a,searchRef:O,onItemEnter:T.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:T.useCallback(e=>{F(e)||(w.current?.focus(),oe(null))},[F]),onTriggerLeave:T.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:ue,onPointerGraceIntentChange:T.useCallback(e=>{k.current=e},[]),children:(0,E.jsx)(fe,{...M,children:(0,E.jsx)(t,{asChild:!0,trapped:c,onMountAutoFocus:S(l,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:(0,E.jsx)(ne,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:m,onPointerDownOutside:ee,onFocusOutside:te,onInteractOutside:re,onDismiss:h,children:(0,E.jsx)(o,{asChild:!0,...x,dir:b.dir,orientation:`vertical`,loop:s,currentTabStopId:ae,onCurrentTabStopIdChange:oe,onEntryFocus:S(p,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,E.jsx)(d,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ze(y.open),"data-radix-menu-content":``,dir:b.dir,...ie,..._,ref:se,style:{outline:`none`,..._.style},onKeyDown:S(_.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&&N(e.key));let i=w.current;if(e.target!==i||!le.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);ce.includes(e.key)&&a.reverse(),Qe(a)}),onBlur:S(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:S(e.onPointerMove,Z(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)}))})})})})})})});xe.displayName=B;var Te=`MenuGroup`,U=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(C.div,{role:`group`,...r,ref:t})});U.displayName=Te;var Ee=`MenuLabel`,De=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(C.div,{...r,ref:t})});De.displayName=Ee;var W=`MenuItem`,Oe=`menu.itemSelect`,G=T.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=T.useRef(null),o=L(W,e.__scopeMenu),s=V(W,e.__scopeMenu),c=v(t,a),l=T.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Oe,{bubbles:!0,cancelable:!0});e.addEventListener(Oe,e=>r?.(e),{once:!0}),oe(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,E.jsx)(ke,{...i,ref:c,disabled:n,onClick:S(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:S(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:S(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});G.displayName=W;var ke=T.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=V(W,n),s=pe(n),l=T.useRef(null),u=v(t,l),[d,f]=T.useState(!1),[p,m]=T.useState(``);return T.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[a.children]),(0,E.jsx)(j.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,E.jsx)(c,{asChild:!0,...s,focusable:!r,children:(0,E.jsx)(C.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:S(e.onPointerMove,Z(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,Z(e=>o.onItemLeave(e))),onFocus:S(e.onFocus,()=>f(!0)),onBlur:S(e.onBlur,()=>f(!1))})})})}),Ae=`MenuCheckboxItem`,je=T.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,E.jsx)(Re,{scope:e.__scopeMenu,checked:n,children:(0,E.jsx)(G,{role:`menuitemcheckbox`,"aria-checked":Y(n)?`mixed`:n,...i,ref:t,"data-state":X(n),onSelect:S(i.onSelect,()=>r?.(Y(n)?!0:!n),{checkForDefaultPrevented:!1})})})});je.displayName=Ae;var Me=`MenuRadioGroup`,[Ne,Pe]=M(Me,{value:void 0,onValueChange:()=>{}}),Fe=T.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=h(r);return(0,E.jsx)(Ne,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,E.jsx)(U,{...i,ref:t})})});Fe.displayName=Me;var Ie=`MenuRadioItem`,Le=T.forwardRef((e,t)=>{let{value:n,...r}=e,i=Pe(Ie,e.__scopeMenu),a=n===i.value;return(0,E.jsx)(Re,{scope:e.__scopeMenu,checked:a,children:(0,E.jsx)(G,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":X(a),onSelect:S(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Le.displayName=Ie;var K=`MenuItemIndicator`,[Re,ze]=M(K,{checked:!1}),Be=T.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ze(K,n);return(0,E.jsx)(l,{present:r||Y(a.checked)||a.checked===!0,children:(0,E.jsx)(C.span,{...i,ref:t,"data-state":X(a.checked)})})});Be.displayName=K;var Ve=`MenuSeparator`,He=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,E.jsx)(C.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});He.displayName=Ve;var Ue=`MenuArrow`,We=T.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=P(n);return(0,E.jsx)(te,{...i,...r,ref:t})});We.displayName=Ue;var q=`MenuSub`,[Ge,Ke]=M(q),qe=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=I(q,t),o=P(t),[s,c]=T.useState(null),[l,u]=T.useState(null),d=h(i);return T.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,E.jsx)(f,{...o,children:(0,E.jsx)(F,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,E.jsx)(Ge,{scope:t,contentId:m(),triggerId:m(),trigger:s,onTriggerChange:c,children:n})})})};qe.displayName=q;var J=`MenuSubTrigger`,Je=T.forwardRef((e,t)=>{let n=I(J,e.__scopeMenu),r=L(J,e.__scopeMenu),i=Ke(J,e.__scopeMenu),a=V(J,e.__scopeMenu),o=T.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=T.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return T.useEffect(()=>u,[u]),T.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,E.jsx)(R,{asChild:!0,...l,children:(0,E.jsx)(ke,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Ze(n.open),...e,ref:g(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,Z(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:S(e.onPointerLeave,Z(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:S(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||ue[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Je.displayName=J;var Ye=`MenuSubContent`,Xe=T.forwardRef((e,t)=>{let n=ve(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(B,e.__scopeMenu),o=L(B,e.__scopeMenu),s=Ke(Ye,e.__scopeMenu),c=T.useRef(null),u=v(t,c);return(0,E.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,E.jsx)(l,{present:r||a.open,children:(0,E.jsx)(j.Slot,{scope:e.__scopeMenu,children:(0,E.jsx)(H,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:u,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:S(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:S(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=k[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Xe.displayName=Ye;function Ze(e){return e?`open`:`closed`}function Y(e){return e===`indeterminate`}function X(e){return Y(e)?`indeterminate`:e?`checked`:`unchecked`}function Qe(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function et(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=$e(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 tt(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 nt(e,t){return t?tt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var rt=he,it=R,at=ye,ot=xe,st=U,ct=De,lt=G,ut=je,dt=Fe,ft=Le,pt=Be,mt=He,ht=We,gt=Je,_t=Xe,Q=`DropdownMenu`,[vt,yt]=b(Q,[N]),$=N(),[bt,xt]=vt(Q),St=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=T.useRef(null),[u,d]=_({prop:i,defaultProp:a??!1,onChange:o,caller:Q});return(0,E.jsx)(bt,{scope:t,triggerId:m(),triggerRef:l,contentId:m(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,E.jsx)(rt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};St.displayName=Q;var Ct=`DropdownMenuTrigger`,wt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=xt(Ct,n),o=$(n);return(0,E.jsx)(it,{asChild:!0,...o,children:(0,E.jsx)(C.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:g(t,a.triggerRef),onPointerDown:S(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:S(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});wt.displayName=Ct;var Tt=`DropdownMenuPortal`,Et=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,E.jsx)(at,{...r,...n})};Et.displayName=Tt;var Dt=`DropdownMenuContent`,Ot=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xt(Dt,n),a=$(n),o=T.useRef(!1);return(0,E.jsx)(ot,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:S(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)`}})});Ot.displayName=Dt;var kt=`DropdownMenuGroup`,At=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(st,{...i,...r,ref:t})});At.displayName=kt;var jt=`DropdownMenuLabel`,Mt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ct,{...i,...r,ref:t})});Mt.displayName=jt;var Nt=`DropdownMenuItem`,Pt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(lt,{...i,...r,ref:t})});Pt.displayName=Nt;var Ft=`DropdownMenuCheckboxItem`,It=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ut,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`DropdownMenuRadioGroup`,Rt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(dt,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuRadioItem`,Bt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ft,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuItemIndicator`,Ht=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(pt,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuSeparator`,Wt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(mt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuArrow`,Kt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(ht,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuSubTrigger`,Jt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(gt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuSubContent`,Xt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,E.jsx)(_t,{...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)`}})});Xt.displayName=Yt;var Zt=St,Qt=wt,$t=Et,en=Ot,tn=Pt;function nn({...e}){return(0,E.jsx)(Zt,{"data-slot":`dropdown-menu`,...e})}function rn({...e}){return(0,E.jsx)(Qt,{"data-slot":`dropdown-menu-trigger`,...e})}function an({className:e,sideOffset:t=4,...n}){return(0,E.jsx)($t,{children:(0,E.jsx)(en,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:x(`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]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n})})}function on({className:e,inset:t,variant:n=`default`,...r}){return(0,E.jsx)(tn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:x(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}export{se as a,rn as i,an as n,on as r,nn as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Bt as e,Lt as t,Z as n,ft as r,it as i,lt as a,ot as o,zt as s}from"./index-
|
|
1
|
+
import{Bt as e,Lt as t,Z as n,ft as r,it as i,lt as a,ot as o,zt as s}from"./index-C-ZPpKJ0.js";var c=e(s(),1),l=t();function u(e){let t=e+`CollectionProvider`,[n,o]=i(t),[s,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=c.useRef(null),i=c.useRef(new Map).current;return(0,l.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=a(f),m=c.forwardRef((e,t)=>{let{scope:n,children:i}=e;return(0,l.jsx)(p,{ref:r(t,u(f,n).collectionRef),children:i})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=a(h),v=c.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=c.useRef(null),s=r(t,o),d=u(h,n);return c.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,l.jsx)(_,{[g]:``,ref:s,children:i})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,o]}var d=c.createContext(void 0);function f(e){let t=c.useContext(d);return e||t||`ltr`}var p=`focusScope.autoFocusOnMount`,m=`focusScope.autoFocusOnUnmount`,h={bubbles:!1,cancelable:!0},g=`FocusScope`,_=c.forwardRef((e,t)=>{let{loop:i=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:u,...d}=e,[f,g]=c.useState(null),_=n(s),x=n(u),S=c.useRef(null),C=r(t,e=>g(e)),E=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(a){let e=function(e){if(E.paused||!f)return;let t=e.target;f.contains(t)?S.current=t:w(S.current,{select:!0})},t=function(e){if(E.paused||!f)return;let t=e.relatedTarget;t!==null&&(f.contains(t)||w(S.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&w(f)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return f&&r.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[a,f,E.paused]),c.useEffect(()=>{if(f){T.add(E);let e=document.activeElement;if(!f.contains(e)){let t=new CustomEvent(p,h);f.addEventListener(p,_),f.dispatchEvent(t),t.defaultPrevented||(v(ee(b(f)),{select:!0}),document.activeElement===e&&w(f))}return()=>{f.removeEventListener(p,_),setTimeout(()=>{let t=new CustomEvent(m,h);f.addEventListener(m,x),f.dispatchEvent(t),t.defaultPrevented||w(e??document.body,{select:!0}),f.removeEventListener(m,x),T.remove(E)},0)}}},[f,_,x,E]);let D=c.useCallback(e=>{if(!i&&!a||E.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[r,a]=y(t);r&&a?!e.shiftKey&&n===a?(e.preventDefault(),i&&w(r,{select:!0})):e.shiftKey&&n===r&&(e.preventDefault(),i&&w(a,{select:!0})):n===t&&e.preventDefault()}},[i,a,E.paused]);return(0,l.jsx)(o.div,{tabIndex:-1,...d,ref:C,onKeyDown:D})});_.displayName=g;function v(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(w(r,{select:t}),document.activeElement!==n)return}function y(e){let t=b(e);return[x(t,e),x(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 x(e,t){for(let n of e)if(!S(n,{upTo:t}))return n}function S(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 C(e){return e instanceof HTMLInputElement&&`select`in e}function w(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&C(e)&&t&&e.select()}}var T=E();function E(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=D(e,t),e.unshift(t)},remove(t){e=D(e,t),e[0]?.resume()}}}function D(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ee(e){return e.filter(e=>e.tagName!==`A`)}var O=0;function te(){c.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??k()),document.body.insertAdjacentElement(`beforeend`,e[1]??k()),O++,()=>{O===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),O--}},[])}function k(){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 A=function(){return A=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},A.apply(this,arguments)};function j(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 ne(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 M=`right-scroll-bar-position`,N=`width-before-scroll-bar`,re=`with-scroll-bars-hidden`,ie=`--removed-body-scroll-bar-size`;function P(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ae(e,t){var n=(0,c.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 oe=typeof window<`u`?c.useLayoutEffect:c.useEffect,se=new WeakMap;function ce(e,t){var n=ae(t||null,function(t){return e.forEach(function(e){return P(e,t)})});return oe(function(){var t=se.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||P(e,null)}),i.forEach(function(e){r.has(e)||P(e,a)})}se.set(n,e)},[e]),n}function le(e){return e}function ue(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 de(e){e===void 0&&(e={});var t=ue(null);return t.options=A({async:!0,ssr:!1},e),t}var F=function(e){var t=e.sideCar,n=j(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 c.createElement(r,A({},n))};F.isSideCarExport=!0;function fe(e,t){return e.useMedium(t),F}var I=de(),L=function(){},R=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:L,onWheelCapture:L,onTouchMoveCapture:L}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=j(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ce([n,t]),w=A(A({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:I,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),A(A({},w),{ref:C})):c.createElement(y,A({},w,{className:l,ref:C}),s))});R.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},R.classNames={fullWidth:N,zeroRight:M};var z,pe=function(){if(z)return z;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function me(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=pe();return t&&e.setAttribute(`nonce`,t),e}function he(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ge(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var _e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=me())&&(he(t,n),ge(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ve=function(){var e=_e();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},B=function(){var e=ve();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ye={left:0,top:0,right:0,gap:0},V=function(e){return parseInt(e||``,10)||0},be=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[V(n),V(r),V(i)]},xe=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ye;var t=be(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])}},Se=B(),H=`data-scroll-locked`,Ce=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
2
|
.${re} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./checkbox-
|
|
1
|
+
import{t as e}from"./checkbox-BUx0Gkuf.js";import{a as t,i as n,n as r,r as i,t as a}from"./select-BFv1HMiT.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f}from"./delete-confirm-dialog-CPlNsLhM.js";import{Bt as p,H as m,Lt as h,gt as g,mt as _,zt as v}from"./index-C-ZPpKJ0.js";var y=g(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),b=p(v(),1),x=h();function S({...e}){return(0,x.jsx)(f,{"data-slot":`dialog`,...e})}function C({...e}){return(0,x.jsx)(u,{"data-slot":`dialog-portal`,...e})}function w({className:e,...t}){return(0,x.jsx)(o,{"data-slot":`dialog-overlay`,className:_(`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t})}function T({className:e,children:t,showCloseButton:n=!0,...r}){return(0,x.jsxs)(C,{"data-slot":`dialog-portal`,children:[(0,x.jsx)(w,{}),(0,x.jsxs)(d,{"data-slot":`dialog-content`,className:_(`data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg`,e),...r,children:[t,n&&(0,x.jsxs)(l,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,children:[(0,x.jsx)(y,{}),(0,x.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function E({className:e,...t}){return(0,x.jsx)(`div`,{"data-slot":`dialog-header`,className:_(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function D({className:e,showCloseButton:t=!1,children:n,...r}){return(0,x.jsxs)(`div`,{"data-slot":`dialog-footer`,className:_(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,x.jsx)(l,{asChild:!0,children:(0,x.jsx)(m,{variant:`outline`,children:`Close`})})]})}function O({className:e,...t}){return(0,x.jsx)(s,{"data-slot":`dialog-title`,className:_(`font-semibold text-lg leading-none`,e),...t})}function k({className:e,...t}){return(0,x.jsx)(c,{"data-slot":`dialog-description`,className:_(`text-muted-foreground text-sm`,e),...t})}function A({open:o,pending:s=!1,title:c=`Export thread`,onExport:l,onOpenChange:u}){let[d,f]=(0,b.useState)(`md`),[p,h]=(0,b.useState)(!0),[g,_]=(0,b.useState)(!1),[v,y]=(0,b.useState)(!0);return(0,x.jsx)(S,{open:o,onOpenChange:u,children:(0,x.jsxs)(T,{className:`border-[var(--border)] bg-[var(--panel)] text-[var(--foreground)]`,children:[(0,x.jsxs)(E,{children:[(0,x.jsx)(O,{children:c}),(0,x.jsx)(k,{className:`text-[var(--muted-foreground)]`,children:`Choose the transcript format and whether the export includes tool calls.`})]}),(0,x.jsxs)(`div`,{className:`space-y-5 py-2`,children:[(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`label`,{className:`font-medium text-sm`,htmlFor:`output-format`,children:`Output format`}),(0,x.jsxs)(a,{value:d,onValueChange:e=>f(e),children:[(0,x.jsx)(n,{id:`output-format`,className:`border-[var(--border)] bg-[var(--panel-secondary)]`,children:(0,x.jsx)(t,{placeholder:`Choose a format`})}),(0,x.jsxs)(r,{children:[(0,x.jsx)(i,{value:`md`,children:`Markdown (.md)`}),(0,x.jsx)(i,{value:`txt`,children:`Plain text (.txt)`})]})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include metadata`,checked:p,onCheckedChange:e=>h(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include metadata`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes the chat metadata section at the top of the exported transcript.`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include commentary`,checked:g,onCheckedChange:e=>_(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include commentary`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes assistant commentary-phase updates in the exported transcript.`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include tool calls`,checked:v,onCheckedChange:e=>y(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include tool calls`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes tool-call summaries and tool-output summaries in the export.`})]})]})]}),(0,x.jsxs)(D,{children:[(0,x.jsx)(m,{className:`rounded-full`,variant:`outline`,onClick:()=>u(!1),children:`Cancel`}),(0,x.jsx)(m,{className:`rounded-full`,disabled:s,onClick:()=>l({includeCommentary:g,includeMetadata:p,includeTools:v,outputFormat:d}),children:s?`Exporting...`:`Download export`})]})]})})}export{y as n,A as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{At as e,Bt as t,Dt as n,Et as r,Lt as i,Mt as a,Nt as o,Ot as s,Pt as c,St as l,Tt as u,_t as d,bt as f,jt as p,kt as m,wt as h,xt as g,yt as _,zt as v}from"./index-BVFnfS78.js";var y=class extends c{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=g(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),x(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof n(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!m(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&C(this.#t,r,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==r||n(this.options.enabled,this.#t)!==n(t.enabled,this.#t)||s(this.options.staleTime,this.#t)!==s(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==r||n(this.options.enabled,this.#t)!==n(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u)),t}#g(){this.#b();let e=s(this.options.staleTime,this.#t);if(l.isServer()||this.#r.isStale||!h(e))return;let t=p(this.#r.dataUpdatedAt,e)+1;this.#d=a.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(l.isServer()||n(this.options.enabled,this.#t)===!1||!h(this.#p)||this.#p===0)&&(this.#f=a.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(a.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(a.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let i=this.#t,a=this.options,o=this.#r,s=this.#i,c=this.#a,l=e===i?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let n=this.hasListeners(),r=!n&&x(e,t),o=n&&C(e,i,t,a);(r||o)&&(d={...d,..._(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:v}=d;p=d.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&v===`pending`){let e;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=o.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,p=r(o?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y)if(o&&p===s?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=r(o?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,h=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,S=v===`pending`,T=v===`error`,E=S&&b,D=p!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v===`success`,isError:T,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:T&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:T&&D,isStale:w(e,t),refetch:this.refetch,promise:this.#o,isEnabled:n(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,n=O.status===`error`&&!t,r=e=>{n?e.reject(O.error):t&&e.resolve(O.data)},a=()=>{r(this.#o=O.promise=g())},o=this.#o;switch(o.status){case`pending`:e.queryHash===i.queryHash&&r(o);break;case`fulfilled`:(n||O.data!==o.value)&&a();break;case`rejected`:(!n||O.error!==o.reason)&&a();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!m(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){f.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function b(e,t){return n(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&n(t.retryOnMount,e)===!1)}function x(e,t){return b(e,t)||e.state.data!==void 0&&S(e,t,t.refetchOnMount)}function S(e,t,r){if(n(t.enabled,e)!==!1&&s(t.staleTime,e)!==`static`){let n=typeof r==`function`?r(e):r;return n===`always`||n!==!1&&w(e,t)}return!1}function C(e,t,r,i){return(e!==t||n(i.enabled,e)===!1)&&(!r.suspense||e.state.status!==`error`)&&w(e,r)}function w(e,t){return n(t.enabled,e)!==!1&&e.isStaleByTime(s(t.staleTime,e))}function T(e,t){return!m(e.getCurrentResult(),t)}i();var E=t(v(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider;function k(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var A=E.createContext(k()),j=()=>E.useContext(A),M=(t,n,r)=>{let i=r?.state.error&&typeof t.throwOnError==`function`?e(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(n.isReset()||(t.retryOnMount=!1))},N=e=>{E.useEffect(()=>{e.clearReset()},[e])},P=({result:t,errorResetBoundary:n,throwOnError:r,query:i,suspense:a})=>t.isError&&!n.isReset()&&!t.isFetching&&i&&(a&&t.data===void 0||e(r,[t.error,i])),F=(e,t)=>t.state.data===void 0,I=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},L=(e,t)=>e.isLoading&&e.isFetching&&!t,R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let r=O(),i=j(),a=d(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,I(o),M(o,i,s),N(i);let p=!a.getQueryCache().get(o.queryHash),[m]=E.useState(()=>new t(a,o)),h=m.getOptimisticResult(o),g=!r&&c;if(E.useSyncExternalStore(E.useCallback(e=>{let t=g?m.subscribe(f.batchCalls(e)):u;return m.updateResult(),t},[m,g]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),E.useEffect(()=>{m.setOptions(o)},[o,m]),R(o,h))throw z(o,m,i);if(P({result:h,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw h.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,h),o.experimental_prefetchInRender&&!l.isServer()&&L(h,r)&&(p?z(o,m,i):s?.promise)?.catch(u).finally(()=>{m.updateResult()}),o.notifyOnChangeProps?h:m.trackResult(h)}function V(e,t){return B({...e,enabled:!0,suspense:!0,throwOnError:F,placeholderData:void 0},y,t)}var H=e=>e?e.split(/[-_\s]+/u).filter(Boolean).map(e=>{let t=e.toLowerCase();return t===`gpt`?`GPT`:/^[a-z]\d$/u.test(t)?t.toUpperCase():/^\d+(\.\d+)*$/u.test(e)?e:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}).join(` `):`Assistant`,U=new Map,W=e=>{let t=e??`local`,n=U.get(t);if(n)return n;let r={dayKeyFormatter:new Intl.DateTimeFormat(`en-CA`,{day:`2-digit`,month:`2-digit`,timeZone:e,year:`numeric`}),timePartsFormatter:new Intl.DateTimeFormat(`en-US`,{day:`numeric`,hour:`numeric`,hour12:!0,minute:`2-digit`,month:`short`,timeZone:e,year:`numeric`})};return U.set(t,r),r},G=(e,t)=>W(t).dayKeyFormatter.format(e),K=(e,t)=>{let n=W(t).timePartsFormatter.formatToParts(e),r=new Map(n.map(e=>[e.type,e.value])),i=r.get(`hour`),a=r.get(`minute`),o=r.get(`dayPeriod`);return!i||!a||!o?null:{day:r.get(`day`)??``,month:r.get(`month`)??``,time:`${i}:${a} ${o}`.trim(),year:r.get(`year`)??``}},q=e=>new Intl.NumberFormat(`en-US`).format(e),J=e=>`${q(e)} tokens`,Y=e=>{if(!e||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=n>=100||r===0?0:1;return`${n.toFixed(i)} ${t[r]}`},X=(e,t={})=>{if(e==null||e===``)return`n/a`;let n=new Date(e);if(Number.isNaN(n.getTime()))return`n/a`;let r=t.now??new Date,i=K(n,t.timeZone);if(!i)return`n/a`;let{day:a,month:o,time:s,year:c}=i;if(G(n,t.timeZone)===G(r,t.timeZone))return s;let l=K(r,t.timeZone)?.year;return c&&l&&c!==l?`${o} ${a}, ${c} · ${s}`:`${o} ${a} · ${s}`},Z=e=>e.length===0?`n/a`:e.join(`, `),Q=e=>e?`Yes`:`No`,$=H;export{$ as a,V as c,Z as i,B as l,Y as n,q as o,X as r,J as s,Q as t,y as u};
|
|
1
|
+
import{At as e,Bt as t,Dt as n,Et as r,Lt as i,Mt as a,Nt as o,Ot as s,Pt as c,St as l,Tt as u,_t as d,bt as f,jt as p,kt as m,wt as h,xt as g,yt as _,zt as v}from"./index-C-ZPpKJ0.js";var y=class extends c{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=g(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),x(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof n(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!m(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&C(this.#t,r,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==r||n(this.options.enabled,this.#t)!==n(t.enabled,this.#t)||s(this.options.staleTime,this.#t)!==s(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==r||n(this.options.enabled,this.#t)!==n(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u)),t}#g(){this.#b();let e=s(this.options.staleTime,this.#t);if(l.isServer()||this.#r.isStale||!h(e))return;let t=p(this.#r.dataUpdatedAt,e)+1;this.#d=a.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(l.isServer()||n(this.options.enabled,this.#t)===!1||!h(this.#p)||this.#p===0)&&(this.#f=a.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(a.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(a.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let i=this.#t,a=this.options,o=this.#r,s=this.#i,c=this.#a,l=e===i?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let n=this.hasListeners(),r=!n&&x(e,t),o=n&&C(e,i,t,a);(r||o)&&(d={...d,..._(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:v}=d;p=d.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&v===`pending`){let e;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=o.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,p=r(o?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y)if(o&&p===s?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=r(o?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,h=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,S=v===`pending`,T=v===`error`,E=S&&b,D=p!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v===`success`,isError:T,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:T&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:T&&D,isStale:w(e,t),refetch:this.refetch,promise:this.#o,isEnabled:n(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,n=O.status===`error`&&!t,r=e=>{n?e.reject(O.error):t&&e.resolve(O.data)},a=()=>{r(this.#o=O.promise=g())},o=this.#o;switch(o.status){case`pending`:e.queryHash===i.queryHash&&r(o);break;case`fulfilled`:(n||O.data!==o.value)&&a();break;case`rejected`:(!n||O.error!==o.reason)&&a();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!m(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){f.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function b(e,t){return n(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&n(t.retryOnMount,e)===!1)}function x(e,t){return b(e,t)||e.state.data!==void 0&&S(e,t,t.refetchOnMount)}function S(e,t,r){if(n(t.enabled,e)!==!1&&s(t.staleTime,e)!==`static`){let n=typeof r==`function`?r(e):r;return n===`always`||n!==!1&&w(e,t)}return!1}function C(e,t,r,i){return(e!==t||n(i.enabled,e)===!1)&&(!r.suspense||e.state.status!==`error`)&&w(e,r)}function w(e,t){return n(t.enabled,e)!==!1&&e.isStaleByTime(s(t.staleTime,e))}function T(e,t){return!m(e.getCurrentResult(),t)}i();var E=t(v(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider;function k(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var A=E.createContext(k()),j=()=>E.useContext(A),M=(t,n,r)=>{let i=r?.state.error&&typeof t.throwOnError==`function`?e(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(n.isReset()||(t.retryOnMount=!1))},N=e=>{E.useEffect(()=>{e.clearReset()},[e])},P=({result:t,errorResetBoundary:n,throwOnError:r,query:i,suspense:a})=>t.isError&&!n.isReset()&&!t.isFetching&&i&&(a&&t.data===void 0||e(r,[t.error,i])),F=(e,t)=>t.state.data===void 0,I=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},L=(e,t)=>e.isLoading&&e.isFetching&&!t,R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let r=O(),i=j(),a=d(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,I(o),M(o,i,s),N(i);let p=!a.getQueryCache().get(o.queryHash),[m]=E.useState(()=>new t(a,o)),h=m.getOptimisticResult(o),g=!r&&c;if(E.useSyncExternalStore(E.useCallback(e=>{let t=g?m.subscribe(f.batchCalls(e)):u;return m.updateResult(),t},[m,g]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),E.useEffect(()=>{m.setOptions(o)},[o,m]),R(o,h))throw z(o,m,i);if(P({result:h,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw h.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,h),o.experimental_prefetchInRender&&!l.isServer()&&L(h,r)&&(p?z(o,m,i):s?.promise)?.catch(u).finally(()=>{m.updateResult()}),o.notifyOnChangeProps?h:m.trackResult(h)}function V(e,t){return B({...e,enabled:!0,suspense:!0,throwOnError:F,placeholderData:void 0},y,t)}var H=e=>e?e.split(/[-_\s]+/u).filter(Boolean).map(e=>{let t=e.toLowerCase();return t===`gpt`?`GPT`:/^[a-z]\d$/u.test(t)?t.toUpperCase():/^\d+(\.\d+)*$/u.test(e)?e:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}).join(` `):`Assistant`,U=new Map,W=e=>{let t=e??`local`,n=U.get(t);if(n)return n;let r={dayKeyFormatter:new Intl.DateTimeFormat(`en-CA`,{day:`2-digit`,month:`2-digit`,timeZone:e,year:`numeric`}),timePartsFormatter:new Intl.DateTimeFormat(`en-US`,{day:`numeric`,hour:`numeric`,hour12:!0,minute:`2-digit`,month:`short`,timeZone:e,year:`numeric`})};return U.set(t,r),r},G=(e,t)=>W(t).dayKeyFormatter.format(e),K=(e,t)=>{let n=W(t).timePartsFormatter.formatToParts(e),r=new Map(n.map(e=>[e.type,e.value])),i=r.get(`hour`),a=r.get(`minute`),o=r.get(`dayPeriod`);return!i||!a||!o?null:{day:r.get(`day`)??``,month:r.get(`month`)??``,time:`${i}:${a} ${o}`.trim(),year:r.get(`year`)??``}},q=e=>new Intl.NumberFormat(`en-US`).format(e),J=e=>`${q(e)} tokens`,Y=e=>{if(!e||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=n>=100||r===0?0:1;return`${n.toFixed(i)} ${t[r]}`},X=(e,t={})=>{if(e==null||e===``)return`n/a`;let n=new Date(e);if(Number.isNaN(n.getTime()))return`n/a`;let r=t.now??new Date,i=K(n,t.timeZone);if(!i)return`n/a`;let{day:a,month:o,time:s,year:c}=i;if(G(n,t.timeZone)===G(r,t.timeZone))return s;let l=K(r,t.timeZone)?.year;return c&&l&&c!==l?`${o} ${a}, ${c} · ${s}`:`${o} ${a} · ${s}`},Z=e=>e.length===0?`n/a`:e.join(`, `),Q=e=>e?`Yes`:`No`,$=H;export{$ as a,V as c,Z as i,B as l,Y as n,q as o,X as r,J as s,Q as t,y as u};
|