@powerhousedao/connect 5.1.0 → 5.2.0-staging.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/.env +1 -0
- package/dist/assets/AddDriveModal-CMhY7EXt.js +1 -0
- package/dist/assets/ClearStorageModal-DFtnMF37.js +1 -0
- package/dist/assets/CookiesPolicyModal-wKn_crAz.js +1 -0
- package/dist/assets/CreateDocumentModal-axk-Gv87.js +1 -0
- package/dist/assets/{DebugSettingsModal-CooFY-Go.js → DebugSettingsModal-B8EImEik.js} +1 -1
- package/dist/assets/{DeleteDriveModal-BOdu1bg5.js → DeleteDriveModal-CDBGjFVT.js} +1 -1
- package/dist/assets/DeleteItemModal--lW49X7Z.js +1 -0
- package/dist/assets/DisclaimerModal-Cwlnu4SD.js +1 -0
- package/dist/assets/DriveSettingsModal-DLSYwH01.js +1 -0
- package/dist/assets/{ExportDocumentWithErrorsModal-BzgGSmxg.js → ExportDocumentWithErrorsModal-sNmpWNiL.js} +1 -1
- package/dist/assets/SettingsModal-BI_PIj3P.js +1 -0
- package/dist/assets/UpgradeDriveModal-fS2KcP5T.js +1 -0
- package/dist/assets/{design_system-DGYPpUGa.js → design_system-DRiFz7P7.js} +1 -1
- package/dist/assets/design_system_connect-D7mJC7XF.js +45 -0
- package/dist/assets/design_system_ui-7P3ayrQ9.js +1 -0
- package/dist/assets/{document_drive-BEIKnuGM.js → document_drive-BuVpBb4l.js} +25 -14
- package/dist/assets/{document_engineering-B49PhCDR.js → document_engineering-CXK5S1hf.js} +1 -1
- package/dist/assets/{document_model-DXcLJEjZ.js → document_model-DB4SzBSe.js} +3 -3
- package/dist/assets/document_model_editor-C7-Rcfye.js +23 -0
- package/dist/assets/{drive_explorer-d0kn77Nx.js → drive_explorer-xuI0xiNd.js} +2 -2
- package/dist/assets/{graphql-editor-CSkqTexL.js → graphql-editor-BpQTpuKO.js} +2 -2
- package/dist/assets/{hooks-D4Uas2SG.js → hooks-CAyBWwxg.js} +1 -1
- package/dist/assets/index-BchTCSNf.js +20 -0
- package/dist/assets/index-BilHslhO.css +1 -0
- package/dist/assets/index-CJrSFr5V.js +25 -0
- package/dist/assets/json-editor-CtpJfU25.js +1 -0
- package/dist/assets/nodefs-CNM_9qdV.js +1 -0
- package/dist/assets/opfs-ahp-D-CiKXE2.js +3 -0
- package/dist/assets/pg_dump-CW0pN9tG.wasm +0 -0
- package/dist/assets/postgres-CkP7QCDB.data +0 -0
- package/dist/assets/postgres-CyuUVpXN.wasm +0 -0
- package/dist/assets/reactor_browser-CV2asu7c.js +127 -0
- package/dist/assets/state-schemas-DXZotcNp.js +2 -0
- package/dist/assets/zod-BpTyxkjy.js +20 -0
- package/dist/index.html +11 -11
- package/heroku/Dockerfile +4 -1
- package/lib/package.copy.json +14 -8
- package/lib/src/components/app-skeleton.js +1 -1
- package/lib/src/components/app-skeleton.js.map +1 -1
- package/lib/src/components/modal/modals/AddDriveModal.d.ts.map +1 -1
- package/lib/src/components/modal/modals/AddDriveModal.js +35 -27
- package/lib/src/components/modal/modals/AddDriveModal.js.map +1 -1
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts +2 -0
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js +26 -0
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/index.d.ts +2 -0
- package/lib/src/components/modal/modals/InspectorModal/index.d.ts.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/index.js +2 -0
- package/lib/src/components/modal/modals/InspectorModal/index.js.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts +32 -0
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js +108 -0
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.d.ts +4 -0
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.d.ts.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.js +12 -0
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.js.map +1 -0
- package/lib/src/components/modal/modals-container.d.ts.map +1 -1
- package/lib/src/components/modal/modals-container.js +4 -0
- package/lib/src/components/modal/modals-container.js.map +1 -1
- package/lib/src/components/root.js +1 -1
- package/lib/src/components/root.js.map +1 -1
- package/lib/src/components/sidebar.d.ts.map +1 -1
- package/lib/src/components/sidebar.js +6 -2
- package/lib/src/components/sidebar.js.map +1 -1
- package/lib/src/connect.config.d.ts +2 -0
- package/lib/src/connect.config.d.ts.map +1 -1
- package/lib/src/connect.config.js +1 -0
- package/lib/src/connect.config.js.map +1 -1
- package/lib/src/feature-flags.d.ts +22 -3
- package/lib/src/feature-flags.d.ts.map +1 -1
- package/lib/src/feature-flags.js +48 -3
- package/lib/src/feature-flags.js.map +1 -1
- package/lib/src/hooks/useClientErrorHandler.d.ts.map +1 -1
- package/lib/src/hooks/useClientErrorHandler.js +13 -2
- package/lib/src/hooks/useClientErrorHandler.js.map +1 -1
- package/lib/src/pages/demo/atlas-import.js +2 -2
- package/lib/src/pages/demo/atlas-import.js.map +1 -1
- package/lib/src/store/reactor.d.ts.map +1 -1
- package/lib/src/store/reactor.js +102 -51
- package/lib/src/store/reactor.js.map +1 -1
- package/lib/src/utils/reactor.d.ts +7 -0
- package/lib/src/utils/reactor.d.ts.map +1 -1
- package/lib/src/utils/reactor.js +35 -2
- package/lib/src/utils/reactor.js.map +1 -1
- package/lib/src/utils/signer.d.ts +18 -0
- package/lib/src/utils/signer.d.ts.map +1 -0
- package/lib/src/utils/signer.js +215 -0
- package/lib/src/utils/signer.js.map +1 -0
- package/lib/test/utils/signer.test.d.ts +2 -0
- package/lib/test/utils/signer.test.d.ts.map +1 -0
- package/lib/test/utils/signer.test.js +319 -0
- package/lib/test/utils/signer.test.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/vite.config.d.ts.map +1 -1
- package/lib/vite.config.js +4 -0
- package/lib/vite.config.js.map +1 -1
- package/lib/vitest.config.d.ts +3 -0
- package/lib/vitest.config.d.ts.map +1 -0
- package/lib/vitest.config.js +8 -0
- package/lib/vitest.config.js.map +1 -0
- package/nginx.conf +7 -0
- package/package.copy.json +14 -8
- package/package.json +21 -15
- package/dist/assets/AddDriveModal-_XSf2ZlN.js +0 -1
- package/dist/assets/ClearStorageModal-CbfJTlAo.js +0 -1
- package/dist/assets/CookiesPolicyModal-DTRuUeM_.js +0 -1
- package/dist/assets/CreateDocumentModal-DUTbfZYr.js +0 -1
- package/dist/assets/DeleteItemModal-D8MlQS3W.js +0 -1
- package/dist/assets/DisclaimerModal-RBBaiKyO.js +0 -1
- package/dist/assets/DriveSettingsModal-BHBZfzaY.js +0 -1
- package/dist/assets/SettingsModal-BXDXscnR.js +0 -1
- package/dist/assets/UpgradeDriveModal-15TBzq11.js +0 -1
- package/dist/assets/design_system_connect-Vb8XBnLs.js +0 -45
- package/dist/assets/design_system_ui-Dnwc_Xm9.js +0 -1
- package/dist/assets/document_model_editor-lmHQ6HZy.js +0 -23
- package/dist/assets/index-Br7E7qjt.css +0 -1
- package/dist/assets/index-CK2Jk_ho.js +0 -18
- package/dist/assets/json-editor-CQKAVxat.js +0 -1
- package/dist/assets/reactor_browser-BGn_P-dn.js +0 -25
- package/dist/assets/state-schemas-36mF-wEI.js +0 -2
- package/dist/assets/zod-C6yxFxyo.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,S as Et,e as At,P as Z,c as fe,f as Ke,g as St,C as Pt,u as Be,a as Ot}from"./document_model_editor-C7-Rcfye.js";import{r as l,a as X}from"./sentry_react-cODD7zWc.js";import{c as p,I as L,u as re,E as It,F as Dt,O as Ft,G as Tt,b as He,d as Vt,R as zt,a as _t,P as Ge,e as de,A as Ue,f as We,g as Lt,H as $t,J as Mt,K as qt,L as Kt,N as Bt,D as Ht,C as Gt,i as Ut}from"./design_system-DRiFz7P7.js";import{R as Wt,T as Jt,P as Xt,C as Qt,a as Ee,u as Yt,b as Zt}from"./design_system_connect-D7mJC7XF.js";import{t as er}from"./tailwind_merge-Dr4f9Rms.js";import"./react-DQSxOgtG.js";import"./reactor_browser-CV2asu7c.js";import{r as tr}from"./react-dom/client-BVPiT_FE.js";var xa=tr();const rr=At(p("inline-flex items-center justify-center gap-2","whitespace-nowrap rounded-md text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:pointer-events-none","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"),{variants:{variant:{default:"",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),ar=l.forwardRef(({variant:e,className:t,asChild:r=!1,...s},n)=>{const o=r?Et:"button";return a.jsx(o,{className:p(rr({variant:e,className:t})),ref:n,...s})}),nr=l.forwardRef(({children:e,className:t,...r},s)=>a.jsx(Qt,{ref:s,...r,className:p("z-50 overflow-hidden rounded-md text-sm","border border-gray-200 bg-white text-gray-900 dark:border-gray-900 dark:bg-slate-900 dark:text-gray-200","px-3 py-1.5 shadow-md","data-[state=open]:animate-fade-in data-[state=open]:animate-zoom-in","data-[state=closed]:animate-fade-out data-[state=closed]:animate-zoom-out","data-[side=bottom]:animate-slide-in-from-top","data-[side=left]:animate-slide-in-from-right","data-[side=right]:animate-slide-in-from-left","data-[side=top]:animate-slide-in-from-bottom",t),children:e})),Ae=({content:e,children:t,triggerAsChild:r=!1,delayDuration:s=0,...n})=>{const{open:o,defaultOpen:d,onOpenChange:i,...f}=n;return a.jsxs(Wt,{defaultOpen:d,delayDuration:s,onOpenChange:i,open:o,children:[a.jsx(Jt,{asChild:r,type:r?void 0:"button",children:t}),a.jsx(Xt,{children:a.jsx(nr,{sideOffset:3,...f,children:e})})]})},Je=({children:e,required:t,disabled:r,description:s,hasError:n,inline:o,className:d,...i})=>{const f=p("inline-flex items-center text-sm font-medium",o?"leading-[22px]":"leading-4",`text-gray-900 ${o?"dark:text-gray-400":"dark:text-gray-50"}`,n&&"group-hover:!text-red-900 dark:group-hover:!text-red-900",n&&o&&"text-red-800 dark:text-red-800",n&&!o&&"text-red-900 dark:text-red-900",r&&`cursor-not-allowed text-gray-700 ${o?"dark:text-gray-600":"dark:text-gray-300"}`,o?!r&&"group-hover:text-gray-900 dark:group-hover:text-slate-50":"mb-[3px]",d);if(!e)return null;const c={...i};return a.jsxs("label",{className:f,...c,children:[e,t&&a.jsx("span",{className:p("ml-1 text-gray-800 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-slate-50",n&&`${o?"!text-red-800":"!text-red-900"} group-hover:!text-red-900`),children:"*"}),s&&a.jsx(Ee,{children:a.jsx(Ae,{content:s,children:a.jsx(L,{name:"CircleInfo",size:16,className:p("ml-1 cursor-pointer text-gray-600 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-500",r&&"text-gray-500")})})})]})},sr="p",_e=({children:e,type:t="info",as:r,className:s,...n})=>{const o=r||sr,i=p("mb-0 inline-flex items-center text-xs font-medium",{error:"text-red-900 dark:text-red-900",info:"text-blue-900 dark:text-blue-900",warning:"text-yellow-900 dark:text-yellow-900"}[t],s);return a.jsx(o,{"data-type":t,className:i,...n,children:e})},xe=({messages:e,type:t="info",className:r,...s})=>{if(e.length===0)return null;if(e.length===1)return a.jsx(_e,{type:t,...s,children:e[0]});const n={error:"before:bg-red-900 dark:before:bg-red-900",info:"before:bg-blue-900 dark:before:bg-blue-900",warning:"before:bg-orange-900 dark:before:bg-orange-900"};return a.jsx("ul",{className:p("flex flex-col gap-1",r),...s,children:e.map(o=>a.jsx(_e,{as:"li",type:t,className:p("relative pl-4","before:absolute before:left-0 before:top-[0.4em] before:size-2 before:rounded-full",n[t]),children:o},o))})};var Le=1,or=.9,lr=.8,ir=.17,we=.1,Ce=.999,cr=.9999,dr=.99,ur=/[\\\/_+.#"@\[\(\{&]/,fr=/[\\\/_+.#"@\[\(\{&]/g,gr=/[\s-]/,Xe=/[\s-]/g;function Se(e,t,r,s,n,o,d){if(o===t.length)return n===e.length?Le:dr;var i=`${n},${o}`;if(d[i]!==void 0)return d[i];for(var f=s.charAt(o),c=r.indexOf(f,n),g=0,x,j,v,R;c>=0;)x=Se(e,t,r,s,c+1,o+1,d),x>g&&(c===n?x*=Le:ur.test(e.charAt(c-1))?(x*=lr,v=e.slice(n,c-1).match(fr),v&&n>0&&(x*=Math.pow(Ce,v.length))):gr.test(e.charAt(c-1))?(x*=or,R=e.slice(n,c-1).match(Xe),R&&n>0&&(x*=Math.pow(Ce,R.length))):(x*=ir,n>0&&(x*=Math.pow(Ce,c-n))),e.charAt(c)!==t.charAt(o)&&(x*=cr)),(x<we&&r.charAt(c-1)===s.charAt(o+1)||s.charAt(o+1)===s.charAt(o)&&r.charAt(c-1)!==s.charAt(o))&&(j=Se(e,t,r,s,c+1,o+2,d),j*we>x&&(x=j*we)),x>g&&(g=x),c=r.indexOf(f,c+1);return d[i]=g,g}function $e(e){return e.toLowerCase().replace(Xe," ")}function mr(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Se(e,t,$e(e),$e(t),0,0,{})}var ce='[cmdk-group=""]',Ne='[cmdk-group-items=""]',pr='[cmdk-group-heading=""]',Qe='[cmdk-item=""]',Me=`${Qe}:not([aria-disabled="true"])`,Pe="cmdk-item-select",se="data-value",hr=(e,t,r)=>mr(e,t,r),Ye=l.createContext(void 0),ge=()=>l.useContext(Ye),Ze=l.createContext(void 0),Ie=()=>l.useContext(Ze),et=l.createContext(void 0),tt=l.forwardRef((e,t)=>{let r=oe(()=>{var u,y;return{search:"",value:(y=(u=e.value)!=null?u:e.defaultValue)!=null?y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=oe(()=>new Set),n=oe(()=>new Map),o=oe(()=>new Map),d=oe(()=>new Set),i=rt(e),{label:f,children:c,value:g,onValueChange:x,filter:j,shouldFilter:v,loop:R,disablePointerSelection:O=!1,vimBindings:b=!0,...A}=e,S=re(),H=re(),q=re(),T=l.useRef(null),w=Er();ae(()=>{if(g!==void 0){let u=g.trim();r.current.value=u,E.emit()}},[g]),ae(()=>{w(6,k)},[]);let E=l.useMemo(()=>({subscribe:u=>(d.current.add(u),()=>d.current.delete(u)),snapshot:()=>r.current,setState:(u,y,h)=>{var m,C,N,D;if(!Object.is(r.current[u],y)){if(r.current[u]=y,u==="search")G(),P(),w(1,$);else if(u==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let F=document.getElementById(q);F?F.focus():(m=document.getElementById(S))==null||m.focus()}if(w(7,()=>{var F;r.current.selectedItemId=(F=I())==null?void 0:F.id,E.emit()}),h||w(5,k),((C=i.current)==null?void 0:C.value)!==void 0){let F=y??"";(D=(N=i.current).onValueChange)==null||D.call(N,F);return}}E.emit()}},emit:()=>{d.current.forEach(u=>u())}}),[]),V=l.useMemo(()=>({value:(u,y,h)=>{var m;y!==((m=o.current.get(u))==null?void 0:m.value)&&(o.current.set(u,{value:y,keywords:h}),r.current.filtered.items.set(u,z(y,h)),w(2,()=>{P(),E.emit()}))},item:(u,y)=>(s.current.add(u),y&&(n.current.has(y)?n.current.get(y).add(u):n.current.set(y,new Set([u]))),w(3,()=>{G(),P(),r.current.value||$(),E.emit()}),()=>{o.current.delete(u),s.current.delete(u),r.current.filtered.items.delete(u);let h=I();w(4,()=>{G(),h?.getAttribute("id")===u&&$(),E.emit()})}),group:u=>(n.current.has(u)||n.current.set(u,new Set),()=>{o.current.delete(u),n.current.delete(u)}),filter:()=>i.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:S,inputId:q,labelId:H,listInnerRef:T}),[]);function z(u,y){var h,m;let C=(m=(h=i.current)==null?void 0:h.filter)!=null?m:hr;return u?C(u,r.current.search,y):0}function P(){if(!r.current.search||i.current.shouldFilter===!1)return;let u=r.current.filtered.items,y=[];r.current.filtered.groups.forEach(m=>{let C=n.current.get(m),N=0;C.forEach(D=>{let F=u.get(D);N=Math.max(F,N)}),y.push([m,N])});let h=T.current;M().sort((m,C)=>{var N,D;let F=m.getAttribute("id"),W=C.getAttribute("id");return((N=u.get(W))!=null?N:0)-((D=u.get(F))!=null?D:0)}).forEach(m=>{let C=m.closest(Ne);C?C.appendChild(m.parentElement===C?m:m.closest(`${Ne} > *`)):h.appendChild(m.parentElement===h?m:m.closest(`${Ne} > *`))}),y.sort((m,C)=>C[1]-m[1]).forEach(m=>{var C;let N=(C=T.current)==null?void 0:C.querySelector(`${ce}[${se}="${encodeURIComponent(m[0])}"]`);N?.parentElement.appendChild(N)})}function $(){let u=M().find(h=>h.getAttribute("aria-disabled")!=="true"),y=u?.getAttribute(se);E.setState("value",y||void 0)}function G(){var u,y,h,m;if(!r.current.search||i.current.shouldFilter===!1){r.current.filtered.count=s.current.size;return}r.current.filtered.groups=new Set;let C=0;for(let N of s.current){let D=(y=(u=o.current.get(N))==null?void 0:u.value)!=null?y:"",F=(m=(h=o.current.get(N))==null?void 0:h.keywords)!=null?m:[],W=z(D,F);r.current.filtered.items.set(N,W),W>0&&C++}for(let[N,D]of n.current)for(let F of D)if(r.current.filtered.items.get(F)>0){r.current.filtered.groups.add(N);break}r.current.filtered.count=C}function k(){var u,y,h;let m=I();m&&(((u=m.parentElement)==null?void 0:u.firstChild)===m&&((h=(y=m.closest(ce))==null?void 0:y.querySelector(pr))==null||h.scrollIntoView({block:"nearest"})),m.scrollIntoView({block:"nearest"}))}function I(){var u;return(u=T.current)==null?void 0:u.querySelector(`${Qe}[aria-selected="true"]`)}function M(){var u;return Array.from(((u=T.current)==null?void 0:u.querySelectorAll(Me))||[])}function U(u){let y=M()[u];y&&E.setState("value",y.getAttribute(se))}function Q(u){var y;let h=I(),m=M(),C=m.findIndex(D=>D===h),N=m[C+u];(y=i.current)!=null&&y.loop&&(N=C+u<0?m[m.length-1]:C+u===m.length?m[0]:m[C+u]),N&&E.setState("value",N.getAttribute(se))}function _(u){let y=I(),h=y?.closest(ce),m;for(;h&&!m;)h=u>0?Nr(h,ce):Rr(h,ce),m=h?.querySelector(Me);m?E.setState("value",m.getAttribute(se)):Q(u)}let K=()=>U(M().length-1),te=u=>{u.preventDefault(),u.metaKey?K():u.altKey?_(1):Q(1)},ne=u=>{u.preventDefault(),u.metaKey?U(0):u.altKey?_(-1):Q(-1)};return l.createElement(Z.div,{ref:t,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:u=>{var y;(y=A.onKeyDown)==null||y.call(A,u);let h=u.nativeEvent.isComposing||u.keyCode===229;if(!(u.defaultPrevented||h))switch(u.key){case"n":case"j":{b&&u.ctrlKey&&te(u);break}case"ArrowDown":{te(u);break}case"p":case"k":{b&&u.ctrlKey&&ne(u);break}case"ArrowUp":{ne(u);break}case"Home":{u.preventDefault(),U(0);break}case"End":{u.preventDefault(),K();break}case"Enter":{u.preventDefault();let m=I();if(m){let C=new Event(Pe);m.dispatchEvent(C)}}}}},l.createElement("label",{"cmdk-label":"",htmlFor:V.inputId,id:V.labelId,style:Sr},f),ye(e,u=>l.createElement(Ze.Provider,{value:E},l.createElement(Ye.Provider,{value:V},u))))}),xr=l.forwardRef((e,t)=>{var r,s;let n=re(),o=l.useRef(null),d=l.useContext(et),i=ge(),f=rt(e),c=(s=(r=f.current)==null?void 0:r.forceMount)!=null?s:d?.forceMount;ae(()=>{if(!c)return i.item(n,d?.id)},[c]);let g=at(n,o,[e.value,e.children,o],e.keywords),x=Ie(),j=Y(w=>w.value&&w.value===g.current),v=Y(w=>c||i.filter()===!1?!0:w.search?w.filtered.items.get(n)>0:!0);l.useEffect(()=>{let w=o.current;if(!(!w||e.disabled))return w.addEventListener(Pe,R),()=>w.removeEventListener(Pe,R)},[v,e.onSelect,e.disabled]);function R(){var w,E;O(),(E=(w=f.current).onSelect)==null||E.call(w,g.current)}function O(){x.setState("value",g.current,!0)}if(!v)return null;let{disabled:b,value:A,onSelect:S,forceMount:H,keywords:q,...T}=e;return l.createElement(Z.div,{ref:fe(o,t),...T,id:n,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!j,"data-disabled":!!b,"data-selected":!!j,onPointerMove:b||i.getDisablePointerSelection()?void 0:O,onClick:b?void 0:R},e.children)}),vr=l.forwardRef((e,t)=>{let{heading:r,children:s,forceMount:n,...o}=e,d=re(),i=l.useRef(null),f=l.useRef(null),c=re(),g=ge(),x=Y(v=>n||g.filter()===!1?!0:v.search?v.filtered.groups.has(d):!0);ae(()=>g.group(d),[]),at(d,i,[e.value,e.heading,f]);let j=l.useMemo(()=>({id:d,forceMount:n}),[n]);return l.createElement(Z.div,{ref:fe(i,t),...o,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},r&&l.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),ye(e,v=>l.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},l.createElement(et.Provider,{value:j},v))))}),br=l.forwardRef((e,t)=>{let{alwaysRender:r,...s}=e,n=l.useRef(null),o=Y(d=>!d.search);return!r&&!o?null:l.createElement(Z.div,{ref:fe(n,t),...s,"cmdk-separator":"",role:"separator"})}),yr=l.forwardRef((e,t)=>{let{onValueChange:r,...s}=e,n=e.value!=null,o=Ie(),d=Y(c=>c.search),i=Y(c=>c.selectedItemId),f=ge();return l.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),l.createElement(Z.input,{ref:t,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":i,id:f.inputId,type:"text",value:n?e.value:d,onChange:c=>{n||o.setState("search",c.target.value),r?.(c.target.value)}})}),kr=l.forwardRef((e,t)=>{let{children:r,label:s="Suggestions",...n}=e,o=l.useRef(null),d=l.useRef(null),i=Y(c=>c.selectedItemId),f=ge();return l.useEffect(()=>{if(d.current&&o.current){let c=d.current,g=o.current,x,j=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let v=c.offsetHeight;g.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return j.observe(c),()=>{cancelAnimationFrame(x),j.unobserve(c)}}},[]),l.createElement(Z.div,{ref:fe(o,t),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":s,id:f.listId},ye(e,c=>l.createElement("div",{ref:fe(d,f.listInnerRef),"cmdk-list-sizer":""},c)))}),jr=l.forwardRef((e,t)=>{let{open:r,onOpenChange:s,overlayClassName:n,contentClassName:o,container:d,...i}=e;return l.createElement(It,{open:r,onOpenChange:s},l.createElement(Dt,{container:d},l.createElement(Ft,{"cmdk-overlay":"",className:n}),l.createElement(Tt,{"aria-label":e.label,"cmdk-dialog":"",className:o},l.createElement(tt,{ref:t,...i}))))}),wr=l.forwardRef((e,t)=>Y(r=>r.filtered.count===0)?l.createElement(Z.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Cr=l.forwardRef((e,t)=>{let{progress:r,children:s,label:n="Loading...",...o}=e;return l.createElement(Z.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},ye(e,d=>l.createElement("div",{"aria-hidden":!0},d)))}),B=Object.assign(tt,{List:kr,Item:xr,Input:yr,Group:vr,Separator:br,Dialog:jr,Empty:wr,Loading:Cr});function Nr(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Rr(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function rt(e){let t=l.useRef(e);return ae(()=>{t.current=e}),t}var ae=typeof window>"u"?l.useEffect:l.useLayoutEffect;function oe(e){let t=l.useRef();return t.current===void 0&&(t.current=e()),t}function Y(e){let t=Ie(),r=()=>e(t.snapshot());return l.useSyncExternalStore(t.subscribe,r,r)}function at(e,t,r,s=[]){let n=l.useRef(),o=ge();return ae(()=>{var d;let i=(()=>{var c;for(let g of r){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(c=g.current.textContent)==null?void 0:c.trim():n.current}})(),f=s.map(c=>c.trim());o.value(e,i,f),(d=t.current)==null||d.setAttribute(se,i),n.current=i}),n}var Er=()=>{let[e,t]=l.useState(),r=oe(()=>new Map);return ae(()=>{r.current.forEach(s=>s()),r.current=new Map},[e]),(s,n)=>{r.current.set(s,n),t({})}};function Ar(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ye({asChild:e,children:t},r){return e&&l.isValidElement(t)?l.cloneElement(Ar(t),{ref:t.ref},r(t.props.children)):r(t)}var Sr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const nt=X.forwardRef(({className:e,...t},r)=>a.jsx(B,{ref:r,className:p("flex size-full flex-col rounded-md [&_[cmdk-label]]:hidden",e),...t}));nt.displayName=B.displayName;const st=X.forwardRef(({wrapperClassName:e,className:t,...r},s)=>a.jsxs("div",{className:p("group relative flex items-center border-b","border-b-gray-300 dark:border-b-gray-900","hover:border-b-gray-300 dark:hover:border-b-gray-800","hover:bg-gray-100 dark:hover:bg-gray-900","focus-within:border-b-gray-300 dark:focus-within:border-b-gray-800","focus-within:bg-gray-100 dark:focus-within:bg-gray-900",e),"cmdk-input-wrapper":"",children:[a.jsx(L,{name:"Search",size:16,className:p("pointer-events-none absolute left-2 top-3.5 text-gray-500 dark:text-gray-700","group-hover:text-gray-700 dark:group-hover:text-gray-500","group-focus-within:!text-gray-900 dark:group-focus-within:!text-gray-50")}),a.jsx(B.Input,{ref:s,className:p("flex w-full bg-transparent pb-2 pl-8 pr-3 pt-3 text-[14px] font-normal leading-5 outline-none","placeholder:text-gray-500 dark:placeholder:text-gray-700","group-hover:placeholder:text-gray-700 dark:group-hover:placeholder:text-gray-500","group-focus-within:placeholder:!text-gray-700 dark:group-focus-within:placeholder:!text-gray-300","disabled:cursor-not-allowed",t),...r})]}));st.displayName=B.Input.displayName;const De=X.forwardRef(({className:e,...t},r)=>a.jsx(B.List,{ref:r,className:p("max-h-[300px] overflow-y-auto overflow-x-hidden","focus:outline-none","scrollbar-thin scrollbar-gutter-stable","scrollbar-track-transparent","scrollbar-thumb-gray-300 hover:scrollbar-thumb-gray-300","dark:scrollbar-thumb-charcoal-700 dark:hover:scrollbar-thumb-charcoal-700","scrollbar-thumb-rounded-md",e),...t}));De.displayName=B.List.displayName;const Pr=X.forwardRef((e,t)=>a.jsx(B.Loading,{ref:t,...e}));Pr.displayName=B.Loading.displayName;const Fe=X.forwardRef((e,t)=>a.jsx(B.Empty,{ref:t,...e}));Fe.displayName=B.Empty.displayName;const ve=X.forwardRef(({className:e,...t},r)=>a.jsx(B.Group,{ref:r,className:p("overflow-hidden px-0.5 py-1","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));ve.displayName=B.Group.displayName;const ke=X.forwardRef(({className:e,...t},r)=>a.jsx(B.Item,{ref:r,className:p("relative flex select-none items-center justify-between","h-8 gap-2 rounded-md py-1.5 pl-1.5 pr-2.5","text-[14px] leading-4 outline-none","border-y-2 border-white dark:border-slate-600","data-[disabled=true]:pointer-events-none","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));ke.displayName=B.Item.displayName;function ue(e,t,r=new Map){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0||typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return r.get(e)===t?!0:(r.set(e,t),e.length===t.length&&e.every((s,n)=>ue(s,t[n],r)));if(typeof e=="object"&&typeof t=="object"&&!Array.isArray(e)&&!Array.isArray(t)){if(r.get(e)===t)return!0;r.set(e,t);const s=Object.keys(e),n=Object.keys(t);return s.length===n.length&&s.every(o=>o in t&&ue(e[o],t[o],r))}return!1}const be={trimOnBlur:(e=!0)=>({transformer:t=>t?.trim(),options:{trigger:"blur",if:e}}),lowercaseOnChange:(e=!0)=>({transformer:t=>t?.toLowerCase(),options:{trigger:"change",if:e}}),uppercaseOnChange:(e=!0)=>({transformer:t=>t?.toUpperCase(),options:{trigger:"change",if:e}}),trimOnEnter:(e=!0)=>({transformer:t=>t?.trim(),options:{trigger:"keyDown",if:e}})},Or=(e,t)=>l.forwardRef(({value:r,name:s,showErrorOnBlur:n,showErrorOnChange:o,validators:d,...i},f)=>{const{onChange:c,onBlur:g}=i,{control:x,formState:{errors:j,defaultValues:v},trigger:R,setValue:O,getValues:b}=Ke(),{submitCount:A}=St();if(!s)throw new Error(`[Field: ${e.displayName}] The name prop is required.`);const S=[...j[s]?.types?Object.values(j[s].types??[]):[]];S.length===0&&j[s]&&S.push("Invalid value"),l.useEffect(()=>{A>0&&R(s)},[i.required]),l.useEffect(()=>{i.errors&&i.errors.length>0&&R(s)},[s,i.errors,R]);const[H,q]=l.useState(!1);return l.useEffect(()=>{H&&O(s,r),q(!0)},[s,r]),r!==void 0&&!c&&console.warn(`[Field: ${s}] Value prop provided without onChange so it will be ignored. Use disabled/readOnly if you want to prevent changes.`),a.jsx(Pt,{control:x,name:s,defaultValue:r??i.defaultValue,disabled:i.disabled,render:({field:{onChange:T,onBlur:w,value:E,...V}})=>{const z=l.useCallback(k=>{n?R(s):w(),g&&g(k)},[w,n]),P=l.useCallback(k=>{if(c)Object.hasOwn(k,"target")?O(s,k.target.value):O(s,k),c(k);else{let I=k;(k instanceof Event||k.target instanceof HTMLElement)&&(I=k.target.value),O(s,I)}o===void 0&&n===void 0?A>0&&R(s):o&&R(s)},[E,o,n,A]),{ref:$}=V,G=k=>{typeof f=="function"?f(k):f&&(f.current=k),$(k)};return a.jsx(e,{...i,...V,value:E,onBlur:z,onChange:P,errors:S,ref:G})},rules:{...i.required?{required:{value:i.required,message:"This field is required"}}:{required:void 0},...i.pattern&&{pattern:{value:new RegExp(i.pattern),message:"This field does not match the required pattern"}},...i.maxLength!==void 0&&i.maxLength>=0?{maxLength:{value:i.maxLength,message:`This field must be at most ${i.maxLength} characters`}}:{maxLength:void 0},...i.minLength!==void 0&&i.minLength>=0?{minLength:{value:i.minLength,message:`This field must be at least ${i.minLength} characters`}}:{minLength:void 0},...i.minValue&&{min:{value:i.minValue,message:`This field must be greater than or equal to ${i.minValue}`}},...i.maxValue&&{max:{value:i.maxValue,message:`This field must be less than or equal to ${i.maxValue}`}},validate:{...i.errors?Object.fromEntries(Array.isArray(i.errors)?i.errors.map((T,w)=>[`_propError${w}`,()=>T]):[]):{},...d!==void 0?Object.fromEntries((Array.isArray(d)?d:[d]).map((T,w)=>[`customValidation${w}`,T])):{}}}})}),ot=({children:e,as:t,className:r})=>{const s=t??"p";return a.jsx(s,{className:p("font-sans text-sm font-normal leading-5 text-gray-600 dark:text-gray-500",r),children:e})},lt=({children:e})=>a.jsx("div",{className:"flex flex-col gap-2",children:e});var je="Popover",[it]=_t(je,[He]),me=He(),[Ir,ee]=it(je),ct=e=>{const{__scopePopover:t,children:r,open:s,defaultOpen:n,onOpenChange:o,modal:d=!1}=e,i=me(t),f=l.useRef(null),[c,g]=l.useState(!1),[x,j]=Vt({prop:s,defaultProp:n??!1,onChange:o,caller:je});return a.jsx(zt,{...i,children:a.jsx(Ir,{scope:t,contentId:re(),triggerRef:f,open:x,onOpenChange:j,onOpenToggle:l.useCallback(()=>j(v=>!v),[j]),hasCustomAnchor:c,onCustomAnchorAdd:l.useCallback(()=>g(!0),[]),onCustomAnchorRemove:l.useCallback(()=>g(!1),[]),modal:d,children:r})})};ct.displayName=je;var dt="PopoverAnchor",ut=l.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,n=ee(dt,r),o=me(r),{onCustomAnchorAdd:d,onCustomAnchorRemove:i}=n;return l.useEffect(()=>(d(),()=>i()),[d,i]),a.jsx(Ue,{...o,...s,ref:t})});ut.displayName=dt;var ft="PopoverTrigger",gt=l.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,n=ee(ft,r),o=me(r),d=Be(t,n.triggerRef),i=a.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":vt(n.open),...s,ref:d,onClick:de(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?i:a.jsx(Ue,{asChild:!0,...o,children:i})});gt.displayName=ft;var Te="PopoverPortal",[Dr,Fr]=it(Te,{forceMount:void 0}),mt=e=>{const{__scopePopover:t,forceMount:r,children:s,container:n}=e,o=ee(Te,t);return a.jsx(Dr,{scope:t,forceMount:r,children:a.jsx(We,{present:r||o.open,children:a.jsx(Lt,{asChild:!0,container:n,children:s})})})};mt.displayName=Te;var le="PopoverContent",pt=l.forwardRef((e,t)=>{const r=Fr(le,e.__scopePopover),{forceMount:s=r.forceMount,...n}=e,o=ee(le,e.__scopePopover);return a.jsx(We,{present:s||o.open,children:o.modal?a.jsx(Vr,{...n,ref:t}):a.jsx(zr,{...n,ref:t})})});pt.displayName=le;var Tr=qt("PopoverContent.RemoveScroll"),Vr=l.forwardRef((e,t)=>{const r=ee(le,e.__scopePopover),s=l.useRef(null),n=Be(t,s),o=l.useRef(!1);return l.useEffect(()=>{const d=s.current;if(d)return $t(d)},[]),a.jsx(Mt,{as:Tr,allowPinchZoom:!0,children:a.jsx(ht,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:de(e.onCloseAutoFocus,d=>{d.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:de(e.onPointerDownOutside,d=>{const i=d.detail.originalEvent,f=i.button===0&&i.ctrlKey===!0,c=i.button===2||f;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:de(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})}),zr=l.forwardRef((e,t)=>{const r=ee(le,e.__scopePopover),s=l.useRef(!1),n=l.useRef(!1);return a.jsx(ht,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(s.current||r.triggerRef.current?.focus(),o.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const d=o.target;r.triggerRef.current?.contains(d)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&n.current&&o.preventDefault()}})}),ht=l.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:n,onCloseAutoFocus:o,disableOutsidePointerEvents:d,onEscapeKeyDown:i,onPointerDownOutside:f,onFocusOutside:c,onInteractOutside:g,...x}=e,j=ee(le,r),v=me(r);return Kt(),a.jsx(Bt,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:n,onUnmountAutoFocus:o,children:a.jsx(Ht,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:g,onEscapeKeyDown:i,onPointerDownOutside:f,onFocusOutside:c,onDismiss:()=>j.onOpenChange(!1),children:a.jsx(Gt,{"data-state":vt(j.open),role:"dialog",id:j.contentId,...v,...x,ref:t,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xt="PopoverClose",_r=l.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,n=ee(xt,r);return a.jsx(Ge.button,{type:"button",...s,ref:t,onClick:de(e.onClick,()=>n.onOpenChange(!1))})});_r.displayName=xt;var Lr="PopoverArrow",$r=l.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,n=me(r);return a.jsx(Ut,{...n,...s,ref:t})});$r.displayName=Lr;function vt(e){return e?"open":"closed"}var Mr=ct,qr=ut,Kr=gt,Br=mt,Hr=pt;const bt=Mr,Gr=qr,Ur=Kr,yt=X.forwardRef(({align:e="center",sideOffset:t=4,className:r,...s},n)=>a.jsx(Br,{children:a.jsx(Hr,{align:e,sideOffset:t,className:p(["data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in","data-[state=closed]:animate-zoom-out data-[state=open]:animate-zoom-in","data-[side=bottom]:animate-slide-in-from-top data-[side=left]:animate-slide-in-from-right","data-[side=right]:animate-slide-in-from-left data-[side=top]:animate-slide-in-from-bottom","w-(--radix-popover-trigger-width) z-50 border p-0 outline-none","border-gray-300 bg-white dark:border-slate-500 dark:bg-slate-600","rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,115,0.25)] dark:shadow-[1px_4px_15.3px_0px_#141921]"],r),ref:n,...s})})),Wr=e=>typeof e=="string"?a.jsx(L,{name:e,size:16,className:p("text-gray-700 dark:text-gray-400")}):e&&a.jsx(e,{className:p("size-4","text-gray-700 dark:text-gray-400")}),qe=({options:e=[],selectedValues:t,multiple:r,selectionIcon:s,selectionIconPosition:n,hasAnyIcon:o,toggleOption:d,tabIndex:i})=>a.jsx(a.Fragment,{children:e.map(f=>{const c=t.includes(f.value);return a.jsxs(ke,{tabIndex:i,value:f.label,onSelect:()=>!f.disabled&&d(f.value),disabled:f.disabled,className:p("cursor-pointer","data-[selected=true]:bg-gray-100 dark:data-[selected=true]:bg-gray-900",f.disabled&&"!pointer-events-auto cursor-not-allowed hover:bg-transparent dark:hover:bg-transparent"),role:"option","aria-selected":c,children:[s==="auto"&&(r?a.jsx("div",{className:p("flex size-4 items-center justify-center rounded-md border","border-gray-700 dark:border-gray-400",c&&"bg-gray-900 text-slate-50 dark:bg-gray-400 dark:text-black"),children:c&&a.jsx(L,{name:"Checkmark",size:16})}):a.jsx("div",{className:p("relative size-4 rounded-full border",c?"border-gray-900 dark:border-gray-400":"border-gray-800 dark:border-gray-400","bg-transparent dark:bg-transparent"),children:c&&a.jsx("div",{className:"absolute left-1/2 top-1/2 size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-gray-900 dark:bg-gray-400"})})),s==="checkmark"&&!(n==="right"&&o)&&a.jsx("div",{className:"size-4",children:n==="left"&&c&&a.jsx(L,{name:"Checkmark",size:16,className:"text-gray-900 dark:text-gray-50"})}),Wr(f.icon),a.jsx("span",{className:p("flex-1 truncate text-[14px] font-normal leading-4","text-gray-700 dark:text-gray-500",f.disabled&&"text-gray-600 dark:text-gray-600"),children:f.label}),s==="checkmark"&&n==="right"&&a.jsx("div",{className:"size-4",children:c&&a.jsx(L,{name:"Checkmark",size:16,className:"text-gray-900 dark:text-gray-50"})})]},`favorite-${f.value}`)})}),Jr=({searchable:e,commandListRef:t,multiple:r,selectedValues:s,selectionIcon:n,selectionIconPosition:o,options:d=[],toggleAll:i,toggleOption:f,favoriteOptions:c=[]})=>{const g=d.filter(v=>!v.disabled),x=d.some(v=>v.icon),j=Y(v=>v.search);return l.useEffect(()=>{t.current?.scrollTo({top:0,behavior:"instant"})},[t,j]),a.jsxs(a.Fragment,{children:[e&&a.jsx(st,{placeholder:"Search...",onKeyDown:v=>{["ArrowUp","ArrowDown","Enter"].includes(v.key)&&g.length>0||v.stopPropagation()},wrapperClassName:"rounded-t",className:"text-gray-900 dark:text-gray-50"}),a.jsxs(De,{ref:t,tabIndex:e?void 0:0,children:[a.jsx(Fe,{className:"p-4 text-center text-[14px] font-normal leading-5 text-gray-700 dark:text-gray-400",children:"No results found."}),r&&j===""&&a.jsx(ve,{className:"pb-0",children:a.jsx(ke,{value:"select-all",onSelect:i,disabled:!1,className:p("cursor-pointer","data-[selected=true]:bg-gray-100 dark:data-[selected=true]:bg-gray-900"),role:"option","aria-selected":s.length===g.length,children:a.jsxs("div",{className:"flex w-full items-center gap-2",children:[n==="auto"&&a.jsx("div",{className:p("flex size-4 items-center justify-center rounded-md border","border-gray-700 dark:border-gray-400",s.length===g.length&&"bg-gray-900 text-slate-50 dark:bg-gray-400 dark:text-black"),children:s.length===g.length&&a.jsx(L,{name:"Checkmark",size:16})}),n==="checkmark"&&!(o==="right"&&x)&&a.jsx("div",{className:"size-4",children:o==="left"&&s.length===g.length&&a.jsx(L,{name:"Checkmark",size:16,className:"text-gray-900 dark:text-gray-50"})}),a.jsx("span",{className:"text-[14px] font-semibold leading-4 text-gray-900 dark:text-gray-50",children:s.length===g.length?"Deselect All":"Select All"}),n==="checkmark"&&o==="right"&&a.jsx("div",{className:"ml-auto size-4",children:s.length===g.length&&a.jsx(L,{name:"Checkmark",size:16,className:"text-gray-900 dark:text-gray-50"})})]})})}),a.jsxs(ve,{className:r&&j===""?"pt-0":void 0,children:[a.jsx(qe,{options:c,selectedValues:s,multiple:r,selectionIcon:n,selectionIconPosition:o,hasAnyIcon:x,toggleOption:f,tabIndex:e?void 0:0}),c.length>0&&a.jsx("div",{className:"my-1 border-b border-gray-300 dark:border-gray-600"}),a.jsx(qe,{options:d,selectedValues:s,multiple:r,selectionIcon:n,selectionIconPosition:o,hasAnyIcon:x,toggleOption:f,tabIndex:e?void 0:0})]})]})]})},Xr=({selectedValues:e,options:t=[],multiple:r,searchable:s,placeholder:n,handleClear:o})=>{const d=i=>typeof i=="string"?a.jsx(L,{name:i,size:16}):i&&a.jsx(i,{className:"size-4"});return e.length===0?a.jsxs("div",{className:p("mx-auto flex w-full items-center",n?"justify-between":"justify-end"),children:[n&&a.jsx("span",{className:"text-[14px] font-normal leading-5 text-gray-600 dark:text-gray-500",children:n}),s?a.jsx(L,{name:"CaretSort",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"}):a.jsx(L,{name:"ChevronDown",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"})]}):a.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[a.jsx("div",{className:p("max-w-full truncate text-gray-900 dark:text-gray-50",!r&&"flex items-center gap-2"),children:e.map((i,f)=>{const c=t.find(g=>g.value===i);return r?a.jsx("span",{className:p("text-[14px] font-normal leading-5",f!==e.length-1&&"mr-1"),children:f!==e.length-1?`${c?.label},`:c?.label},i):a.jsxs(X.Fragment,{children:[d(c?.icon),a.jsx("span",{className:"truncate text-[14px] font-normal leading-5",children:c?.label})]},i)})}),a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r&&e.length>0&&a.jsx("div",{onClick:i=>{i.preventDefault(),i.stopPropagation(),o()},className:"size-4 p-0",children:a.jsx(L,{name:"XmarkLight",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"})}),s?a.jsx(L,{name:"CaretSort",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"}):a.jsx(L,{name:"ChevronDown",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"})]})]})};function Qr({options:e=[],multiple:t=!1,defaultValue:r,value:s,onChange:n}){const o=l.useRef(!1),d=l.useRef(null),[i,f]=l.useState(!1),[c,g]=l.useState(()=>{const b=s??r??[];return b===""?[]:Array.isArray(b)?b:[b]});l.useEffect(()=>{if(o.current){o.current=!1;return}const b=s??r??[];g(b===""?[]:Array.isArray(b)?b:[b])},[s]);const x=l.useCallback(b=>{f(b)},[]),j=l.useCallback(b=>{o.current=!0;let A;t?A=c.includes(b)?c.filter(S=>S!==b):[...c,b]:(A=c[0]===b?[]:[b],f(!1)),g(A),n?.(t?A:A[0]??"")},[t,c,e,n]),v=l.useCallback(()=>{o.current=!0,g([]),n?.(t?[]:"")},[t,n]),R=l.useCallback(()=>{o.current=!0;const b=e.filter(S=>!S.disabled).map(S=>S.value),A=c.length===b.length?[]:b;g(A),n?.(t?A:A[0])},[e,c,t,n]),O=l.useRef(t);return l.useEffect(()=>{if(O.current!==t){if(O.current=t,!t&&c.length>1){o.current=!0,g([c[0]]),n?.(c[0]);return}c.length>0&&(o.current=!0,n?.(t?[c[0]]:c[0]))}},[t]),{selectedValues:c,isPopoverOpen:i,commandListRef:d,toggleOption:j,handleClear:v,toggleAll:R,handleOpenChange:x}}const Yr=X.forwardRef(({options:e=[],favoriteOptions:t=[],defaultValue:r,value:s,onChange:n,onBlur:o,id:d,name:i,label:f,required:c,disabled:g,errors:x=[],warnings:j=[],multiple:v,selectionIcon:R="auto",selectionIconPosition:O="left",searchable:b,description:A,placeholder:S,className:H,contentClassName:q,contentAlign:T="start",...w},E)=>{const V=l.useId(),z=d??`${V}-select`,{selectedValues:P,isPopoverOpen:$,commandListRef:G,toggleOption:k,handleClear:I,toggleAll:M,handleOpenChange:U}=Qr({options:e,multiple:v,defaultValue:r,value:s,onChange:n}),Q=l.useCallback(_=>{$||o?.(_)},[o,$]);return a.jsxs(lt,{children:[f&&a.jsx(Je,{htmlFor:z,required:c,disabled:g,hasError:x.length>0,inline:!1,onClick:_=>{_.preventDefault(),_.target.control?.focus()},children:f}),a.jsxs(bt,{open:$,onOpenChange:_=>{U(_),!_&&document.activeElement?.id!==z&&o?.({target:{}})},children:[a.jsx(Ur,{asChild:!0,children:a.jsx(ar,{id:z,name:i,type:"button",role:"combobox",onBlur:Q,disabled:g,"aria-invalid":x.length>0,"aria-label":f?void 0:v?"Multi select":"Select","aria-required":c,"aria-expanded":$,className:p("flex h-9 w-full items-center justify-between px-3 py-2","dark:border-charcoal-700 dark:bg-charcoal-900 rounded-md border border-gray-300 bg-white","hover:border-gray-300 hover:bg-gray-100","dark:hover:border-charcoal-700 dark:hover:bg-charcoal-800","dark:focus:ring-charcoal-300 focus:outline-none focus:ring-1 focus:ring-gray-900 focus:ring-offset-0","dark:focus-visible:ring-charcoal-300 focus-visible:ring-1 focus-visible:ring-gray-900 focus-visible:ring-offset-0",g&&["!pointer-events-auto cursor-not-allowed bg-gray-50","dark:hover:border-charcoal-700 dark:hover:bg-charcoal-900 hover:border-gray-300 hover:bg-gray-50"],H),...w,ref:E,children:a.jsx(Xr,{selectedValues:P,options:[...t,...e],multiple:v,searchable:b,placeholder:S,handleClear:I})})}),a.jsx(yt,{align:T,onEscapeKeyDown:_=>{_.preventDefault(),U(!1)},className:q,children:a.jsx(nt,{defaultValue:!v&&P[0]?e.find(_=>_.value===P[0])?.label:void 0,children:a.jsx(Jr,{favoriteOptions:t,searchable:b,commandListRef:G,multiple:v,selectedValues:P,selectionIcon:R,selectionIconPosition:O,options:e,toggleAll:M,toggleOption:k})})})]}),A&&a.jsx(ot,{children:A}),j.length>0&&a.jsx(xe,{messages:j,type:"warning"}),x.length>0&&a.jsx(xe,{messages:x,type:"error"})]})}),Zr=Or(Yr);Zr.displayName="SelectField";function kt(...e){return er(Ot(e))}const ea=kt("flex h-9 w-full rounded-md text-sm font-normal leading-5 text-gray-900 dark:text-gray-50","dark:border-charcoal-700 dark:bg-charcoal-900 border border-gray-300 bg-white","px-3 py-2","font-sans placeholder:text-gray-500 dark:placeholder:text-gray-600","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-900 focus-visible:ring-offset-0 focus-visible:ring-offset-white","dark:focus-visible:ring-charcoal-300 dark:focus-visible:ring-offset-charcoal-900 dark:focus:bg-charcoal-900 focus:bg-gray-50","disabled:cursor-not-allowed","disabled:border-gray-300 disabled:bg-gray-50 disabled:text-gray-700","disabled:dark:border-charcoal-800 disabled:dark:bg-charcoal-900 disabled:dark:text-gray-300"),Ve=l.forwardRef(({className:e,type:t,...r},s)=>a.jsx("input",{type:t,className:kt(ea,e),ref:s,...r}));Ve.displayName="Input";function Re(e,t){const r=Object.getOwnPropertyDescriptor(e,"value")?.set,s=Object.getPrototypeOf(e),n=Object.getOwnPropertyDescriptor(s,"value")?.set;r&&r!==n?n?.call(e,t):r?.call(e,t)}function he(e,t,r="blur"){return e.reduce((s,n)=>typeof n=="function"?r==="blur"||r==="all"?n(s):s:(n.options?.trigger??"blur")!==r&&r!=="all"?s:n.options?.if===void 0||n.options.if?n.transformer(s):s,t)}function jt({transformers:e,children:t}){const s=Ke()?.setValue;return l.useEffect(()=>{const n=t.props.value,o=he(e,n,"all");ue(o,n)||(typeof s=="function"?s(t.props.name,o):t.props.onChange?.({target:{value:o}}))},[e,s]),X.cloneElement(t,{...t.props,onChange:n=>{const o=he(e,n.target.value,"change");o!==n.target.value&&s&&(s(t.props.name,o),Re(n.target,o)),t.props.onChange?.(n)},onBlur:n=>{t.props.onBlur?.(n);const o=n.target,d=he(e,o.value,"blur");if(!ue(d,o.value)){Re(o,d);const i=new Event("change",{bubbles:!0});o.dispatchEvent(i)}},onKeyDown:n=>{if(t.props.onKeyDown?.(n),n.key==="Enter"){const o=n.target,d=he(e,o.value,"keyDown");if(!ue(d,o.value)){Re(o,d);const i=new Event("change",{bubbles:!0});o.dispatchEvent(i)}}}})}const ta=X.forwardRef(({id:e,name:t,value:r,className:s,isLoading:n,haveFetchError:o,disabled:d,onChange:i,onBlur:f,onClick:c,selectedOption:g,optionsLength:x,handleOpenChange:j,onKeyDown:v,onMouseDown:R,placeholder:O,hasError:b,label:A,required:S,isPopoverOpen:H,maxLength:q,handlePaste:T,onPaste:w,...E},V)=>{const[z,P]=l.useState(!1),$=Yt("(hover: hover) and (pointer: fine)"),G=l.useMemo(()=>[be.trimOnBlur(),be.trimOnEnter()],[]);return a.jsxs("div",{className:p("group relative"),children:[a.jsx(jt,{transformers:G,children:a.jsx(B.Input,{asChild:!0,children:a.jsx(Ve,{id:e,name:t,value:r,className:p("pr-9",s),disabled:d,onChange:i,onBlur:f,onClick:k=>{const I=k.target;!(n||o)&&!g&&I.value!==""&&j?.(!0),c?.(k)},onKeyDown:k=>{v?.(k);const I=["ArrowUp","ArrowDown","Enter"].includes(k.key);if(k.key==="Enter"&&H&&x===0){j?.(!1),k.preventDefault();return}I&&H&&x>0||k.stopPropagation()},onMouseDown:k=>{const I=k.target;I.contains(document.activeElement)||requestAnimationFrame(()=>{I.select()}),R?.(k)},onPaste:k=>{T?.(k),w?.(k)},placeholder:O,"aria-invalid":b,"aria-label":A?void 0:"Id Autocomplete","aria-required":S,"aria-expanded":H,maxLength:q,...E,ref:V})})}),a.jsxs("div",{className:p("absolute right-3 top-1/2 flex size-4 -translate-y-1/2 items-center",!n&&!o&&!g&&"pointer-events-none"),children:[n&&a.jsx(L,{name:"Reload",size:16,className:p("animate-spin text-gray-500 dark:text-gray-600")}),o&&a.jsx(Ee,{children:a.jsx(Ae,{content:"Network error!",children:a.jsx(L,{name:"Error",size:16,className:p("text-red-900")})})}),g&&!n&&!o&&a.jsx(Ee,{children:a.jsx(Ae,{content:"Copied!",open:z,triggerAsChild:!0,children:a.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(g.value).then(()=>{P(!0),setTimeout(()=>P(!1),2e3)}).catch(k=>{console.error("Failed to copy value: ",k)})},className:p("focus-visible:outline-none [&_svg]:pointer-events-none",$&&"opacity-0 transition-opacity duration-500 group-hover:opacity-100"),children:a.jsx(L,{name:"Copy",size:16,className:p("text-gray-500 dark:text-gray-600")})})})})]})]})}),ra=({customIcon:e,asPlaceholder:t})=>typeof e=="string"?a.jsx(L,{name:e,size:24,className:p("shrink-0",t?"text-gray-400 dark:text-gray-700":"text-gray-900 dark:text-gray-300")}):X.isValidElement(e)?a.jsx("div",{className:"size-6 shrink-0 overflow-hidden",children:e}):null,aa=({isLoadingSelectedOption:e,handleFetchSelectedOption:t,isFetchSelectedOptionSync:r,value:s})=>a.jsx("div",{children:a.jsx("button",{type:"button",disabled:e||r,onClick:()=>{!e&&!r&&t(s)},className:p("mt-0.5 focus-visible:outline-none","disabled:pointer-events-none [&_svg]:pointer-events-none"),"aria-label":e?"Loading":r?"Success":"Reload",children:a.jsx(L,{name:r?"Checkmark":"Reload",size:16,className:p("text-gray-500 dark:text-gray-600",e&&"animate-spin",r&&"animate-in fade-in duration-500")})})}),Oe=({variant:e="withValue",icon:t,title:r="Title not available",path:s="Path not available",value:n,description:o="Description not available",asPlaceholder:d,showValue:i=!0,isLoadingSelectedOption:f,handleFetchSelectedOption:c,isFetchSelectedOptionSync:g,className:x,placeholderIcon:j="PowerhouseLogoSmall",...v})=>{const R=()=>a.jsx("div",{className:p("flex w-full items-center"),children:a.jsx("span",{className:p("truncate text-xs leading-5",d?"text-gray-400 dark:text-gray-700":"text-gray-500 dark:text-gray-600"),children:n})}),O=(b=!0)=>a.jsxs("div",{className:p("flex w-full flex-col gap-1"),children:[a.jsxs("div",{className:p("flex gap-2"),children:[a.jsx(ra,{customIcon:d?j:t,asPlaceholder:d}),a.jsxs("div",{className:p("flex min-w-0 grow flex-col gap-[-2px]"),children:[a.jsx("span",{className:p("truncate text-sm font-bold leading-5",d?"text-gray-400 dark:text-gray-700":"text-gray-900 dark:text-gray-300"),children:r}),!i&&typeof s=="object"?a.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:p("truncate text-xs leading-5 text-blue-900 hover:underline focus-visible:outline-none"),children:s.text}):a.jsx("span",{className:p("truncate text-xs leading-5",d?"text-gray-400 dark:text-gray-700":"text-gray-500 dark:text-gray-600"),children:typeof s=="object"?s.text:s})]}),d===!1&&c&&a.jsx(aa,{isLoadingSelectedOption:f,handleFetchSelectedOption:c,isFetchSelectedOptionSync:g,value:n})]}),i&&a.jsx("div",{className:p("flex max-w-full items-center"),children:a.jsx("span",{className:p("truncate text-xs leading-5",d?"text-gray-400 dark:text-gray-700":"text-gray-500 dark:text-gray-600"),children:n})}),b&&a.jsx("div",{className:p("flex flex-col"),children:a.jsx("p",{className:p("line-clamp-2 text-xs leading-5",d?"text-gray-400 dark:text-gray-700":"text-gray-900 dark:text-gray-300"),children:o})}),b&&"agentType"in v&&typeof v.agentType=="string"&&a.jsx("div",{className:p("flex max-w-full items-center justify-end"),children:a.jsx("span",{className:p("truncate text-xs leading-5",d?"text-gray-400 dark:text-gray-700":"text-gray-500 dark:text-gray-600"),children:v.agentType})})]});return a.jsxs("div",{className:p("w-full max-w-full rounded-md bg-transparent px-3 pb-2",e==="withValue"?"pt-2":"pt-3",x),children:[e==="withValue"&&R(),e==="withValueAndTitle"&&O(!1),e==="withValueTitleAndDescription"&&O()]})},na=({variant:e,commandListRef:t,selectedValue:r,options:s=[],toggleOption:n,renderOption:o,previewPlaceholder:d})=>{const i=Y(c=>c.search),f=d||{value:"value not available",title:"Title not available",path:"Path not available",description:"Description not available"};return l.useEffect(()=>{t?.current?.scrollTo({top:0,behavior:"instant"})},[t,i]),a.jsxs(De,{ref:t,children:[a.jsx(Fe,{className:p("h-full p-1"),children:o?o(f,{asPlaceholder:!0,showValue:!0,className:p("pb-0")}):a.jsx(Oe,{variant:e,icon:f.icon,title:f.title,path:f.path,value:f.value,description:f.description,asPlaceholder:!0,className:p("pb-0")})}),a.jsx(ve,{className:p("px-1"),children:s.map(c=>{const g=r===c.value;return a.jsx(ke,{value:c.value,onSelect:()=>n?.(c.value),className:p("h-full cursor-pointer border-y-0 p-0","data-[selected=true]:bg-gray-100 dark:data-[selected=true]:bg-gray-900"),role:"option","aria-selected":g,children:o?o(c,{asPlaceholder:!1,showValue:!0}):a.jsx(Oe,{variant:e,...c})},c.value)})})]})},sa=l.createContext({}),oa=()=>l.useContext(sa);function la({autoComplete:e,defaultValue:t,value:r,isOpenByDefault:s,initialOptions:n,onChange:o,onBlur:d,fetchOptions:i,fetchSelectedOption:f}){const c=oa(),g=l.useRef(!1),x=l.useRef(!1),j=l.useRef(null),[v,R]=l.useState(s??!1),[O,b]=l.useState(n??[]),[A,S]=l.useState(!1),[H,q]=l.useState(!1),[T,w]=l.useState(!1),[E,V]=l.useState(r??t??""),[z,P]=l.useState(void 0),[$,G]=l.useState(""),[k,I]=l.useState(!1),M=l.useCallback(()=>{w(!1),S(!1),q(!1),R(!1)},[]),U=Zt(l.useCallback(h=>{if(!(!e||!i)){if(h===""){M(),b([]),V(""),P(void 0);return}w(!1),S(!0);try{const m=i(h,c);Promise.resolve(m).then(C=>{b(C);const N=C.find(D=>D.value===h);N?(P(N),R(!1)):(P(void 0),R(!0)),S(!1)}).catch(()=>{w(!0),S(!1)})}catch{w(!0),S(!1)}}},[M,e,i,c])),Q=l.useCallback(h=>{if(!(!e||!f)){q(!0);try{const m=f(h),C=m instanceof Promise;Promise.resolve(m).then(N=>{N?(P(N),b(D=>{const F=D.findIndex(W=>W.value===h);if(F!==-1){const W=[...D];return W[F]=N,W}return D})):(M(),b([]),V(""),P(void 0)),q(!1),C||(I(!0),setTimeout(()=>{I(!1)},1500))}).catch(()=>{q(!1)})}catch{q(!1)}}},[M,e,f]),_=l.useCallback(h=>{h||G(O[0]?.value??""),R(h)},[O]),K=l.useCallback(h=>{g.current=!1,x.current=!0,V(h),P(O.find(m=>m.value===h)),M(),o?.(h)},[o,M,O]),te=l.useCallback(h=>{const m=h.target.value;g.current=!0,V(m),P(void 0),o?.(m)},[o]),ne=l.useCallback(h=>{G(h)},[]),u=l.useCallback(h=>{v||d?.(h)},[d,v]),y=l.useCallback(h=>{const m=h.clipboardData.getData("text"),C=m.trim();if(m!==C){h.preventDefault();const N=h.currentTarget,D=N.selectionStart||0,F=N.selectionEnd||0,W=N.value,ie=W.substring(0,D)+C+W.substring(F);o?.(ie),requestAnimationFrame(()=>{const pe=D+C.length;N.setSelectionRange(pe,pe),U(ie)})}else m===E&&U(E)},[E,U,o]);return l.useEffect(()=>{e?g.current&&U(E):(M(),b([]),V(""),P(void 0))},[e,E,U,M]),l.useEffect(()=>{x.current||(g.current=!1,V(r??t??""),P(void 0)),x.current=!1},[r]),l.useEffect(()=>{if(n?.length&&E){const h=n.find(m=>m.value===E);h&&P(h)}},[]),{selectedValue:E,selectedOption:z,isPopoverOpen:v,commandListRef:j,options:O,isLoading:A,isLoadingSelectedOption:H,haveFetchError:T,commandValue:$,isFetchSelectedOptionSync:k,toggleOption:K,handleOpenChange:_,onTriggerBlur:u,handleChange:te,handleCommandValue:ne,handleFetchSelectedOption:Q,handlePaste:y}}const ia=X.forwardRef(({id:e,name:t,className:r,label:s,description:n,value:o,defaultValue:d,disabled:i,placeholder:f,required:c,errors:g,warnings:x,onChange:j,onBlur:v,onClick:R,onKeyDown:O,onMouseDown:b,autoComplete:A=!0,variant:S="withValue",maxLength:H,fetchOptionsCallback:q,fetchSelectedOptionCallback:T,isOpenByDefault:w,initialOptions:E,renderOption:V,previewPlaceholder:z,...P},$)=>{const G=l.useId(),k=e??`${G}-id-autocomplete`,I=l.useRef(null),M=J=>{I.current=J,typeof $=="function"?$(J):$&&($.current=J)},U=Array.isArray(x)&&x.length>0,Q=Array.isArray(g)&&g.length>0,{selectedValue:_,selectedOption:K,isPopoverOpen:te,commandListRef:ne,options:u,isLoading:y,isLoadingSelectedOption:h,haveFetchError:m,commandValue:C,isFetchSelectedOptionSync:N,toggleOption:D,handleOpenChange:F,onTriggerBlur:W,handleChange:ie,handleCommandValue:pe,handleFetchSelectedOption:ze,handlePaste:wt}=la({autoComplete:A,defaultValue:d,value:o,isOpenByDefault:w,initialOptions:E,onChange:j,onBlur:v,fetchOptions:q,fetchSelectedOption:T}),Ct=J=>{D(J),I.current?.focus()},Nt=S==="withValueAndTitle"||S==="withValueTitleAndDescription",Rt=l.useMemo(()=>[be.trimOnBlur(),be.trimOnEnter()],[]);return a.jsxs(lt,{children:[!!s&&a.jsx(Je,{htmlFor:k,disabled:i,hasError:Q,required:c,onClick:J=>{J.preventDefault(),J.target.control?.focus()},children:s}),A&&q?a.jsx(bt,{open:te,onOpenChange:F,children:a.jsxs(B,{shouldFilter:!1,value:C,onValueChange:pe,className:p("dark:bg-charcoal-900 bg-gray-100"),children:[a.jsx(Gr,{asChild:!0,children:a.jsx(ta,{id:k,name:t,value:_,className:r,isLoading:y,haveFetchError:m,disabled:i,onChange:ie,onBlur:W,onClick:R,selectedOption:K,optionsLength:u.length,handleOpenChange:F,onKeyDown:O,onMouseDown:b,placeholder:f,hasError:Q,label:s,required:c,isPopoverOpen:te,maxLength:H,handlePaste:wt,...P,ref:M})}),Nt&&(V?V(K===void 0&&z?{...z}:{...K,value:K?.value??""},{asPlaceholder:K===void 0,showValue:!1,isLoadingSelectedOption:h,handleFetchSelectedOption:T?ze:void 0,isFetchSelectedOptionSync:N,className:p("rounded-t-none pt-2")}):a.jsx(Oe,{variant:S,icon:K?.icon??z?.icon,title:K?.title??z?.title,path:K?.path??z?.path,value:K?.value??z?.value??"",description:K?.description??z?.description,asPlaceholder:K===void 0,showValue:!1,isLoadingSelectedOption:h,handleFetchSelectedOption:T?ze:void 0,isFetchSelectedOptionSync:N,className:p("rounded-t-none pt-2")})),a.jsx(yt,{align:"start",onOpenAutoFocus:J=>J.preventDefault(),onInteractOutside:J=>{J.target instanceof Element&&J.target.id===k&&J.preventDefault()},children:a.jsx(na,{variant:S,commandListRef:ne,selectedValue:_,options:u,toggleOption:Ct,renderOption:V,previewPlaceholder:z})})]})}):a.jsx(jt,{transformers:Rt,children:a.jsx(Ve,{id:k,name:t,value:_,className:r,disabled:i,onChange:ie,onBlur:v,onClick:R,onMouseDown:b,placeholder:f,"aria-invalid":Q,"aria-label":s?void 0:"Id Autocomplete","aria-required":c,maxLength:H,...P,ref:M})}),!!n&&a.jsx(ot,{children:n}),U&&a.jsx(xe,{messages:x,type:"warning"}),Q&&a.jsx(xe,{messages:g,type:"error"})]})});ia.displayName="IdAutocomplete";export{Ve as I,bt as P,Yr as S,Ur as a,yt as b,ia as c,xa as d};
|