@ucdjs/pipelines-server 0.0.1-beta.1
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/LICENSE +21 -0
- package/dist/client/assets/badge-CiZ9XGQk.js +1 -0
- package/dist/client/assets/card-BlDtnoJE.js +1 -0
- package/dist/client/assets/code.lazy-FGQTh0m_.js +155 -0
- package/dist/client/assets/file-code-5UzxVDjG.js +1 -0
- package/dist/client/assets/graph.lazy-BOYYfhw3.js +1 -0
- package/dist/client/assets/graph.lazy-DA9DvkOv.js +1 -0
- package/dist/client/assets/graphs.lazy-B126tNcm.js +1 -0
- package/dist/client/assets/index-CM5XQ164.js +37 -0
- package/dist/client/assets/index-DMk-WqWb.css +2 -0
- package/dist/client/assets/index.lazy-CU14Wam7.js +1 -0
- package/dist/client/assets/index.lazy-Cb2iPSue.js +1 -0
- package/dist/client/assets/index.lazy-wtKmX-2H.js +1 -0
- package/dist/client/assets/index.lazy-y07R4t6D.js +1 -0
- package/dist/client/assets/inspect.lazy-BYA5YEbr.js +1 -0
- package/dist/client/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/client/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/client/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/client/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/client/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/client/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/client/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/client/assets/javascript-DKcGLuub.js +1 -0
- package/dist/client/assets/json-CgREIYS1.js +1 -0
- package/dist/client/assets/loader-circle-BY1Dugig.js +1 -0
- package/dist/client/assets/pipeline-command-palette-CWHY1w53.js +45 -0
- package/dist/client/assets/pipeline-graph-CDObZuGJ.js +7 -0
- package/dist/client/assets/pipeline-graph-CHpVij2M.css +1 -0
- package/dist/client/assets/play-B6p-hHI7.js +1 -0
- package/dist/client/assets/route.lazy-D79_-rW6.js +1 -0
- package/dist/client/assets/route.lazy-eVSF2dsv.js +1 -0
- package/dist/client/assets/status-icon-NVeRT4ag.js +1 -0
- package/dist/client/assets/table-Cbx6lsBL.js +1 -0
- package/dist/client/assets/typescript-xi0cSHCO.js +1 -0
- package/dist/client/assets/use-execute-CG1fzzQp.js +1 -0
- package/dist/client/assets/use-pipeline-versions-Dg2J_cPs.js +1 -0
- package/dist/client/index.html +13 -0
- package/dist/server/app.js +11915 -0
- package/dist/server/assets/prompt-DsUQ1V87-C-0muHOG.js +843 -0
- package/package.json +100 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{t as e}from"./file-code-5UzxVDjG.js";import{t}from"./loader-circle-BY1Dugig.js";import{t as n}from"./play-B6p-hHI7.js";import{t as r}from"./use-execute-CG1fzzQp.js";import{G as i,K as a,O as o,R as s,V as c,Y as l,_ as u,a as d,b as f,g as p,h as m,k as h,m as g,p as _,q as v,v as y,x as b,y as x,z as S}from"./index-CM5XQ164.js";var C=g(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ee=g(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),te=g(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ne=g(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),w=l(i(),1),T=a();function re({...e}){return(0,T.jsx)(p,{"data-slot":`dialog`,...e})}function ie({...e}){return(0,T.jsx)(u,{"data-slot":`dialog-portal`,...e})}function E({className:e,...t}){return(0,T.jsx)(b,{"data-slot":`dialog-overlay`,className:v(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,e),...t})}function D({className:e,children:t,showCloseButton:n=!0,...r}){return(0,T.jsxs)(ie,{children:[(0,T.jsx)(E,{}),(0,T.jsxs)(y,{"data-slot":`dialog-content`,className:v(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,e),...r,children:[t,n&&(0,T.jsxs)(f,{"data-slot":`dialog-close`,render:(0,T.jsx)(o,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,T.jsx)(_,{}),(0,T.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function ae({className:e,...t}){return(0,T.jsx)(`div`,{"data-slot":`dialog-header`,className:v(`gap-2 flex flex-col`,e),...t})}function O({className:e,...t}){return(0,T.jsx)(m,{"data-slot":`dialog-title`,className:v(`text-base leading-none font-medium`,e),...t})}function oe({className:e,...t}){return(0,T.jsx)(x,{"data-slot":`dialog-description`,className:v(`text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3`,e),...t})}function se({className:e,...t}){return(0,T.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:v(`border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-lg border transition-colors has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto`,e),...t})}var ce=h(`text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none`,{variants:{align:{"inline-start":`pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first`,"inline-end":`pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last`,"block-start":`px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}});function le({className:e,align:t=`inline-start`,...n}){return(0,T.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:v(ce({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}h(`gap-2 text-sm shadow-none flex items-center`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});var ue=1,de=.9,fe=.8,pe=.17,me=.1,he=.999,ge=.9999,_e=.99,ve=/[\\\/_+.#"@\[\(\{&]/,ye=/[\\\/_+.#"@\[\(\{&]/g,be=/[\s-]/,xe=/[\s-]/g;function Se(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?ue:_e;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Se(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=ue:ve.test(e.charAt(l-1))?(d*=fe,p=e.slice(i,l-1).match(ye),p&&i>0&&(d*=he**+p.length)):be.test(e.charAt(l-1))?(d*=de,m=e.slice(i,l-1).match(xe),m&&i>0&&(d*=he**+m.length)):(d*=pe,i>0&&(d*=he**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=ge)),(d<me&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Se(e,t,n,r,l+1,a+2,o),f*me>d&&(d=f*me)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Ce(e){return e.toLowerCase().replace(xe,` `)}function we(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Se(e,t,Ce(e),Ce(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Te(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function A(...e){return t=>{let n=!1,r=e.map(e=>{let r=Te(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Te(e[t],null)}}}}function j(...e){return w.useCallback(A(...e),e)}function Ee(e,t){let n=w.createContext(t),r=e=>{let{children:t,...r}=e,i=w.useMemo(()=>r,Object.values(r));return(0,T.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=w.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function De(e,t=[]){let n=[];function r(t,r){let i=w.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=w.useMemo(()=>o,Object.values(o));return(0,T.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=w.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>w.createContext(e));return function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Oe(i,...t)]}function Oe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var M=globalThis?.document?w.useLayoutEffect:()=>{},ke=w.useId||(()=>void 0),Ae=0;function N(e){let[t,n]=w.useState(ke());return M(()=>{e||n(e=>e??String(Ae++))},[e]),e||(t?`radix-${t}`:``)}var je=w.useInsertionEffect||M;function Me({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ne({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=w.useRef(e!==void 0);w.useEffect(()=>{let e=t.current;if(e!==s){let t=e?`controlled`:`uncontrolled`,n=s?`controlled`:`uncontrolled`;console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}return[c,w.useCallback(t=>{if(s){let n=Pe(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Ne({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return je(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Pe(e){return typeof e==`function`}var Fe=l(s(),1);function Ie(e){let t=Le(e),n=w.forwardRef((e,n)=>{let{children:r,...i}=e,a=w.Children.toArray(r),o=a.find(ze);if(o){let e=o.props.children,r=a.map(t=>t===o?w.Children.count(e)>1?w.Children.only(null):w.isValidElement(e)?e.props.children:null:t);return(0,T.jsx)(t,{...i,ref:n,children:w.isValidElement(e)?w.cloneElement(e,void 0,r):null})}return(0,T.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Le(e){let t=w.forwardRef((e,t)=>{let{children:n,...r}=e;if(w.isValidElement(n)){let e=Ve(n),i=Be(r,n.props);return n.type!==w.Fragment&&(i.ref=t?A(t,e):e),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Re=Symbol(`radix.slottable`);function ze(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Re}function Be(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ve(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var P=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ie(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,T.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function He(e,t){e&&Fe.flushSync(()=>e.dispatchEvent(t))}function F(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...e)=>t.current?.(...e),[])}function Ue(e,t=globalThis?.document){let n=F(e);w.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var We=`DismissableLayer`,Ge=`dismissableLayer.update`,Ke=`dismissableLayer.pointerDownOutside`,qe=`dismissableLayer.focusOutside`,Je,Ye=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xe=w.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=w.useContext(Ye),[u,d]=w.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=w.useState({}),m=j(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=$e(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=et(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Ue(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),w.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Je=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),tt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Je)}},[u,f,n,l]),w.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),tt())},[u,l]),w.useEffect(()=>{let e=()=>p({});return document.addEventListener(Ge,e),()=>document.removeEventListener(Ge,e)},[]),(0,T.jsx)(P.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:k(e.onFocusCapture,S.onFocusCapture),onBlurCapture:k(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,x.onPointerDownCapture)})});Xe.displayName=We;var Ze=`DismissableLayerBranch`,Qe=w.forwardRef((e,t)=>{let n=w.useContext(Ye),r=w.useRef(null),i=j(t,r);return w.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,T.jsx)(P.div,{...e,ref:i})});Qe.displayName=Ze;function $e(e,t=globalThis?.document){let n=F(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){nt(Ke,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function et(e,t=globalThis?.document){let n=F(e),r=w.useRef(!1);return w.useEffect(()=>{let e=e=>{e.target&&!r.current&&nt(qe,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tt(){let e=new CustomEvent(Ge);document.dispatchEvent(e)}function nt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?He(i,a):i.dispatchEvent(a)}var rt=`focusScope.autoFocusOnMount`,it=`focusScope.autoFocusOnUnmount`,at={bubbles:!1,cancelable:!0},ot=`FocusScope`,st=w.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=w.useState(null),l=F(i),u=F(a),d=w.useRef(null),f=j(t,e=>c(e)),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:I(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||I(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&I(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),w.useEffect(()=>{if(s){mt.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(rt,at);s.addEventListener(rt,l),s.dispatchEvent(t),t.defaultPrevented||(ct(_t(ut(s)),{select:!0}),document.activeElement===e&&I(s))}return()=>{s.removeEventListener(rt,l),setTimeout(()=>{let t=new CustomEvent(it,at);s.addEventListener(it,u),s.dispatchEvent(t),t.defaultPrevented||I(e??document.body,{select:!0}),s.removeEventListener(it,u),mt.remove(p)},0)}}},[s,l,u,p]);let m=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=lt(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&I(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&I(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,T.jsx)(P.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});st.displayName=ot;function ct(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(I(r,{select:t}),document.activeElement!==n)return}function lt(e){let t=ut(e);return[dt(t,e),dt(t.reverse(),e)]}function ut(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 dt(e,t){for(let n of e)if(!ft(n,{upTo:t}))return n}function ft(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 pt(e){return e instanceof HTMLInputElement&&`select`in e}function I(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pt(e)&&t&&e.select()}}var mt=ht();function ht(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=gt(e,t),e.unshift(t)},remove(t){e=gt(e,t),e[0]?.resume()}}}function gt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _t(e){return e.filter(e=>e.tagName!==`A`)}var vt=`Portal`,yt=w.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=w.useState(!1);M(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Fe.createPortal((0,T.jsx)(P.div,{...r,ref:t}),o):null});yt.displayName=vt;function bt(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}var xt=e=>{let{present:t,children:n}=e,r=St(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=j(r.ref,wt(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null};xt.displayName=`Presence`;function St(e){let[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),a=w.useRef(`none`),[o,s]=bt(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return w.useEffect(()=>{let e=Ct(r.current);a.current=o===`mounted`?e:`none`},[o]),M(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ct(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),M(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ct(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ct(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:w.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ct(e){return e?.animationName||`none`}function wt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Tt=0;function Et(){w.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Dt()),document.body.insertAdjacentElement(`beforeend`,e[1]??Dt()),Tt++,()=>{Tt===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Tt--}},[])}function Dt(){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 L=function(){return L=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},L.apply(this,arguments)};function Ot(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 kt(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 At=`right-scroll-bar-position`,jt=`width-before-scroll-bar`,Mt=`with-scroll-bars-hidden`,Nt=`--removed-body-scroll-bar-size`;function Pt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ft(e,t){var n=(0,w.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 It=typeof window<`u`?w.useLayoutEffect:w.useEffect,Lt=new WeakMap;function Rt(e,t){var n=Ft(t||null,function(t){return e.forEach(function(e){return Pt(e,t)})});return It(function(){var t=Lt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Pt(e,null)}),i.forEach(function(e){r.has(e)||Pt(e,a)})}Lt.set(n,e)},[e]),n}function zt(e){return e}function Bt(e,t){t===void 0&&(t=zt);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 Vt(e){e===void 0&&(e={});var t=Bt(null);return t.options=L({async:!0,ssr:!1},e),t}var Ht=function(e){var t=e.sideCar,n=Ot(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 w.createElement(r,L({},n))};Ht.isSideCarExport=!0;function Ut(e,t){return e.useMedium(t),Ht}var Wt=Vt(),Gt=function(){},Kt=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Gt,onWheelCapture:Gt,onTouchMoveCapture:Gt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Ot(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Rt([n,t]),C=L(L({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Wt,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?w.cloneElement(w.Children.only(s),L(L({},C),{ref:S})):w.createElement(v,L({},C,{className:c,ref:S}),s))});Kt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Kt.classNames={fullWidth:jt,zeroRight:At};var qt,Jt=function(){if(qt)return qt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Yt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Jt();return t&&e.setAttribute(`nonce`,t),e}function Xt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Zt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Qt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Yt())&&(Xt(t,n),Zt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$t=function(){var e=Qt();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},en=function(){var e=$t();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},tn={left:0,top:0,right:0,gap:0},nn=function(e){return parseInt(e||``,10)||0},rn=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[nn(n),nn(r),nn(i)]},an=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return tn;var t=rn(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])}},on=en(),R=`data-scroll-locked`,sn=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
|
+
.${Mt} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${R}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${At} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${jt} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${At} .${At} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${jt} .${jt} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${R}] {
|
|
36
|
+
${Nt}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},cn=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ln=function(){w.useEffect(function(){return document.body.setAttribute(R,(cn()+1).toString()),function(){var e=cn()-1;e<=0?document.body.removeAttribute(R):document.body.setAttribute(R,e.toString())}},[])},un=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ln();var a=w.useMemo(function(){return an(i)},[i]);return w.createElement(on,{styles:sn(a,!t,i,n?``:`!important`)})},dn=!1;if(typeof window<`u`)try{var fn=Object.defineProperty({},`passive`,{get:function(){return dn=!0,!0}});window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var z=dn?{passive:!1}:!1,pn=function(e){return e.tagName===`TEXTAREA`},mn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!pn(e)&&n[t]===`visible`)},hn=function(e){return mn(e,`overflowY`)},gn=function(e){return mn(e,`overflowX`)},_n=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),bn(e,r)){var i=xn(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},vn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},yn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},bn=function(e,t){return e===`v`?hn(t):gn(t)},xn=function(e,t){return e===`v`?vn(t):yn(t)},Sn=function(e,t){return e===`h`&&t===`rtl`?-1:1},Cn=function(e,t,n,r,i){var a=Sn(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=xn(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&bn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},B=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wn=function(e){return[e.deltaX,e.deltaY]},Tn=function(e){return e&&`current`in e?e.current:e},En=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Dn=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},On=0,V=[];function kn(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(On++)[0],a=w.useState(en)[0],o=w.useRef(e);w.useEffect(function(){o.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=kt([e.lockRef.current],(e.shards||[]).map(Tn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=B(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=_n(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=_n(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Cn(h,t,e,h===`h`?s:c,!0)},[]),c=w.useCallback(function(e){var n=e;if(!(!V.length||V[V.length-1]!==a)){var r=`deltaY`in n?wn(n):B(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&En(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Tn).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=w.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:An(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=w.useCallback(function(e){n.current=B(e),r.current=void 0},[]),d=w.useCallback(function(t){l(t.type,wn(t),t.target,s(t,e.lockRef.current))},[]),f=w.useCallback(function(t){l(t.type,B(t),t.target,s(t,e.lockRef.current))},[]);w.useEffect(function(){return V.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,z),document.addEventListener(`touchmove`,c,z),document.addEventListener(`touchstart`,u,z),function(){V=V.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,z),document.removeEventListener(`touchmove`,c,z),document.removeEventListener(`touchstart`,u,z)}},[]);var p=e.removeScrollBar,m=e.inert;return w.createElement(w.Fragment,null,m?w.createElement(a,{styles:Dn(i)}):null,p?w.createElement(un,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function An(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var jn=Ut(Wt,kn),Mn=w.forwardRef(function(e,t){return w.createElement(Kt,L({},e,{ref:t,sideCar:jn}))});Mn.classNames=Kt.classNames;var Nn=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},H=new WeakMap,Pn=new WeakMap,U={},Fn=0,In=function(e){return e&&(e.host||In(e.parentNode))},Ln=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=In(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Rn=function(e,t,n,r){var i=Ln(t,Array.isArray(e)?e:[e]);U[n]||(U[n]=new WeakMap);var a=U[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(H.get(e)||0)+1,l=(a.get(e)||0)+1;H.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Pn.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Fn++,function(){o.forEach(function(e){var t=H.get(e)-1,i=a.get(e)-1;H.set(e,t),a.set(e,i),t||(Pn.has(e)||e.removeAttribute(r),Pn.delete(e)),i||e.removeAttribute(n)}),Fn--,Fn||(H=new WeakMap,H=new WeakMap,Pn=new WeakMap,U={})}},zn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Nn(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Rn(r,i,n,`aria-hidden`)):function(){return null}},Bn=`Dialog`,[Vn,Hn]=De(Bn),[Un,W]=Vn(Bn),Wn=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=w.useRef(null),c=w.useRef(null),[l,u]=Me({prop:r,defaultProp:i??!1,onChange:a,caller:Bn});return(0,T.jsx)(Un,{scope:t,triggerRef:s,contentRef:c,contentId:N(),titleId:N(),descriptionId:N(),open:l,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Wn.displayName=Bn;var Gn=`DialogTrigger`,Kn=w.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(Gn,n),a=j(t,i.triggerRef);return(0,T.jsx)(P.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":dr(i.open),...r,ref:a,onClick:k(e.onClick,i.onOpenToggle)})});Kn.displayName=Gn;var qn=`DialogPortal`,[Jn,Yn]=Vn(qn,{forceMount:void 0}),Xn=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=W(qn,t);return(0,T.jsx)(Jn,{scope:t,forceMount:n,children:w.Children.map(r,e=>(0,T.jsx)(xt,{present:n||a.open,children:(0,T.jsx)(yt,{asChild:!0,container:i,children:e})}))})};Xn.displayName=qn;var Zn=`DialogOverlay`,Qn=w.forwardRef((e,t)=>{let n=Yn(Zn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=W(Zn,e.__scopeDialog);return a.modal?(0,T.jsx)(xt,{present:r||a.open,children:(0,T.jsx)(er,{...i,ref:t})}):null});Qn.displayName=Zn;var $n=Ie(`DialogOverlay.RemoveScroll`),er=w.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(Zn,n);return(0,T.jsx)(Mn,{as:$n,allowPinchZoom:!0,shards:[i.contentRef],children:(0,T.jsx)(P.div,{"data-state":dr(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),G=`DialogContent`,tr=w.forwardRef((e,t)=>{let n=Yn(G,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=W(G,e.__scopeDialog);return(0,T.jsx)(xt,{present:r||a.open,children:a.modal?(0,T.jsx)(nr,{...i,ref:t}):(0,T.jsx)(rr,{...i,ref:t})})});tr.displayName=G;var nr=w.forwardRef((e,t)=>{let n=W(G,e.__scopeDialog),r=w.useRef(null),i=j(t,n.contentRef,r);return w.useEffect(()=>{let e=r.current;if(e)return zn(e)},[]),(0,T.jsx)(ir,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:k(e.onFocusOutside,e=>e.preventDefault())})}),rr=w.forwardRef((e,t)=>{let n=W(G,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return(0,T.jsx)(ir,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ir=w.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=W(G,n),c=w.useRef(null),l=j(t,c);return Et(),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(st,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,T.jsx)(Xe,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":dr(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(hr,{titleId:s.titleId}),(0,T.jsx)(_r,{contentRef:c,descriptionId:s.descriptionId})]})]})}),ar=`DialogTitle`,or=w.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(ar,n);return(0,T.jsx)(P.h2,{id:i.titleId,...r,ref:t})});or.displayName=ar;var sr=`DialogDescription`,cr=w.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(sr,n);return(0,T.jsx)(P.p,{id:i.descriptionId,...r,ref:t})});cr.displayName=sr;var lr=`DialogClose`,ur=w.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=W(lr,n);return(0,T.jsx)(P.button,{type:`button`,...r,ref:t,onClick:k(e.onClick,()=>i.onOpenChange(!1))})});ur.displayName=lr;function dr(e){return e?`open`:`closed`}var fr=`DialogTitleWarning`,[pr,mr]=Ee(fr,{contentName:G,titleName:ar,docsSlug:`dialog`}),hr=({titleId:e})=>{let t=mr(fr),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
+
|
|
43
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
+
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},gr=`DialogDescriptionWarning`,_r=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${mr(gr).contentName}}.`;return w.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},vr=Wn,yr=Xn,br=Qn,xr=tr,Sr=Symbol.for(`react.lazy`),Cr=w.use;function wr(e){return typeof e==`object`&&!!e&&`then`in e}function Tr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Sr&&`_payload`in e&&wr(e._payload)}function Er(e){let t=Dr(e),n=w.forwardRef((e,n)=>{let{children:r,...i}=e;Tr(r)&&typeof Cr==`function`&&(r=Cr(r._payload));let a=w.Children.toArray(r),o=a.find(kr);if(o){let e=o.props.children,r=a.map(t=>t===o?w.Children.count(e)>1?w.Children.only(null):w.isValidElement(e)?e.props.children:null:t);return(0,T.jsx)(t,{...i,ref:n,children:w.isValidElement(e)?w.cloneElement(e,void 0,r):null})}return(0,T.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Dr(e){let t=w.forwardRef((e,t)=>{let{children:n,...r}=e;if(Tr(n)&&typeof Cr==`function`&&(n=Cr(n._payload)),w.isValidElement(n)){let e=jr(n),i=Ar(r,n.props);return n.type!==w.Fragment&&(i.ref=t?A(t,e):e),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Or=Symbol(`radix.slottable`);function kr(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Or}function Ar(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function jr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var K=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Er(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,T.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),q=`[cmdk-group=""]`,Mr=`[cmdk-group-items=""]`,Nr=`[cmdk-group-heading=""]`,Pr=`[cmdk-item=""]`,Fr=`${Pr}:not([aria-disabled="true"])`,Ir=`cmdk-item-select`,J=`data-value`,Lr=(e,t,n)=>we(e,t,n),Rr=w.createContext(void 0),Y=()=>w.useContext(Rr),zr=w.createContext(void 0),Br=()=>w.useContext(zr),Vr=w.createContext(void 0),Hr=w.forwardRef((e,t)=>{let n=Q(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Q(()=>new Set),i=Q(()=>new Map),a=Q(()=>new Map),o=Q(()=>new Set),s=$r(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=N(),y=N(),b=N(),x=w.useRef(null),S=ti();Z(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Z(()=>{S(6,ie)},[]);let C=w.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)re(),ne(),S(1,T);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=E()?.id,C.emit()}),r||S(5,ie),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),ee=w.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,te(t,r)),S(2,()=>{ne(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{re(),ne(),n.current.value||T(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=E();S(4,()=>{re(),t?.getAttribute(`id`)===e&&T(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function te(e,t){let r=s.current?.filter??Lr;return e?r(e,n.current.search,t):0}function ne(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;D().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Mr);t?t.appendChild(e.parentElement===t?e:e.closest(`${Mr} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Mr} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${q}[${J}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function T(){let e=D().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(J);C.setState(`value`,e||void 0)}function re(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=te(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ie(){var e;let t=E();t&&(t.parentElement?.firstChild===t&&((e=t.closest(q)?.querySelector(Nr))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function E(){return x.current?.querySelector(`${Pr}[aria-selected="true"]`)}function D(){return Array.from(x.current?.querySelectorAll(Fr)||[])}function ae(e){let t=D()[e];t&&C.setState(`value`,t.getAttribute(J))}function O(e){var t;let n=E(),r=D(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(J))}function oe(e){let t=E()?.closest(q),n;for(;t&&!n;)t=e>0?Zr(t,q):Qr(t,q),n=t?.querySelector(Fr);n?C.setState(`value`,n.getAttribute(J)):O(e)}let se=()=>ae(D().length-1),ce=e=>{e.preventDefault(),e.metaKey?se():e.altKey?oe(1):O(1)},le=e=>{e.preventDefault(),e.metaKey?ae(0):e.altKey?oe(-1):O(-1)};return w.createElement(K.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ce(e);break;case`ArrowDown`:ce(e);break;case`p`:case`k`:g&&e.ctrlKey&&le(e);break;case`ArrowUp`:le(e);break;case`Home`:e.preventDefault(),ae(0);break;case`End`:e.preventDefault(),se();break;case`Enter`:{e.preventDefault();let t=E();if(t){let e=new Event(Ir);t.dispatchEvent(e)}}}}},w.createElement(`label`,{"cmdk-label":``,htmlFor:ee.inputId,id:ee.labelId,style:ii},c),ri(e,e=>w.createElement(zr.Provider,{value:C},w.createElement(Rr.Provider,{value:ee},e))))}),Ur=w.forwardRef((e,t)=>{let n=N(),r=w.useRef(null),i=w.useContext(Vr),a=Y(),o=$r(e),s=o.current?.forceMount??i?.forceMount;Z(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=ei(n,r,[e.value,e.children,r],e.keywords),l=Br(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);w.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Ir,f),()=>t.removeEventListener(Ir,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return w.createElement(K.div,{ref:A(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Wr=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=N(),s=w.useRef(null),c=w.useRef(null),l=N(),u=Y(),d=$(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Z(()=>u.group(o),[]),ei(o,s,[e.value,e.heading,c]);let f=w.useMemo(()=>({id:o,forceMount:i}),[i]);return w.createElement(K.div,{ref:A(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&w.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),ri(e,e=>w.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},w.createElement(Vr.Provider,{value:f},e))))}),Gr=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=w.useRef(null),a=$(e=>!e.search);return!n&&!a?null:w.createElement(K.div,{ref:A(i,t),...r,"cmdk-separator":``,role:`separator`})}),Kr=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Br(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=Y();return w.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),w.createElement(K.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),qr=w.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=w.useRef(null),o=w.useRef(null),s=$(e=>e.selectedItemId),c=Y();return w.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),w.createElement(K.div,{ref:A(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},ri(e,e=>w.createElement(`div`,{ref:A(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Jr=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return w.createElement(vr,{open:n,onOpenChange:r},w.createElement(yr,{container:o},w.createElement(br,{"cmdk-overlay":``,className:i}),w.createElement(xr,{"aria-label":e.label,"cmdk-dialog":``,className:a},w.createElement(Hr,{ref:t,...s}))))}),Yr=w.forwardRef((e,t)=>$(e=>e.filtered.count===0)?w.createElement(K.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Xr=w.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return w.createElement(K.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ri(e,e=>w.createElement(`div`,{"aria-hidden":!0},e)))}),X=Object.assign(Hr,{List:qr,Item:Ur,Input:Kr,Group:Wr,Separator:Gr,Dialog:Jr,Empty:Yr,Loading:Xr});function Zr(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Qr(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $r(e){let t=w.useRef(e);return Z(()=>{t.current=e}),t}var Z=typeof window>`u`?w.useEffect:w.useLayoutEffect;function Q(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=Br(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function ei(e,t,n,r=[]){let i=w.useRef(),a=Y();return Z(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(J,s),i.current=s}),i}var ti=()=>{let[e,t]=w.useState(),n=Q(()=>new Map);return Z(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ni(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function ri({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(ni(t),{ref:t.ref},n(t.props.children)):n(t)}var ii={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function ai({className:e,...t}){return(0,T.jsx)(X,{"data-slot":`command`,className:v(`bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden`,e),...t})}function oi({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,T.jsxs)(re,{...a,children:[(0,T.jsxs)(ae,{className:`sr-only`,children:[(0,T.jsx)(O,{children:e}),(0,T.jsx)(oe,{children:t})]}),(0,T.jsx)(D,{className:v(`rounded-xl! top-1/3 translate-y-0 overflow-hidden p-0`,r),showCloseButton:i,children:n})]})}function si({className:e,...t}){return(0,T.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,T.jsxs)(se,{className:`bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,T.jsx)(X.Input,{"data-slot":`command-input`,className:v(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,T.jsx)(le,{children:(0,T.jsx)(te,{className:`size-4 shrink-0 opacity-50`})})]})})}function ci({className:e,...t}){return(0,T.jsx)(X.List,{"data-slot":`command-list`,className:v(`no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto`,e),...t})}function li({className:e,...t}){return(0,T.jsx)(X.Empty,{"data-slot":`command-empty`,className:v(`py-6 text-center text-sm`,e),...t})}function ui({className:e,...t}){return(0,T.jsx)(X.Group,{"data-slot":`command-group`,className:v(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium`,e),...t})}function di({className:e,children:t,...n}){return(0,T.jsxs)(X.Item,{"data-slot":`command-item`,className:v(`data-selected:bg-muted data-selected:text-foreground data-selected:**:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! [&_svg:not([class*='size-'])]:size-4 group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...n,children:[t,(0,T.jsx)(C,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function fi({className:e,...t}){return(0,T.jsx)(`span`,{"data-slot":`command-shortcut`,className:v(`text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-xs tracking-widest`,e),...t})}var pi=`ucd-versions-`;function mi(e,t){if(typeof window>`u`)return t;try{let n=localStorage.getItem(`${pi}${e}`);if(n){let e=JSON.parse(n).filter(e=>t.includes(e));if(e.length>0)return e}}catch{}return t}function hi(){let[i,a]=(0,w.useState)(!1),[o,s]=(0,w.useState)(``),{data:l}=d(),{execute:u,executing:f}=r(),p=S(),m=c({strict:!1}),h=typeof m.file==`string`?m.file:void 0,g=typeof m.id==`string`?m.id:void 0,_=(l?.files??[]).flatMap(e=>e.pipelines.map(t=>({...t,fileId:e.fileId,fileLabel:e.fileLabel??e.filePath}))),v=_.find(e=>e.id===g&&e.fileId===h);(0,w.useEffect)(()=>{let e=e=>{e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),a(e=>!e))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]),(0,w.useEffect)(()=>{if(!i||!v||f)return;let e=async e=>{if(e.key===`e`&&(e.metaKey||e.ctrlKey)){e.preventDefault();try{let e=mi(`${v.fileId}:${v.id}`,v.versions);await u(v.fileId,v.id,e),a(!1)}catch(e){console.error(`Failed to execute pipeline:`,e)}}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i,v,u,f]),(0,w.useEffect)(()=>{i||s(``)},[i]);let y=(0,w.useCallback)(async()=>{if(!(!v||f))try{let e=mi(`${v.fileId}:${v.id}`,v.versions);await u(v.fileId,v.id,e),a(!1)}catch(e){console.error(`Failed to execute pipeline:`,e)}},[v,u,f]),b=(0,w.useCallback)(async(e,t,n)=>{if(!f)try{await u(e,t,mi(`${e}:${t}`,n)),a(!1)}catch(e){console.error(`Failed to execute pipeline:`,e)}},[u,f]),x=(0,w.useCallback)(e=>{p({to:e}),a(!1)},[p]);return(0,T.jsx)(oi,{open:i,onOpenChange:a,children:(0,T.jsxs)(ai,{children:[(0,T.jsx)(si,{placeholder:`Type a command or search...`,value:o,onValueChange:s}),(0,T.jsxs)(ci,{children:[(0,T.jsx)(li,{children:`No results found.`}),v&&(0,T.jsxs)(ui,{heading:`Current Pipeline`,children:[(0,T.jsxs)(di,{onSelect:y,disabled:f,children:[f?(0,T.jsx)(t,{className:`mr-2 h-4 w-4 animate-spin`}):(0,T.jsx)(n,{className:`mr-2 h-4 w-4`}),`Execute Current Pipeline`,(0,T.jsx)(fi,{children:`⌘E`})]}),(0,T.jsxs)(di,{onSelect:()=>x(`/pipelines/${v.fileId}/${v.id}/code`),children:[(0,T.jsx)(e,{className:`mr-2 h-4 w-4`}),`View Current Pipeline Code`]}),(0,T.jsxs)(di,{onSelect:()=>x(`/pipelines/${v.fileId}/${v.id}/executions`),children:[(0,T.jsx)(ee,{className:`mr-2 h-4 w-4`}),`View Pipeline Executions`]})]}),(0,T.jsx)(ui,{heading:`All Pipelines`,children:_.map(e=>(0,T.jsxs)(di,{onSelect:()=>b(e.fileId,e.id,e.versions),value:`${e.fileId}-${e.id}`,disabled:f,children:[f?(0,T.jsx)(t,{className:`mr-2 h-4 w-4 animate-spin`}):(0,T.jsx)(ne,{className:`mr-2 h-4 w-4`}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-0.5 flex-1 min-w-0`,children:[(0,T.jsx)(`span`,{className:`truncate`,children:e.name||e.id}),(0,T.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate`,children:e.fileLabel})]}),(0,T.jsxs)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:[e.versions.length,` `,`versions`]})]},`${e.fileId}-${e.id}`))})]})]})})}export{hi as PipelineCommandPalette};
|