@llmops/app 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +337 -298
- package/dist/assets/{Form-B1rZ0Hvr.js → Form-Bh6BPtQ_.js} +1 -1
- package/dist/assets/{InternalBackdrop-CXjGP6a9.js → InternalBackdrop-Za9lpJi7.js} +1 -1
- package/dist/assets/_environment-COxSWJ9w.js +1 -0
- package/dist/assets/_observability-C8wSXZk2.js +1 -0
- package/dist/assets/{_observability-DPSeR4-h.css → _observability-CBX-o26D.css} +1 -1
- package/dist/assets/{_settings-Bv8acMq8.js → _settings-DOmj1R7I.js} +1 -1
- package/dist/assets/{_tabs-Bi-rsAVV.js → _tabs-D9USU0yw.js} +1 -1
- package/dist/assets/{_tabs-oKfgxR5m.js → _tabs-DaucGqpx.js} +1 -1
- package/dist/assets/{_variant-Zg5HjNSN.js → _variant-DxME2BL0.js} +2 -2
- package/dist/assets/{_variants-B36Lo8m_.js → _variants-Bjp8ZEvO.js} +1 -1
- package/dist/assets/{area.css-DTnbbu5M.js → area.css-CSjofvHM.js} +1 -1
- package/dist/assets/{button-DftzA6-1.js → button-CMZqhyXB.js} +1 -1
- package/dist/assets/check-D9E8RKB4.js +1 -0
- package/dist/assets/{chevron-down-BjDiaa62.js → chevron-down-BJFxhYkh.js} +1 -1
- package/dist/assets/{chevron-right-Dz77YeP_.js → chevron-right-fMWRsRLZ.js} +1 -1
- package/dist/assets/combobox-iSbUYz0A.js +1 -0
- package/dist/assets/configs-BflhBVlY.js +1 -0
- package/dist/assets/{copy-D-DZB-6Z.js → copy-DADLeZ69.js} +1 -1
- package/dist/assets/costs-Fh0OPnEw.js +1 -0
- package/dist/assets/environments-ChldQPyq.js +1 -0
- package/dist/assets/{getDisabledMountTransitionStyles-CKUvhO4q.js → getDisabledMountTransitionStyles-TZFYxPIU.js} +1 -1
- package/dist/assets/{index-BS3B2BG5.js → index-BDsrc1Q7.js} +1 -1
- package/dist/assets/{index-BiCR_Kj2.css → index-BFe2NM3q.css} +1 -1
- package/dist/assets/{index-D841new6.js → index-BWU02PnY.js} +1 -1
- package/dist/assets/{index-xdhK5tU9.js → index-Cns5MLjo.js} +1 -1
- package/dist/assets/{index-CnOYeKc1.js → index-DW-cTzEh.js} +1 -1
- package/dist/assets/{index-CpAxLUl2.js → index-DYoud8po.js} +1 -1
- package/dist/assets/{index-DvzXLQL6.js → index-DeuSY0Yv.js} +1 -1
- package/dist/assets/{index-BCY9aD4r.js → index-FrTQ7TcS.js} +3 -3
- package/dist/assets/index.esm-oCSEvUVx.js +1 -0
- package/dist/assets/info-box.css-DuVI9M9-.js +1 -0
- package/dist/assets/{llmops-C5uyvq6E.js → llmops-CdOQq40D.js} +1 -1
- package/dist/assets/{observability-C5jdcUSg.css → observability-DEEfw22p.css} +1 -1
- package/dist/assets/observability.css-wgjHtY3p.js +1 -0
- package/dist/assets/overview-D1QIYPBL.js +33 -0
- package/dist/assets/{plus-C_L0BpbU.js → plus-JQ0TORpd.js} +1 -1
- package/dist/assets/{popover-CSR0ctop.js → popover-DXj4s-ni.js} +1 -1
- package/dist/assets/popupStateMapping-DolkyTT3.js +1 -0
- package/dist/assets/requests-CzvYwfwV.js +1 -0
- package/dist/assets/reselect-DVmmTZGf.js +1 -0
- package/dist/assets/{route-vfMzB8KR.js → route-CjAw8hSU.js} +1 -1
- package/dist/assets/{route-CI77gokb.js → route-Df57lqxl.js} +1 -1
- package/dist/assets/{route-wrnLt3bn.js → route-DmWZbVk6.js} +1 -1
- package/dist/assets/{route-CZ2yCnzN.js → route-timDYxX2.js} +1 -1
- package/dist/assets/{secrets-B9u5jvFm.js → secrets-BxFGEuKj.js} +1 -1
- package/dist/assets/settings-DpSRw7LL.js +1 -0
- package/dist/assets/settings-pgWZnVf6.js +1 -0
- package/dist/assets/{table-xLf4iXV8.js → table-DggTSlPh.js} +1 -1
- package/dist/assets/{tabs.css-fttLH8Xj.js → tabs.css-CG5ugi0p.js} +1 -1
- package/dist/assets/{targeting-DZIwwaYV.js → targeting-CkqRTjnZ.js} +1 -1
- package/dist/assets/{tooltip-BKoDpdAC.js → tooltip-BuSsMQ8P.js} +1 -1
- package/dist/assets/{update-or-create-name-ChWLK2jI.js → update-or-create-name-B-M46wHl.js} +1 -1
- package/dist/assets/useAnalytics-DTf81POS.js +1 -0
- package/dist/assets/useButton-CsZ8hBM8.js +1 -0
- package/dist/assets/{useConfigList-Du__Gu7q.js → useConfigList-CAf01_dV.js} +1 -1
- package/dist/assets/{useConfigVariants-C8frrCcZ.js → useConfigVariants-CLc_hPw1.js} +1 -1
- package/dist/assets/{useEnvironments-CYkrqAdO.js → useEnvironments-Bu_0SIUj.js} +1 -1
- package/dist/assets/{useFocus-Du1aH2j1.js → useFocus-9TCY0h5x.js} +1 -1
- package/dist/assets/{useMutation-VUB-GXkv.js → useMutation-D4JglXWk.js} +1 -1
- package/dist/assets/{usePopupAutoResize-ddPHogUJ.js → usePopupAutoResize-D6RSlB-m.js} +1 -1
- package/dist/assets/{useRole-DP91D1OX.js → useRole-CiSaVva3.js} +1 -1
- package/dist/assets/useSetTargeting-bk0Ixhqq.js +1 -0
- package/dist/assets/{useSyncedFloatingRootContext-BzuhbdSw.js → useSyncedFloatingRootContext-BKbVh8Gq.js} +1 -1
- package/dist/assets/{useTargetingRules-DS57orU0.js → useTargetingRules-BrgaEdxR.js} +1 -1
- package/dist/assets/{useValueChanged-vz8uKgCk.js → useValueChanged-CTjBqaGs.js} +1 -1
- package/dist/assets/{user-profile-Bt3_D9Gr.js → user-profile-BB3dPOc5.js} +1 -1
- package/dist/assets/{variants-CYXSNKzX.js → variants-BH682hHM.js} +1 -1
- package/dist/assets/variants.css-rCWHZycz.js +1 -0
- package/dist/assets/{workspace-general-BRMpUqb-.js → workspace-general-DYXfOF9H.js} +1 -1
- package/dist/index.cjs +82 -14
- package/dist/index.mjs +82 -14
- package/package.json +4 -3
- package/dist/assets/_environment-zVjmOhBI.js +0 -1
- package/dist/assets/_observability-CQ4Ll_WT.js +0 -1
- package/dist/assets/check-PaWYhFn6.js +0 -1
- package/dist/assets/configs-CtNuMmVR.js +0 -1
- package/dist/assets/costs-DwVSRTwW.js +0 -1
- package/dist/assets/environments-BB95BiC0.js +0 -1
- package/dist/assets/index.esm-COTq2pHX.js +0 -1
- package/dist/assets/info-box.css-HIaMvhbC.js +0 -1
- package/dist/assets/observability.css-dztiak5K.js +0 -1
- package/dist/assets/overview-BwCF8A1G.js +0 -1
- package/dist/assets/popupStateMapping-DkOpwBhG.js +0 -1
- package/dist/assets/requests-D8wE_E2M.js +0 -1
- package/dist/assets/settings-24qWHZEq.js +0 -1
- package/dist/assets/settings-BLt538aO.js +0 -1
- package/dist/assets/useButton-Ct8hIyjz.js +0 -1
- package/dist/assets/useSetTargeting-D1rPM8vz.js +0 -1
- package/dist/assets/variants.css-BjGKD3Nv.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as J,a as D,j as s,r as w,d as B,f as L,g as z,m as Y,i as G,n as Z,I as H,b as ee,u as te,e as P,L as se,O as ae}from"./index-BCY9aD4r.js";import{U as ie,X as oe,u as ne,l as le,r as re,t as ce}from"./update-or-create-name-ChWLK2jI.js";import{w as q,b as de,C as me,c as A,B as fe,h as O,H as ue,a as ge,g as pe}from"./area.css-DTnbbu5M.js";import{c as he,u as Ce,g as xe,a as je,b as ye,d as be,f as Q}from"./index-DvzXLQL6.js";import{T as ve,a as Se,b as U,c as we,d as Ne,e as Te}from"./table-xLf4iXV8.js";import{u as Re,q as W}from"./useConfigList-Du__Gu7q.js";import{f as _e}from"./formatDistance-Bok3-MB1.js";import{B as E}from"./button-DftzA6-1.js";import{c as De,a as $e,b as ke,d as Me,h as K}from"./index.esm-COTq2pHX.js";import{u as X}from"./useMutation-VUB-GXkv.js";import{C as Fe}from"./check-PaWYhFn6.js";import{C as He}from"./copy-D-DZB-6Z.js";import{C as Be}from"./chevron-right-Dz77YeP_.js";import{P as Ie}from"./plus-C_L0BpbU.js";/* empty css */import"./tooltip-BKoDpdAC.js";import"./useButton-Ct8hIyjz.js";import"./popupStateMapping-DkOpwBhG.js";import"./usePopupAutoResize-ddPHogUJ.js";import"./getDisabledMountTransitionStyles-CKUvhO4q.js";import"./useSyncedFloatingRootContext-BzuhbdSw.js";import"./useFocus-Du1aH2j1.js";import"./en-US-C8ut0f5H.js";/* empty css */const Ee=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Le=J("arrow-left",Ee);var ze="_1xwfgwi0",Pe="_1xwfgwi1",qe="_1xwfgwi2";const Ae=()=>{const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("div",{className:ze,children:s.jsx("div",{className:Pe,children:s.jsx("h2",{className:qe,children:"No configs yet. Create your first config to get started."})})}),e[0]=t):t=e[0],t},V=he();function Oe(){const[e,t]=w.useState([]),[a,o]=w.useState([]),[i,c]=w.useState(""),u=B(),{id:r}=L({strict:!1}),{data:p}=Re(),h=z(),C=w.useCallback(n=>{h.prefetchQuery(Y(n))},[h]),b=w.useMemo(()=>[V.accessor("name",{header:"Name",cell:n=>n.getValue()}),V.accessor("createdAt",{header:"Creation Date",cell:n=>_e(new Date(n.getValue()),new Date,{addSuffix:!0})})],[]),g=Ce({data:p||[],columns:b,state:{sorting:e,columnFilters:a,globalFilter:i},onSortingChange:t,onColumnFiltersChange:o,onGlobalFilterChange:c,getCoreRowModel:be(),getFilteredRowModel:ye(),getSortedRowModel:je(),getPaginationRowModel:xe(),initialState:{pagination:{pageSize:100}}});return!p||p.length===0?s.jsx(Ae,{}):s.jsx("div",{children:s.jsxs(ve,{children:[s.jsx(Se,{children:g.getHeaderGroups().map(n=>s.jsx(U,{children:n.headers.map(l=>{const d=l.column.getIsSorted();return s.jsx(we,{sortable:l.column.getCanSort(),onClick:l.column.getToggleSortingHandler(),sortDirection:d==="asc"?"asc":d==="desc"?"desc":null,children:l.isPlaceholder?null:Q(l.column.columnDef.header,l.getContext())},l.id)})},n.id))}),s.jsx(Ne,{children:g.getRowModel().rows.map(n=>s.jsx(U,{interactive:!0,selected:n.original.id===r,onMouseEnter:()=>C(n.original.id),onClick:()=>u({to:"/configs/$id",params:{id:n.original.id}}),children:n.getVisibleCells().map(l=>s.jsx(Te,{children:Q(l.column.columnDef.cell,l.getContext())},l.id))},n.id))})]})})}const Qe=()=>{const e=D.c(3),t=B(),a=z();let o;return e[0]!==t||e[1]!==a?(o={mutationFn:Ue,onSuccess:async i=>{await a.invalidateQueries({queryKey:W}),i?.id&&t({to:"/configs/$id",params:{id:i?.id}})}},e[0]=t,e[1]=a,e[2]=o):o=e[2],X(o)};async function Ue(e){const a=await(await G.v1.configs.$post({json:{name:e.name}})).json();return"data"in a?a.data:void 0}const Ve=()=>{const e=D.c(2),t=z();let a;return e[0]!==t?(a={mutationFn:Ge,onSuccess:()=>{t.invalidateQueries({queryKey:W})}},e[0]=t,e[1]=a):a=e[1],X(a)};async function Ge(e){const a=await(await G.v1.configs[":id"].$patch({param:{id:e.id},json:{name:e.name}})).json();return"data"in a?a.data:void 0}const We=e=>{const t=D.c(6),{id:a,config:o,disabled:i}=e,{mutateAsync:c}=Qe(),{mutateAsync:u}=Ve();let r;return t[0]!==o||t[1]!==c||t[2]!==i||t[3]!==a||t[4]!==u?(r=s.jsx(ie,{id:a,entity:o,placeholder:"Config Name",onCreate:c,onUpdate:u,disabled:i}),t[0]=o,t[1]=c,t[2]=i,t[3]=a,t[4]=u,t[5]=r):r=t[5],r},Ke=e=>{const t=D.c(25),{id:a}=e,o=B(),{data:i}=Z(a),[c,u]=w.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const p=L(r),h="variant"in p,C="environment"in p,b=h||C;let g;t[1]!==a||t[2]!==C||t[3]!==h||t[4]!==o?(g=()=>{o(h?{to:"/configs/$id/variants",params:{id:a}}:C?{to:"/configs/$id/targeting",params:{id:a}}:{to:"/configs"})},t[1]=a,t[2]=C,t[3]=h,t[4]=o,t[5]=g):g=t[5];const n=g;let l;t[6]!==i?(l=async()=>{i?.slug&&(await navigator.clipboard.writeText(i.slug),u(!0),setTimeout(()=>u(!1),2e3))},t[6]=i,t[7]=l):l=t[7];const d=l,S=b?Le:oe;let m;t[8]!==S?(m=s.jsx(H,{icon:S}),t[8]=S,t[9]=m):m=t[9];let x;t[10]!==n||t[11]!==m?(x=s.jsx(E,{onClick:n,size:"icon",scheme:"gray",variant:"ghost",children:m}),t[10]=n,t[11]=m,t[12]=x):x=t[12];const v=i??void 0;let f;t[13]!==a||t[14]!==b||t[15]!==v?(f=s.jsx(We,{id:a,config:v,disabled:b},a),t[13]=a,t[14]=b,t[15]=v,t[16]=f):f=t[16];let j;t[17]!==c||t[18]!==i||t[19]!==d?(j=i?.slug&&s.jsxs("div",{className:De,children:[s.jsx("span",{className:$e,children:"Config Id"}),s.jsx("span",{className:ke,children:i.slug}),s.jsx("button",{type:"button",className:Me,onClick:d,"aria-label":"Copy config ID",children:c?s.jsx(Fe,{size:14}):s.jsx(He,{size:14})})]}),t[17]=c,t[18]=i,t[19]=d,t[20]=j):j=t[20];let y;return t[21]!==x||t[22]!==f||t[23]!==j?(y=s.jsxs("div",{className:K,children:[x,f,j]}),t[21]=x,t[22]=f,t[23]=j,t[24]=y):y=t[24],y};function vt(){const e=D.c(40),{containerRef:t,setTileWidth:a}=ne();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const i=L(o),c=B(),u=ee(),{toggleSidebar:r}=te();let p;e[1]!==u?(p=u.filter(Je).map(Xe),e[1]=u,e[2]=p):p=e[2];const h=p;let C;e[3]!==c?(C=()=>{c({to:"/configs/$id",params:{id:"new"}})},e[3]=c,e[4]=C):C=e[4];const b=C;let g;e[5]!==i.id||e[6]!==a?(g=()=>{i?.id?a("25%"):a("100%")},e[5]=i.id,e[6]=a,e[7]=g):g=e[7];const n=i?.id;let l;e[8]!==n?(l=[n],e[8]=n,e[9]=l):l=e[9],w.useEffect(g,l);let d;e[10]!==r?(d=()=>{r()},e[10]=r,e[11]=d):d=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(H,{icon:me}),e[12]=S):S=e[12];let m;e[13]!==d?(m=s.jsx(E,{onClick:d,size:"icon",variant:"ghost",scheme:"gray",children:S}),e[13]=d,e[14]=m):m=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(H,{icon:Be,className:A}),e[15]=x):x=e[15];let v;e[16]!==h?(v=s.jsx(fe,{items:h}),e[16]=h,e[17]=v):v=e[17];let f;e[18]!==v||e[19]!==m?(f=s.jsxs("div",{className:O,children:[m,x,v]}),e[18]=v,e[19]=m,e[20]=f):f=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(H,{icon:Ie,className:A}),e[21]=j):j=e[21];let y;e[22]!==b?(y=s.jsx("div",{className:O,children:s.jsxs(E,{variant:"outline",scheme:"gray",onClick:b,children:[j,"New Config"]})}),e[22]=b,e[23]=y):y=e[23];let N;e[24]!==f||e[25]!==y?(N=s.jsxs(ue,{className:ge,children:[f,y]}),e[24]=f,e[25]=y,e[26]=N):N=e[26];let $,k;e[27]===Symbol.for("react.memo_cache_sentinel")?($=s.jsxs("div",{className:P(q,le),children:[s.jsx("div",{className:K}),s.jsx(Oe,{})]}),k=P(q,re),e[27]=$,e[28]=k):($=e[27],k=e[28]);const I=i.id;let T;e[29]!==I?(T=s.jsx(Ke,{id:I}),e[29]=I,e[30]=T):T=e[30];let M;e[31]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(ae,{}),e[31]=M):M=e[31];let R;e[32]!==T?(R=s.jsx("div",{className:k,children:s.jsxs("div",{children:[T,M]})}),e[32]=T,e[33]=R):R=e[33];let _;e[34]!==t||e[35]!==R?(_=s.jsx("div",{className:pe,children:s.jsxs("div",{ref:t,className:ce,children:[$,R]})}),e[34]=t,e[35]=R,e[36]=_):_=e[36];let F;return e[37]!==N||e[38]!==_?(F=s.jsxs(s.Fragment,{children:[N,_]}),e[37]=N,e[38]=_,e[39]=F):F=e[39],F}function Xe(e){const t=e.loaderData?.title,a=e.staticData.customData?.title,o=t??a;return{key:e.id,label:s.jsx(se,{to:e.pathname,className:de,children:o}),prefix:e.staticData.customData?.icon}}function Je(e){return!!e.staticData.customData?.title||!!e.loaderData?.title}export{vt as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as F,q as I,j as t}from"./index-BCY9aD4r.js";import{m as E,l as O,L as z,e as A,o as _,w as b,q as y,v as w,x as G}from"./observability.css-dztiak5K.js";/* empty css */function H(){const e=F.c(39);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/(app)/observability"},e[0]=u):u=e[0];const R=I(u),k=R.from??"",g=R.to??"";let x;e[1]!==k||e[2]!==g?(x={startDate:k,endDate:g},e[1]=k,e[2]=g,e[3]=x):x=e[3];const D=x,{data:s,isLoading:P}=E(D);if(P){let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:O,children:t.jsx(z,{className:"animate-spin",size:24})}),e[4]=a):a=e[4],a}if(!(s&&s.requestCount>0)){let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:A,children:[t.jsx("p",{children:"No cost data available yet."}),t.jsx("p",{children:"Make some API requests through the gateway to see cost breakdowns here."})]}),e[5]=a):a=e[5],a}let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{className:_,children:"Total Cost"}),e[6]=j):j=e[6];const q=s?.totalCostFormatted;let l;e[7]!==q?(l=t.jsxs("div",{className:b,children:[j,t.jsx("p",{className:y,children:q})]}),e[7]=q,e[8]=l):l=e[8];let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("span",{className:_,children:"Input Cost"}),e[9]=C):C=e[9];const T=s?.totalInputCostFormatted;let o;e[10]!==T?(o=t.jsx("p",{className:y,children:T}),e[10]=T,e[11]=o):o=e[11];let n;e[12]!==s?.totalPromptTokens?(n=s?.totalPromptTokens.toLocaleString(),e[12]=s?.totalPromptTokens,e[13]=n):n=e[13];let i;e[14]!==n?(i=t.jsxs("span",{className:w,children:[n," tokens"]}),e[14]=n,e[15]=i):i=e[15];let c;e[16]!==i||e[17]!==o?(c=t.jsxs("div",{className:b,children:[C,o,i]}),e[16]=i,e[17]=o,e[18]=c):c=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:_,children:"Output Cost"}),e[19]=N):N=e[19];const L=s?.totalOutputCostFormatted;let r;e[20]!==L?(r=t.jsx("p",{className:y,children:L}),e[20]=L,e[21]=r):r=e[21];let m;e[22]!==s?.totalCompletionTokens?(m=s?.totalCompletionTokens.toLocaleString(),e[22]=s?.totalCompletionTokens,e[23]=m):m=e[23];let d;e[24]!==m?(d=t.jsxs("span",{className:w,children:[m," tokens"]}),e[24]=m,e[25]=d):d=e[25];let p;e[26]!==r||e[27]!==d?(p=t.jsxs("div",{className:b,children:[N,r,d]}),e[26]=r,e[27]=d,e[28]=p):p=e[28];let v;e[29]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:_,children:"Requests"}),e[29]=v):v=e[29];let h;e[30]!==s?.requestCount?(h=s?.requestCount.toLocaleString(),e[30]=s?.requestCount,e[31]=h):h=e[31];let f;e[32]!==h?(f=t.jsxs("div",{className:b,children:[v,t.jsx("p",{className:y,children:h})]}),e[32]=h,e[33]=f):f=e[33];let S;return e[34]!==c||e[35]!==p||e[36]!==f||e[37]!==l?(S=t.jsx("div",{children:t.jsxs("div",{className:G,children:[l,c,p,f]})}),e[34]=c,e[35]=p,e[36]=f,e[37]=l,e[38]=S):S=e[38],S}export{H as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as w,d as F,f as z,g as I,h as Y,j as n,a as R,i as L,k as X,I as k,u as J,b as Z,e as Q,L as ee,O as te}from"./index-BCY9aD4r.js";import{w as q,b as ne,C as se,c as A,B as oe,h as O,H as ae,a as ie,g as re}from"./area.css-DTnbbu5M.js";import{B}from"./button-DftzA6-1.js";import{U as le,X as ce,u as me,l as de,r as ue,t as fe}from"./update-or-create-name-ChWLK2jI.js";import{c as pe,u as ve,f as U,g as ge,a as he,b as xe,d as je}from"./index-DvzXLQL6.js";import{T as Ce,a as be,b as V,c as ye,d as Se,e as we}from"./table-xLf4iXV8.js";import{u as Ne,g as G}from"./useEnvironments-CYkrqAdO.js";import{f as Re}from"./formatDistance-Bok3-MB1.js";import{h as K}from"./index.esm-COTq2pHX.js";import{u as W}from"./useMutation-VUB-GXkv.js";import{C as De}from"./chevron-right-Dz77YeP_.js";import{P as Ee}from"./plus-C_L0BpbU.js";/* empty css */import"./useButton-Ct8hIyjz.js";import"./tooltip-BKoDpdAC.js";import"./popupStateMapping-DkOpwBhG.js";import"./usePopupAutoResize-ddPHogUJ.js";import"./getDisabledMountTransitionStyles-CKUvhO4q.js";import"./useSyncedFloatingRootContext-BzuhbdSw.js";import"./useFocus-Du1aH2j1.js";import"./en-US-C8ut0f5H.js";/* empty css */const H=pe();function Te(){const[e,t]=w.useState([{id:"createdAt",desc:!1}]),[s,o]=w.useState([]),[l,i]=w.useState(""),{data:d}=Ne(),m=F(),{environment:r}=z({strict:!1}),u=I(),f=w.useCallback(a=>{u.prefetchQuery(Y(a))},[u]),N=w.useMemo(()=>[H.accessor("name",{header:"Name",cell:a=>a.row.original.isProd?`${a.getValue()} (this environment)`:a.getValue()}),H.accessor("isProd",{header:"Production",cell:a=>a.getValue()?"Yes":"No"}),H.accessor("createdAt",{header:"Creation Date",cell:a=>Re(new Date(a.getValue()),new Date,{addSuffix:!0})})],[]),v=ve({data:d||[],columns:N,state:{sorting:e,columnFilters:s,globalFilter:l},onSortingChange:t,onColumnFiltersChange:o,onGlobalFilterChange:i,getCoreRowModel:je(),getFilteredRowModel:xe(),getSortedRowModel:he(),getPaginationRowModel:ge(),initialState:{pagination:{pageSize:100}}});return n.jsx("div",{children:n.jsxs(Ce,{children:[n.jsx(be,{children:v.getHeaderGroups().map(a=>n.jsx(V,{children:a.headers.map(c=>{const p=c.column.getIsSorted();return n.jsx(ye,{sortable:c.column.getCanSort(),onClick:c.column.getToggleSortingHandler(),sortDirection:p==="asc"?"asc":p==="desc"?"desc":null,children:c.isPlaceholder?null:U(c.column.columnDef.header,c.getContext())},c.id)})},a.id))}),n.jsx(Se,{children:v.getRowModel().rows.map(a=>n.jsx(V,{interactive:!0,selected:a.original.id===r,onMouseEnter:()=>f(a.original.id),onClick:()=>m({to:"/environments/$environment",params:{environment:a.original.id}}),children:a.getVisibleCells().map(c=>n.jsx(we,{children:U(c.column.columnDef.cell,c.getContext())},c.id))},a.id))})]})})}const Pe=()=>{const e=R.c(3),t=F(),s=I();let o;return e[0]!==t||e[1]!==s?(o={mutationFn:$e,onSuccess:async l=>{await s.invalidateQueries({queryKey:G()}),l?.id&&t({to:"/environments/$environment",params:{environment:l?.id}})}},e[0]=t,e[1]=s,e[2]=o):o=e[2],W(o)};async function $e(e){const t=e.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),o=await(await L.v1.environments.$post({json:{name:e.name,slug:t,isProd:e.isProd}})).json();return"data"in o?o.data:void 0}const Me=()=>{const e=R.c(2),t=I();let s;return e[0]!==t?(s={mutationFn:_e,onSuccess:()=>{t.invalidateQueries({queryKey:G()})}},e[0]=t,e[1]=s):s=e[1],W(s)};async function _e(e){const s=await(await L.v1.environments[":id"].$patch({param:{id:e.id},json:{name:e.name}})).json();return"data"in s?s.data:void 0}const ke=e=>{const t=R.c(7),{id:s,environment:o}=e,{mutateAsync:l}=Pe(),{mutateAsync:i}=Me(),d=o?.isProd,m=o?.isProd?"You can't rename Production environment.":void 0;let r;return t[0]!==l||t[1]!==o||t[2]!==s||t[3]!==d||t[4]!==m||t[5]!==i?(r=n.jsx(le,{id:s,disabled:d,tooltip:m,entity:o,placeholder:"Environment Name",onCreate:l,onUpdate:i}),t[0]=l,t[1]=o,t[2]=s,t[3]=d,t[4]=m,t[5]=i,t[6]=r):r=t[6],r},Fe=e=>{const t=R.c(11),{id:s}=e,o=F(),{data:l}=X(s);let i;t[0]!==o?(i=()=>{o({to:"/environments"})},t[0]=o,t[1]=i):i=t[1];const d=i;let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(k,{icon:ce}),t[2]=m):m=t[2];let r;t[3]!==d?(r=n.jsx(B,{onClick:d,size:"icon",scheme:"gray",variant:"ghost",children:m}),t[3]=d,t[4]=r):r=t[4];let u;t[5]!==l||t[6]!==s?(u=s?n.jsx(ke,{id:s,environment:l??void 0},s):null,t[5]=l,t[6]=s,t[7]=u):u=t[7];let f;return t[8]!==r||t[9]!==u?(f=n.jsxs("div",{className:K,children:[r,u]}),t[8]=r,t[9]=u,t[10]=f):f=t[10],f};function it(){const e=R.c(40),{toggleSidebar:t}=J(),{containerRef:s,setTileWidth:o}=me();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[0]=l):l=e[0];const i=z(l),d=Z(),m=F();let r;e[1]!==d?(r=d.filter(Be).map(He),e[1]=d,e[2]=r):r=e[2];const u=r;let f;e[3]!==m?(f=()=>{m({to:"/environments/$environment",params:{environment:"new"}})},e[3]=m,e[4]=f):f=e[4];const N=f;let v;e[5]!==i.environment||e[6]!==o?(v=()=>{i?.environment?o("25%"):o("100%")},e[5]=i.environment,e[6]=o,e[7]=v):v=e[7];const a=i?.environment;let c;e[8]!==a?(c=[a],e[8]=a,e[9]=c):c=e[9],w.useEffect(v,c);let p;e[10]!==t?(p=()=>{t()},e[10]=t,e[11]=p):p=e[11];let D;e[12]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(k,{icon:se}),e[12]=D):D=e[12];let g;e[13]!==p?(g=n.jsx(B,{onClick:p,size:"icon",variant:"ghost",scheme:"gray",children:D}),e[13]=p,e[14]=g):g=e[14];let E;e[15]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(k,{icon:De,className:A}),e[15]=E):E=e[15];let h;e[16]!==u?(h=n.jsx(oe,{items:u}),e[16]=u,e[17]=h):h=e[17];let x;e[18]!==h||e[19]!==g?(x=n.jsxs("div",{className:O,children:[g,E,h]}),e[18]=h,e[19]=g,e[20]=x):x=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(k,{icon:Ee,className:A}),e[21]=T):T=e[21];let j;e[22]!==N?(j=n.jsx("div",{className:O,children:n.jsxs(B,{variant:"outline",scheme:"gray",onClick:N,children:[T,"New Environment"]})}),e[22]=N,e[23]=j):j=e[23];let C;e[24]!==x||e[25]!==j?(C=n.jsxs(ae,{className:ie,children:[x,j]}),e[24]=x,e[25]=j,e[26]=C):C=e[26];let P,$;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsxs("div",{className:Q(q,de),children:[n.jsx("div",{className:K}),n.jsx(Te,{})]}),$=Q(q,ue),e[27]=P,e[28]=$):(P=e[27],$=e[28]);let b;e[29]!==i.environment?(b=n.jsx(Fe,{id:i.environment}),e[29]=i.environment,e[30]=b):b=e[30];let M;e[31]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx(te,{}),e[31]=M):M=e[31];let y;e[32]!==b?(y=n.jsx("div",{className:$,children:n.jsxs("div",{children:[b,M]})}),e[32]=b,e[33]=y):y=e[33];let S;e[34]!==s||e[35]!==y?(S=n.jsx("div",{className:re,children:n.jsxs("div",{ref:s,className:fe,children:[P,y]})}),e[34]=s,e[35]=y,e[36]=S):S=e[36];let _;return e[37]!==C||e[38]!==S?(_=n.jsxs(n.Fragment,{children:[C,S]}),e[37]=C,e[38]=S,e[39]=_):_=e[39],_}function He(e){const t=e.loaderData?.title,s=e.staticData.customData?.title,o=t??s;return{key:e.id,label:n.jsx(ee,{to:e.pathname,className:ne,children:o}),prefix:e.staticData.customData?.icon}}function Be(e){return!!e.staticData.customData?.title||!!e.loaderData?.title}export{it as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Ft,$ as D}from"./index-BCY9aD4r.js";/* empty css */Ft({defaultClassName:"_1krr3zc2 _1krr3zc1 _1lg22bks0 _1lg22bk3 _1lg22bkv0 _1lg22bkj9 _1lg22bkw0",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var zt="_18qi14i0",Kt="_18qi14i1",Yt="_18qi14i3 _18qi14i2 _1lg22bkux _1lg22bkj3 _1lg22bkw0",Jt="_18qi14i4",Qt="_18qi14i5",Xt="_18qi14i7 _18qi14i6 _1lg22bk23 _1lg22bk2r _1lg22bks0 _1lg22bksf _1lg22bkti _1lg22bktr",Zt="_18qi14i9 _18qi14i8 _1lg22bkv0 _1lg22bkuc _1lg22bk26 _1lg22bk2u _1lg22bkbc _1lg22bkj9",Gt="_18qi14ia",ye=e=>e.type==="checkbox",ae=e=>e instanceof Date,p=e=>e==null;const rt=e=>typeof e=="object";var T=e=>!p(e)&&!Array.isArray(e)&&rt(e)&&!ae(e),kt=e=>T(e)&&e.target?ye(e.target)?e.target.checked:e.target.value:e,xt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,At=(e,s)=>e.has(xt(s)),wt=e=>{const s=e.constructor&&e.constructor.prototype;return T(s)&&s.hasOwnProperty("isPrototypeOf")},Ce=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function M(e){let s;const t=Array.isArray(e),a=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)s=new Date(e);else if(!(Ce&&(e instanceof Blob||a))&&(t||T(e)))if(s=t?[]:Object.create(Object.getPrototypeOf(e)),!t&&!wt(e))s=e;else for(const u in e)e.hasOwnProperty(u)&&(s[u]=M(e[u]));else return e;return s}var be=e=>/^\w*$/.test(e),O=e=>e===void 0,Oe=e=>Array.isArray(e)?e.filter(Boolean):[],Re=e=>Oe(e.replace(/["|']|\]/g,"").split(/\.|\[/)),g=(e,s,t)=>{if(!s||!T(e))return t;const a=(be(s)?[s]:Re(s)).reduce((u,l)=>p(u)?u:u[l],e);return O(a)||a===e?O(e[s])?t:e[s]:a},X=e=>typeof e=="boolean",w=(e,s,t)=>{let a=-1;const u=be(s)?[s]:Re(s),l=u.length,c=l-1;for(;++a<l;){const d=u[a];let L=t;if(a!==c){const U=e[d];L=T(U)||Array.isArray(U)?U:isNaN(+u[a+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=L,e=e[d]}};const $e={BLUR:"blur",FOCUS_OUT:"focusout"},z={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},st=D.createContext(null);st.displayName="HookFormContext";const Dt=()=>D.useContext(st);var St=(e,s,t,a=!0)=>{const u={defaultValues:s._defaultValues};for(const l in e)Object.defineProperty(u,l,{get:()=>{const c=l;return s._proxyFormState[c]!==z.all&&(s._proxyFormState[c]=!a||z.all),e[c]}});return u};const it=typeof window<"u"?D.useLayoutEffect:D.useEffect;var q=e=>typeof e=="string",De=(e,s,t,a,u)=>q(e)?(a&&s.watch.add(e),g(t,e,u)):Array.isArray(e)?e.map(l=>(a&&s.watch.add(l),g(t,l))):(a&&(s.watchAll=!0),t),Se=e=>p(e)||!rt(e);function K(e,s,t=new WeakSet){if(Se(e)||Se(s))return Object.is(e,s);if(ae(e)&&ae(s))return e.getTime()===s.getTime();const a=Object.keys(e),u=Object.keys(s);if(a.length!==u.length)return!1;if(t.has(e)||t.has(s))return!0;t.add(e),t.add(s);for(const l of a){const c=e[l];if(!u.includes(l))return!1;if(l!=="ref"){const d=s[l];if(ae(c)&&ae(d)||T(c)&&T(d)||Array.isArray(c)&&Array.isArray(d)?!K(c,d,t):!Object.is(c,d))return!1}}return!0}function er(e){const s=Dt(),{control:t=s.control,name:a,defaultValue:u,disabled:l,exact:c,compute:d}=e||{},L=D.useRef(u),U=D.useRef(d),F=D.useRef(void 0),A=D.useRef(t),v=D.useRef(a);U.current=d;const[re,$]=D.useState(()=>{const E=t._getWatch(a,L.current);return U.current?U.current(E):E}),S=D.useCallback(E=>{const k=De(a,t._names,E||t._formValues,!1,L.current);return U.current?U.current(k):k},[t._formValues,t._names,a]),P=D.useCallback(E=>{if(!l){const k=De(a,t._names,E||t._formValues,!1,L.current);if(U.current){const G=U.current(k);K(G,F.current)||($(G),F.current=G)}else $(k)}},[t._formValues,t._names,l,a]);it(()=>((A.current!==t||!K(v.current,a))&&(A.current=t,v.current=a,P()),t._subscribe({name:a,formState:{values:!0},exact:c,callback:E=>{P(E.values)}})),[t,c,a,P]),D.useEffect(()=>t._removeUnmounted());const se=A.current!==t,_=v.current,W=D.useMemo(()=>{if(l)return null;const E=!se&&!K(_,a);return se||E?S():null},[l,se,a,_,S]);return W!==null?W:re}var Et=(e,s,t,a,u)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[a]:u||!0}}:{},ce=e=>Array.isArray(e)?e:[e],je=()=>{let e=[];return{get observers(){return e},next:u=>{for(const l of e)l.next&&l.next(u)},subscribe:u=>(e.push(u),{unsubscribe:()=>{e=e.filter(l=>l!==u)}}),unsubscribe:()=>{e=[]}}};function at(e,s){const t={};for(const a in e)if(e.hasOwnProperty(a)){const u=e[a],l=s[a];if(u&&T(u)&&l){const c=at(u,l);T(c)&&(t[a]=c)}else e[a]&&(t[a]=l)}return t}var I=e=>T(e)&&!Object.keys(e).length,Te=e=>e.type==="file",Y=e=>typeof e=="function",ve=e=>{if(!Ce)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},nt=e=>e.type==="select-multiple",Le=e=>e.type==="radio",Ct=e=>Le(e)||ye(e),we=e=>ve(e)&&e.isConnected;function Ot(e,s){const t=s.slice(0,-1).length;let a=0;for(;a<t;)e=O(e)?a++:e[s[a++]];return e}function Rt(e){for(const s in e)if(e.hasOwnProperty(s)&&!O(e[s]))return!1;return!0}function R(e,s){const t=Array.isArray(s)?s:be(s)?[s]:Re(s),a=t.length===1?e:Ot(e,t),u=t.length-1,l=t[u];return a&&delete a[l],u!==0&&(T(a)&&I(a)||Array.isArray(a)&&Rt(a))&&R(e,t.slice(0,-1)),e}var Tt=e=>{for(const s in e)if(Y(e[s]))return!0;return!1};function lt(e){return Array.isArray(e)||T(e)&&!Tt(e)}function Ee(e,s={}){for(const t in e){const a=e[t];lt(a)?(s[t]=Array.isArray(a)?[]:{},Ee(a,s[t])):O(a)||(s[t]=!0)}return s}function ue(e,s,t){t||(t=Ee(s));for(const a in e){const u=e[a];if(lt(u))O(s)||Se(t[a])?t[a]=Ee(u,Array.isArray(u)?[]:{}):ue(u,p(s)?{}:s[a],t[a]);else{const l=s[a];t[a]=!K(u,l)}}return t}const ze={value:!1,isValid:!1},Ke={value:!0,isValid:!0};var ut=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!O(e[0].attributes.value)?O(e[0].value)||e[0].value===""?Ke:{value:e[0].value,isValid:!0}:Ke:ze}return ze},ot=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:a})=>O(e)?e:s?e===""?NaN:e&&+e:t&&q(e)?new Date(e):a?a(e):e;const Ye={isValid:!1,value:null};var ft=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Ye):Ye;function Je(e){const s=e.ref;return Te(s)?s.files:Le(s)?ft(e.refs).value:nt(s)?[...s.selectedOptions].map(({value:t})=>t):ye(s)?ut(e.refs).value:ot(O(s.value)?e.ref.value:s.value,e)}var Lt=(e,s,t,a)=>{const u={};for(const l of e){const c=g(s,l);c&&w(u,l,c._f)}return{criteriaMode:t,names:[...e],fields:u,shouldUseNativeValidation:a}},_e=e=>e instanceof RegExp,fe=e=>O(e)?e:_e(e)?e.source:T(e)?_e(e.value)?e.value.source:e.value:e,Qe=e=>({isOnSubmit:!e||e===z.onSubmit,isOnBlur:e===z.onBlur,isOnChange:e===z.onChange,isOnAll:e===z.all,isOnTouch:e===z.onTouched});const Xe="AsyncFunction";var Ut=e=>!!e&&!!e.validate&&!!(Y(e.validate)&&e.validate.constructor.name===Xe||T(e.validate)&&Object.values(e.validate).find(s=>s.constructor.name===Xe)),Mt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ze=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(a=>e.startsWith(a)&&/^\.\w+/.test(e.slice(a.length))));const de=(e,s,t,a)=>{for(const u of t||Object.keys(e)){const l=g(e,u);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&s(c.refs[0],u)&&!a)return!0;if(c.ref&&s(c.ref,c.name)&&!a)return!0;if(de(d,s))break}else if(T(d)&&de(d,s))break}}};function Ge(e,s,t){const a=g(e,t);if(a||be(t))return{error:a,name:t};const u=t.split(".");for(;u.length;){const l=u.join("."),c=g(s,l),d=g(e,l);if(c&&!Array.isArray(c)&&t!==l)return{name:t};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};u.pop()}return{name:t}}var Nt=(e,s,t,a)=>{t(e);const{name:u,...l}=e;return I(l)||Object.keys(l).length>=Object.keys(s).length||Object.keys(l).find(c=>s[c]===(!a||z.all))},It=(e,s,t)=>!e||!s||e===s||ce(e).some(a=>a&&(t?a===s:a.startsWith(s)||s.startsWith(a))),Bt=(e,s,t,a,u)=>u.isOnAll?!1:!t&&u.isOnTouch?!(s||e):(t?a.isOnBlur:u.isOnBlur)?!e:(t?a.isOnChange:u.isOnChange)?e:!0,pt=(e,s)=>!Oe(g(e,s)).length&&R(e,s),qt=(e,s,t)=>{const a=ce(g(e,t));return w(a,"root",s[t]),w(e,t,a),e};function et(e,s,t="validate"){if(q(e)||Array.isArray(e)&&e.every(q)||X(e)&&!e)return{type:t,message:q(e)?e:"",ref:s}}var le=e=>T(e)&&!_e(e)?e:{value:e,message:""},tt=async(e,s,t,a,u,l)=>{const{ref:c,refs:d,required:L,maxLength:U,minLength:F,min:A,max:v,pattern:re,validate:$,name:S,valueAsNumber:P,mount:se}=e._f,_=g(t,S);if(!se||s.has(S))return{};const W=d?d[0]:c,E=b=>{u&&W.reportValidity&&(W.setCustomValidity(X(b)?"":b||""),W.reportValidity())},k={},G=Le(c),ee=ye(c),Ve=G||ee,j=(P||Te(c))&&O(c.value)&&O(_)||ve(c)&&c.value===""||_===""||Array.isArray(_)&&!_.length,ie=Et.bind(null,S,a,k),J=(b,m,C,N=Z.maxLength,B=Z.minLength)=>{const Q=b?m:C;k[S]={type:b?N:B,message:Q,ref:c,...ie(b?N:B,Q)}};if(l?!Array.isArray(_)||!_.length:L&&(!Ve&&(j||p(_))||X(_)&&!_||ee&&!ut(d).isValid||G&&!ft(d).isValid)){const{value:b,message:m}=q(L)?{value:!!L,message:L}:le(L);if(b&&(k[S]={type:Z.required,message:m,ref:W,...ie(Z.required,m)},!a))return E(m),k}if(!j&&(!p(A)||!p(v))){let b,m;const C=le(v),N=le(A);if(!p(_)&&!isNaN(_)){const B=c.valueAsNumber||_&&+_;p(C.value)||(b=B>C.value),p(N.value)||(m=B<N.value)}else{const B=c.valueAsDate||new Date(_),Q=ge=>new Date(new Date().toDateString()+" "+ge),oe=c.type=="time",ne=c.type=="week";q(C.value)&&_&&(b=oe?Q(_)>Q(C.value):ne?_>C.value:B>new Date(C.value)),q(N.value)&&_&&(m=oe?Q(_)<Q(N.value):ne?_<N.value:B<new Date(N.value))}if((b||m)&&(J(!!b,C.message,N.message,Z.max,Z.min),!a))return E(k[S].message),k}if((U||F)&&!j&&(q(_)||l&&Array.isArray(_))){const b=le(U),m=le(F),C=!p(b.value)&&_.length>+b.value,N=!p(m.value)&&_.length<+m.value;if((C||N)&&(J(C,b.message,m.message),!a))return E(k[S].message),k}if(re&&!j&&q(_)){const{value:b,message:m}=le(re);if(_e(b)&&!_.match(b)&&(k[S]={type:Z.pattern,message:m,ref:c,...ie(Z.pattern,m)},!a))return E(m),k}if($){if(Y($)){const b=await $(_,t),m=et(b,W);if(m&&(k[S]={...m,...ie(Z.validate,m.message)},!a))return E(m.message),k}else if(T($)){let b={};for(const m in $){if(!I(b)&&!a)break;const C=et(await $[m](_,t),W,m);C&&(b={...C,...ie(m,C.message)},E(C.message),a&&(k[S]=b))}if(!I(b)&&(k[S]={ref:W,...b},!a))return k}}return E(!0),k};const Pt={mode:z.onSubmit,reValidateMode:z.onChange,shouldFocusError:!0};function Wt(e={}){let s={...Pt,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:Y(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},a={},u=T(s.defaultValues)||T(s.values)?M(s.defaultValues||s.values)||{}:{},l=s.shouldUnregister?{}:M(u),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},L,U=0;const F={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let A={...F};const v={array:je(),state:je()},re=s.criteriaMode===z.all,$=r=>i=>{clearTimeout(U),U=setTimeout(r,i)},S=async r=>{if(!s.disabled&&(F.isValid||A.isValid||r)){const i=s.resolver?I((await ee()).errors):await j(a,!0);i!==t.isValid&&v.state.next({isValid:i})}},P=(r,i)=>{!s.disabled&&(F.isValidating||F.validatingFields||A.isValidating||A.validatingFields)&&((r||Array.from(d.mount)).forEach(n=>{n&&(i?w(t.validatingFields,n,i):R(t.validatingFields,n))}),v.state.next({validatingFields:t.validatingFields,isValidating:!I(t.validatingFields)}))},se=(r,i=[],n,y,f=!0,o=!0)=>{if(y&&n&&!s.disabled){if(c.action=!0,o&&Array.isArray(g(a,r))){const h=n(g(a,r),y.argA,y.argB);f&&w(a,r,h)}if(o&&Array.isArray(g(t.errors,r))){const h=n(g(t.errors,r),y.argA,y.argB);f&&w(t.errors,r,h),pt(t.errors,r)}if((F.touchedFields||A.touchedFields)&&o&&Array.isArray(g(t.touchedFields,r))){const h=n(g(t.touchedFields,r),y.argA,y.argB);f&&w(t.touchedFields,r,h)}(F.dirtyFields||A.dirtyFields)&&(t.dirtyFields=ue(u,l)),v.state.next({name:r,isDirty:J(r,i),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else w(l,r,i)},_=(r,i)=>{w(t.errors,r,i),v.state.next({errors:t.errors})},W=r=>{t.errors=r,v.state.next({errors:t.errors,isValid:!1})},E=(r,i,n,y)=>{const f=g(a,r);if(f){const o=g(l,r,O(n)?g(u,r):n);O(o)||y&&y.defaultChecked||i?w(l,r,i?o:Je(f._f)):C(r,o),c.mount&&!c.action&&S()}},k=(r,i,n,y,f)=>{let o=!1,h=!1;const V={name:r};if(!s.disabled){if(!n||y){(F.isDirty||A.isDirty)&&(h=t.isDirty,t.isDirty=V.isDirty=J(),o=h!==V.isDirty);const x=K(g(u,r),i);h=!!g(t.dirtyFields,r),x?R(t.dirtyFields,r):w(t.dirtyFields,r,!0),V.dirtyFields=t.dirtyFields,o=o||(F.dirtyFields||A.dirtyFields)&&h!==!x}if(n){const x=g(t.touchedFields,r);x||(w(t.touchedFields,r,n),V.touchedFields=t.touchedFields,o=o||(F.touchedFields||A.touchedFields)&&x!==n)}o&&f&&v.state.next(V)}return o?V:{}},G=(r,i,n,y)=>{const f=g(t.errors,r),o=(F.isValid||A.isValid)&&X(i)&&t.isValid!==i;if(s.delayError&&n?(L=$(()=>_(r,n)),L(s.delayError)):(clearTimeout(U),L=null,n?w(t.errors,r,n):R(t.errors,r)),(n?!K(f,n):f)||!I(y)||o){const h={...y,...o&&X(i)?{isValid:i}:{},errors:t.errors,name:r};t={...t,...h},v.state.next(h)}},ee=async r=>{P(r,!0);const i=await s.resolver(l,s.context,Lt(r||d.mount,a,s.criteriaMode,s.shouldUseNativeValidation));return P(r),i},Ve=async r=>{const{errors:i}=await ee(r);if(r)for(const n of r){const y=g(i,n);y?w(t.errors,n,y):R(t.errors,n)}else t.errors=i;return i},j=async(r,i,n={valid:!0})=>{for(const y in r){const f=r[y];if(f){const{_f:o,...h}=f;if(o){const V=d.array.has(o.name),x=f._f&&Ut(f._f);x&&F.validatingFields&&P([o.name],!0);const H=await tt(f,d.disabled,l,re,s.shouldUseNativeValidation&&!i,V);if(x&&F.validatingFields&&P([o.name]),H[o.name]&&(n.valid=!1,i))break;!i&&(g(H,o.name)?V?qt(t.errors,H,o.name):w(t.errors,o.name,H[o.name]):R(t.errors,o.name))}!I(h)&&await j(h,i,n)}}return n.valid},ie=()=>{for(const r of d.unMount){const i=g(a,r);i&&(i._f.refs?i._f.refs.every(n=>!we(n)):!we(i._f.ref))&&me(r)}d.unMount=new Set},J=(r,i)=>!s.disabled&&(r&&i&&w(l,r,i),!K(ge(),u)),b=(r,i,n)=>De(r,d,{...c.mount?l:O(i)?u:q(r)?{[r]:i}:i},n,i),m=r=>Oe(g(c.mount?l:u,r,s.shouldUnregister?g(u,r,[]):[])),C=(r,i,n={})=>{const y=g(a,r);let f=i;if(y){const o=y._f;o&&(!o.disabled&&w(l,r,ot(i,o)),f=ve(o.ref)&&p(i)?"":i,nt(o.ref)?[...o.ref.options].forEach(h=>h.selected=f.includes(h.value)):o.refs?ye(o.ref)?o.refs.forEach(h=>{(!h.defaultChecked||!h.disabled)&&(Array.isArray(f)?h.checked=!!f.find(V=>V===h.value):h.checked=f===h.value||!!f)}):o.refs.forEach(h=>h.checked=h.value===f):Te(o.ref)?o.ref.value="":(o.ref.value=f,o.ref.type||v.state.next({name:r,values:M(l)})))}(n.shouldDirty||n.shouldTouch)&&k(r,f,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&ne(r)},N=(r,i,n)=>{for(const y in i){if(!i.hasOwnProperty(y))return;const f=i[y],o=r+"."+y,h=g(a,o);(d.array.has(r)||T(f)||h&&!h._f)&&!ae(f)?N(o,f,n):C(o,f,n)}},B=(r,i,n={})=>{const y=g(a,r),f=d.array.has(r),o=M(i);w(l,r,o),f?(v.array.next({name:r,values:M(l)}),(F.isDirty||F.dirtyFields||A.isDirty||A.dirtyFields)&&n.shouldDirty&&v.state.next({name:r,dirtyFields:ue(u,l),isDirty:J(r,o)})):y&&!y._f&&!p(o)?N(r,o,n):C(r,o,n),Ze(r,d)&&v.state.next({...t,name:r}),v.state.next({name:c.mount?r:void 0,values:M(l)})},Q=async r=>{c.mount=!0;const i=r.target;let n=i.name,y=!0;const f=g(a,n),o=x=>{y=Number.isNaN(x)||ae(x)&&isNaN(x.getTime())||K(x,g(l,n,x))},h=Qe(s.mode),V=Qe(s.reValidateMode);if(f){let x,H;const he=i.type?Je(f._f):kt(r),te=r.type===$e.BLUR||r.type===$e.FOCUS_OUT,bt=!Mt(f._f)&&!s.resolver&&!g(t.errors,n)&&!f._f.deps||Bt(te,g(t.touchedFields,n),t.isSubmitted,V,h),xe=Ze(n,d,te);w(l,n,he),te?(!i||!i.readOnly)&&(f._f.onBlur&&f._f.onBlur(r),L&&L(0)):f._f.onChange&&f._f.onChange(r);const Ae=k(n,he,te),Vt=!I(Ae)||xe;if(!te&&v.state.next({name:n,type:r.type,values:M(l)}),bt)return(F.isValid||A.isValid)&&(s.mode==="onBlur"?te&&S():te||S()),Vt&&v.state.next({name:n,...xe?{}:Ae});if(!te&&xe&&v.state.next({...t}),s.resolver){const{errors:We}=await ee([n]);if(o(he),y){const mt=Ge(t.errors,a,n),He=Ge(We,a,mt.name||n);x=He.error,n=He.name,H=I(We)}}else P([n],!0),x=(await tt(f,d.disabled,l,re,s.shouldUseNativeValidation))[n],P([n]),o(he),y&&(x?H=!1:(F.isValid||A.isValid)&&(H=await j(a,!0)));y&&(f._f.deps&&(!Array.isArray(f._f.deps)||f._f.deps.length>0)&&ne(f._f.deps),G(n,H,x,Ae))}},oe=(r,i)=>{if(g(t.errors,i)&&r.focus)return r.focus(),1},ne=async(r,i={})=>{let n,y;const f=ce(r);if(s.resolver){const o=await Ve(O(r)?r:f);n=I(o),y=r?!f.some(h=>g(o,h)):n}else r?(y=(await Promise.all(f.map(async o=>{const h=g(a,o);return await j(h&&h._f?{[o]:h}:h)}))).every(Boolean),!(!y&&!t.isValid)&&S()):y=n=await j(a);return v.state.next({...!q(r)||(F.isValid||A.isValid)&&n!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:n}:{},errors:t.errors}),i.shouldFocus&&!y&&de(a,oe,r?f:d.mount),y},ge=(r,i)=>{let n={...c.mount?l:u};return i&&(n=at(i.dirtyFields?t.dirtyFields:t.touchedFields,n)),O(r)?n:q(r)?g(n,r):r.map(y=>g(n,y))},Ue=(r,i)=>({invalid:!!g((i||t).errors,r),isDirty:!!g((i||t).dirtyFields,r),error:g((i||t).errors,r),isValidating:!!g(t.validatingFields,r),isTouched:!!g((i||t).touchedFields,r)}),ct=r=>{r&&ce(r).forEach(i=>R(t.errors,i)),v.state.next({errors:r?t.errors:{}})},Me=(r,i,n)=>{const y=(g(a,r,{_f:{}})._f||{}).ref,f=g(t.errors,r)||{},{ref:o,message:h,type:V,...x}=f;w(t.errors,r,{...x,...i,ref:y}),v.state.next({name:r,errors:t.errors,isValid:!1}),n&&n.shouldFocus&&y&&y.focus&&y.focus()},dt=(r,i)=>Y(r)?v.state.subscribe({next:n=>"values"in n&&r(b(void 0,i),n)}):b(r,i,!0),Ne=r=>v.state.subscribe({next:i=>{It(r.name,i.name,r.exact)&&Nt(i,r.formState||F,_t,r.reRenderRoot)&&r.callback({values:{...l},...t,...i,defaultValues:u})}}).unsubscribe,yt=r=>(c.mount=!0,A={...A,...r.formState},Ne({...r,formState:A})),me=(r,i={})=>{for(const n of r?ce(r):d.mount)d.mount.delete(n),d.array.delete(n),i.keepValue||(R(a,n),R(l,n)),!i.keepError&&R(t.errors,n),!i.keepDirty&&R(t.dirtyFields,n),!i.keepTouched&&R(t.touchedFields,n),!i.keepIsValidating&&R(t.validatingFields,n),!s.shouldUnregister&&!i.keepDefaultValue&&R(u,n);v.state.next({values:M(l)}),v.state.next({...t,...i.keepDirty?{isDirty:J()}:{}}),!i.keepIsValid&&S()},Ie=({disabled:r,name:i})=>{(X(r)&&c.mount||r||d.disabled.has(i))&&(r?d.disabled.add(i):d.disabled.delete(i))},Fe=(r,i={})=>{let n=g(a,r);const y=X(i.disabled)||X(s.disabled);return w(a,r,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:r}},name:r,mount:!0,...i}}),d.mount.add(r),n?Ie({disabled:X(i.disabled)?i.disabled:s.disabled,name:r}):E(r,!0,i.value),{...y?{disabled:i.disabled||s.disabled}:{},...s.progressive?{required:!!i.required,min:fe(i.min),max:fe(i.max),minLength:fe(i.minLength),maxLength:fe(i.maxLength),pattern:fe(i.pattern)}:{},name:r,onChange:Q,onBlur:Q,ref:f=>{if(f){Fe(r,i),n=g(a,r);const o=O(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,h=Ct(o),V=n._f.refs||[];if(h?V.find(x=>x===o):o===n._f.ref)return;w(a,r,{_f:{...n._f,...h?{refs:[...V.filter(we),o,...Array.isArray(g(u,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),E(r,!1,void 0,o)}else n=g(a,r,{}),n._f&&(n._f.mount=!1),(s.shouldUnregister||i.shouldUnregister)&&!(At(d.array,r)&&c.action)&&d.unMount.add(r)}}},ke=()=>s.shouldFocusError&&de(a,oe,d.mount),gt=r=>{X(r)&&(v.state.next({disabled:r}),de(a,(i,n)=>{const y=g(a,n);y&&(i.disabled=y._f.disabled||r,Array.isArray(y._f.refs)&&y._f.refs.forEach(f=>{f.disabled=y._f.disabled||r}))},0,!1))},Be=(r,i)=>async n=>{let y;n&&(n.preventDefault&&n.preventDefault(),n.persist&&n.persist());let f=M(l);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:h}=await ee();t.errors=o,f=M(h)}else await j(a);if(d.disabled.size)for(const o of d.disabled)R(f,o);if(R(t.errors,"root"),I(t.errors)){v.state.next({errors:{}});try{await r(f,n)}catch(o){y=o}}else i&&await i({...t.errors},n),ke(),setTimeout(ke);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:I(t.errors)&&!y,submitCount:t.submitCount+1,errors:t.errors}),y)throw y},ht=(r,i={})=>{g(a,r)&&(O(i.defaultValue)?B(r,M(g(u,r))):(B(r,i.defaultValue),w(u,r,M(i.defaultValue))),i.keepTouched||R(t.touchedFields,r),i.keepDirty||(R(t.dirtyFields,r),t.isDirty=i.defaultValue?J(r,M(g(u,r))):J()),i.keepError||(R(t.errors,r),F.isValid&&S()),v.state.next({...t}))},pe=(r,i={})=>{const n=r?M(r):u,y=M(n),f=I(r),o=f?u:y;if(i.keepDefaultValues||(u=n),!i.keepValues){if(i.keepDirtyValues){const h=new Set([...d.mount,...Object.keys(ue(u,l))]);for(const V of Array.from(h))g(t.dirtyFields,V)?w(o,V,g(l,V)):B(V,g(o,V))}else{if(Ce&&O(r))for(const h of d.mount){const V=g(a,h);if(V&&V._f){const x=Array.isArray(V._f.refs)?V._f.refs[0]:V._f.ref;if(ve(x)){const H=x.closest("form");if(H){H.reset();break}}}}if(i.keepFieldsRef)for(const h of d.mount)B(h,g(o,h));else a={}}l=s.shouldUnregister?i.keepDefaultValues?M(u):{}:M(o),v.array.next({values:{...o}}),v.state.next({values:{...o}})}d={mount:i.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!F.isValid||!!i.keepIsValid||!!i.keepDirtyValues||!s.shouldUnregister&&!I(o),c.watch=!!s.shouldUnregister,c.action=!1,i.keepErrors||(t.errors={}),v.state.next({submitCount:i.keepSubmitCount?t.submitCount:0,isDirty:f?!1:i.keepDirty?t.isDirty:!!(i.keepDefaultValues&&!K(r,u)),isSubmitted:i.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:f?{}:i.keepDirtyValues?i.keepDefaultValues&&l?ue(u,l):t.dirtyFields:i.keepDefaultValues&&r?ue(u,r):i.keepDirty?t.dirtyFields:{},touchedFields:i.keepTouched?t.touchedFields:{},errors:i.keepErrors?t.errors:{},isSubmitSuccessful:i.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:u})},qe=(r,i)=>pe(Y(r)?r(l):r,i),vt=(r,i={})=>{const n=g(a,r),y=n&&n._f;if(y){const f=y.refs?y.refs[0]:y.ref;f.focus&&(f.focus(),i.shouldSelect&&Y(f.select)&&f.select())}},_t=r=>{t={...t,...r}},Pe={control:{register:Fe,unregister:me,getFieldState:Ue,handleSubmit:Be,setError:Me,_subscribe:Ne,_runSchema:ee,_focusError:ke,_getWatch:b,_getDirty:J,_setValid:S,_setFieldArray:se,_setDisabledField:Ie,_setErrors:W,_getFieldArray:m,_reset:pe,_resetDefaultValues:()=>Y(s.defaultValues)&&s.defaultValues().then(r=>{qe(r,s.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:ie,_disableForm:gt,_subjects:v,_proxyFormState:F,get _fields(){return a},get _formValues(){return l},get _state(){return c},set _state(r){c=r},get _defaultValues(){return u},get _names(){return d},set _names(r){d=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r}}},subscribe:yt,trigger:ne,register:Fe,handleSubmit:Be,watch:dt,setValue:B,getValues:ge,reset:qe,resetField:ht,clearErrors:ct,unregister:me,setError:Me,setFocus:vt,getFieldState:Ue};return{...Pe,formControl:Pe}}function tr(e={}){const s=D.useRef(void 0),t=D.useRef(void 0),[a,u]=D.useState({isDirty:!1,isValidating:!1,isLoading:Y(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Y(e.defaultValues)?void 0:e.defaultValues});if(!s.current)if(e.formControl)s.current={...e.formControl,formState:a},e.defaultValues&&!Y(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=Wt(e);s.current={...d,formState:a}}const l=s.current.control;return l._options=e,it(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>u({...l._formState}),reRenderRoot:!0});return u(d=>({...d,isReady:!0})),l._formState.isReady=!0,c},[l]),D.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),D.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),D.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),D.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),D.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==a.isDirty&&l._subjects.state.next({isDirty:c})}},[l,a.isDirty]),D.useEffect(()=>{var c;e.values&&!K(e.values,t.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),!((c=l._options.resetOptions)===null||c===void 0)&&c.keepIsValid||l._setValid(),t.current=e.values,u(d=>({...d}))):l._resetDefaultValues()},[l,e.values]),D.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),s.current.formState=St(a,l),s.current}export{Yt as a,Jt as b,Kt as c,Qt as d,Zt as e,Gt as f,Xt as g,zt as h,er as i,tr as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-BCY9aD4r.js";var o="i5n19u0",a="i5n19u1";export{a,o as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as v,a as o,t as n,i as _}from"./index-BCY9aD4r.js";const k=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],f=v("loader-circle",k),y=(b,c)=>{const t=o.c(7),i=!0;let s,a;t[0]!==b?(s=["analytics","costs","total",b],a=async()=>{const l=await(await _.v1.analytics.costs.total.$get({query:b})).json();return"data"in l?l.data:null},t[0]=b,t[1]=s,t[2]=a):(s=t[1],a=t[2]);let e;return t[3]!==i||t[4]!==s||t[5]!==a?(e={queryKey:s,queryFn:a,enabled:i},t[3]=i,t[4]=s,t[5]=a,t[6]=e):e=t[6],n(e)},m=(b,c)=>{const t=o.c(7),i=!0;let s,a;t[0]!==b?(s=["analytics","stats",b],a=async()=>{const l=await(await _.v1.analytics.stats.$get({query:b})).json();return"data"in l?l.data:null},t[0]=b,t[1]=s,t[2]=a):(s=t[1],a=t[2]);let e;return t[3]!==i||t[4]!==s||t[5]!==a?(e={queryKey:s,queryFn:a,enabled:i},t[3]=i,t[4]=s,t[5]=a,t[6]=e):e=t[6],n(e)},w=(b,c)=>{const t=o.c(9);let i;t[0]!==b?(i=b===void 0?{}:b,t[0]=b,t[1]=i):i=t[1];const s=i,a=!0;let e,r;t[2]!==s?(e=["analytics","requests",s],r=async()=>{const g={...s.limit!==void 0&&{limit:String(s.limit)},...s.offset!==void 0&&{offset:String(s.offset)},...s.configId&&{configId:s.configId},...s.provider&&{provider:s.provider},...s.model&&{model:s.model},...s.startDate&&{startDate:s.startDate},...s.endDate&&{endDate:s.endDate}},u=await(await _.v1.analytics.requests.$get({query:g})).json();return"data"in u?u.data:{data:[],total:0,limit:s.limit??100,offset:s.offset??0}},t[2]=s,t[3]=e,t[4]=r):(e=t[3],r=t[4]);let l;return t[5]!==a||t[6]!==e||t[7]!==r?(l={queryKey:e,queryFn:r,enabled:a},t[5]=a,t[6]=e,t[7]=r,t[8]=l):l=t[8],n(l)};var q="_1bstb4i0",j="_1bstb4i2 _1bstb4i1 _1lg22bk9 _1lg22bkpr _1lg22bkuc _1lg22bks0 _1lg22bksi _1lg22bktr",C="_1bstb4i4 _1bstb4i3 _1lg22bkux _1lg22bkw0 _1lg22bkj6",x="_1bstb4i6 _1bstb4i5 _1lg22bkv9 _1lg22bkw0 _1lg22bkjc",S="_1bstb4i8 _1bstb4i7 _1lg22bkux _1lg22bkvx _1lg22bkj6",D="_1bstb4ia _1bstb4i9 _1lg22bkw0 _1lg22bkjc",I="_1bstb4ih _1bstb4ig _1lg22bkf _1lg22bkj3 _1lg22bkw0 _1lg22bkv0",L="_1bstb4ii",$="_1bstb4ix _1bstb4iw _1lg22bkux _1lg22bkw0 _1lg22bk3 _1lg22bkuf",h="_1bstb4iy",T="_1bstb4iz",F="_1bstb4i11 _1bstb4i10 _1lg22bkj3",K="_1bstb4i14 _1bstb4i13 _1lg22bkw0 _1bstb4i12",z="_1bstb4i1n",E="_1bstb4i1o",B="_1bstb4i1q _1bstb4i1p _1lg22bkv0 _1lg22bkw0 _1lg22bk3 _1lg22bkuc",G="_1bstb4i1r",H="_1bstb4i1s",M="_1bstb4i1t",N="_1bstb4i1v _1bstb4i1u _1lg22bkv0 _1lg22bkw0 _1lg22bkj6",P="_1bstb4i1w";export{f as L,h as a,T as b,z as c,D as d,I as e,E as f,B as g,G as h,L as i,N as j,P as k,F as l,y as m,m as n,C as o,M as p,x as q,H as r,$ as s,K as t,w as u,S as v,j as w,q as x};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as oe,q as ce,j as s}from"./index-BCY9aD4r.js";import{m as re,n as me,l as de,L as fe,e as he,o as O,q as z,v as n,w as G,x as ue}from"./observability.css-dztiak5K.js";/* empty css */function be(){const e=oe.c(72);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/(app)/observability"},e[0]=t):t=e[0];const te=ce(t),V=te.from??"",$=te.to??"";let D;e[1]!==V||e[2]!==$?(D={startDate:V,endDate:$},e[1]=V,e[2]=$,e[3]=D):D=e[3];const ae=D,{data:l,isLoading:le}=re(ae),{data:k,isLoading:ne}=me(ae);if(le||ne){let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:de,children:s.jsx(fe,{className:"animate-spin",size:24})}),e[4]=a):a=e[4],a}const ie=Number(l?.requestCount??0);if(!(l&&ie>0)){let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:he,children:[s.jsx("p",{children:"No request data available yet."}),s.jsx("p",{children:"Make some API requests through the gateway to see analytics here."})]}),e[5]=a):a=e[5],a}const w=xe,B=pe;let F;e[6]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("span",{className:O,children:"Total Cost"}),e[6]=F):F=e[6];const H=l?.totalCostFormatted;let i;e[7]!==H?(i=s.jsx("p",{className:z,children:H}),e[7]=H,e[8]=i):i=e[8];const J=l?.totalInputCostFormatted;let o;e[9]!==J?(o=s.jsxs("span",{className:n,children:["Input: ",J]}),e[9]=J,e[10]=o):o=e[10];const K=l?.totalOutputCostFormatted;let c;e[11]!==K?(c=s.jsxs("span",{className:n,children:["Output: ",K]}),e[11]=K,e[12]=c):c=e[12];let r;e[13]!==c||e[14]!==o?(r=s.jsxs("div",{children:[o,c]}),e[13]=c,e[14]=o,e[15]=r):r=e[15];let m;e[16]!==r||e[17]!==i?(m=s.jsxs("div",{className:G,children:[F,i,r]}),e[16]=r,e[17]=i,e[18]=m):m=e[18];let I;e[19]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("span",{className:O,children:"Total Requests"}),e[19]=I):I=e[19];const Q=k?.totalRequests;let d;e[20]!==Q?(d=w(Q),e[20]=Q,e[21]=d):d=e[21];let f;e[22]!==d?(f=s.jsx("p",{className:z,children:d}),e[22]=d,e[23]=f):f=e[23];const U=k?.successRate;let h;e[24]!==U?(h=s.jsxs("span",{className:n,children:[U,"% success rate"]}),e[24]=U,e[25]=h):h=e[25];let u;e[26]!==f||e[27]!==h?(u=s.jsxs("div",{className:G,children:[I,f,h]}),e[26]=f,e[27]=h,e[28]=u):u=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("span",{className:O,children:"Total Tokens"}),e[29]=P):P=e[29];const W=l?.totalTokens;let p;e[30]!==W?(p=w(W),e[30]=W,e[31]=p):p=e[31];let x;e[32]!==p?(x=s.jsx("p",{className:z,children:p}),e[32]=p,e[33]=x):x=e[33];const X=l?.totalPromptTokens;let N;e[34]!==X?(N=w(X),e[34]=X,e[35]=N):N=e[35];let j;e[36]!==N?(j=s.jsxs("span",{className:n,children:["Prompt: ",N]}),e[36]=N,e[37]=j):j=e[37];const Y=l?.totalCompletionTokens;let v;e[38]!==Y?(v=w(Y),e[38]=Y,e[39]=v):v=e[39];let y;e[40]!==v?(y=s.jsxs("span",{className:n,children:["Completion: ",v]}),e[40]=v,e[41]=y):y=e[41];let C;e[42]!==j||e[43]!==y?(C=s.jsxs("div",{children:[j,y]}),e[42]=j,e[43]=y,e[44]=C):C=e[44];let b;e[45]!==x||e[46]!==C?(b=s.jsxs("div",{className:G,children:[P,x,C]}),e[45]=x,e[46]=C,e[47]=b):b=e[47];let A;e[48]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("span",{className:O,children:"Avg Latency"}),e[48]=A):A=e[48];const Z=k?.avgLatencyMs;let _;e[49]!==Z?(_=B(Z),e[49]=Z,e[50]=_):_=e[50];let L;e[51]!==_?(L=s.jsxs("p",{className:z,children:[_,"ms"]}),e[51]=_,e[52]=L):L=e[52];const ee=k?.minLatencyMs;let S;e[53]!==ee?(S=B(ee),e[53]=ee,e[54]=S):S=e[54];let g;e[55]!==S?(g=s.jsxs("span",{className:n,children:["Min: ",S,"ms"]}),e[55]=S,e[56]=g):g=e[56];const se=k?.maxLatencyMs;let q;e[57]!==se?(q=B(se),e[57]=se,e[58]=q):q=e[58];let R;e[59]!==q?(R=s.jsxs("span",{className:n,children:["Max: ",q,"ms"]}),e[59]=q,e[60]=R):R=e[60];let T;e[61]!==g||e[62]!==R?(T=s.jsxs("div",{children:[g,R]}),e[61]=g,e[62]=R,e[63]=T):T=e[63];let M;e[64]!==L||e[65]!==T?(M=s.jsxs("div",{className:G,children:[A,L,T]}),e[64]=L,e[65]=T,e[66]=M):M=e[66];let E;return e[67]!==m||e[68]!==u||e[69]!==b||e[70]!==M?(E=s.jsx("div",{children:s.jsxs("div",{className:ue,children:[m,u,b,M]})}),e[67]=m,e[68]=u,e[69]=b,e[70]=M,e[71]=E):E=e[71],E}function pe(e){if(e==null)return"0";const t=Number(e);return isNaN(t)?"0":Math.round(t).toString()}function xe(e){if(e==null)return"0";const t=Number(e);return isNaN(t)?"0":t.toLocaleString()}export{be as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ax as Vt,r as f,y as le,j as L,ay as jt,az as _t}from"./index-BCY9aD4r.js";import{E as Me,b as me,a as S,u as N,j as nt,C as Wt,D as qt,c as Kt,n as H,k as Ie,l as Bt,o as $t,p as Ce,s as Ht,f as Ut,B as zt,N as Yt}from"./useButton-Ct8hIyjz.js";const Rr=500,Tr=500,Ir={style:{transition:"none"}},Cr="data-base-ui-click-trigger",wr={fallbackAxisSide:"none"},xr={fallbackAxisSide:"end"},Gt={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Xt="none",Ue="trigger-press",Or="trigger-hover",Pr="trigger-focus",Jt="outside-press",Ar="item-press",Nr="close-press",kr="clear-press",Mr="track-press",Dr="input-change",Lr="input-clear",Zt="focus-out",Qt="escape-key",Fr="list-navigation",Vr="keyboard",jr="drag",_r="cancel-open",Wr="sibling-open",qr="disabled",Kr="imperative-action";function z(t,e,n,r){let s=!1,o=!1;const a=r??Me;return{reason:t,event:e??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...a}}function Br(t,e,n){const r=n??Me;return{reason:t,event:e??new Event("base-ui"),...r}}const en={...Vt};let ze=0;function tn(t,e="mui"){const[n,r]=f.useState(t),s=t||n;return f.useEffect(()=>{n==null&&(ze+=1,r(`${e}-${ze}`))},[n,e]),s}const Ye=en.useId;function De(t,e){if(Ye!==void 0){const n=Ye();return t??(e?`${e}-${n}`:n)}return tn(t,e)}function $r(t){return De(t,"base-ui")}const nn=[];function rt(t){f.useEffect(t,nn)}const oe=null;class rn{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const ae=new rn;class D{static create(){return new D}static request(e){return ae.request(e)}static cancel(e){return ae.cancel(e)}currentId=oe;request(e){this.cancel(),this.currentId=ae.request(()=>{this.currentId=oe,e()})}cancel=()=>{this.currentId!==oe&&(ae.cancel(this.currentId),this.currentId=oe)};disposeEffect=()=>this.cancel}function sn(){const t=me(D.create).current;return rt(t.disposeEffect),t}function on(t){return t==null?t:"current"in t?t.current:t}function an(t,e=!1,n=!0){const r=sn();return S((s,o=null)=>{r.cancel();const a=on(t);a!=null&&(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?s():r.request(()=>{function c(){a&&Promise.all(a.getAnimations().map(l=>l.finished)).then(()=>{o!=null&&o.aborted||le.flushSync(s)}).catch(()=>{if(n){if(o!=null&&o.aborted)return;le.flushSync(s)}else a.getAnimations().length>0&&a.getAnimations().some(l=>l.pending||l.playState!=="finished")&&c()})}e?r.request(c):c()}))})}function Hr(t,e=!1,n=!1){const[r,s]=f.useState(t&&e?"idle":void 0),[o,a]=f.useState(t);return t&&!o&&(a(!0),s("starting")),!t&&o&&r!=="ending"&&!n&&s("ending"),!t&&!o&&r==="ending"&&s(void 0),N(()=>{if(!t&&o&&r!=="ending"&&n){const c=D.request(()=>{s("ending")});return()=>{D.cancel(c)}}},[t,o,r,n]),N(()=>{if(!t||e)return;const c=D.request(()=>{s(void 0)});return()=>{D.cancel(c)}},[e,t]),N(()=>{if(!t||!e)return;t&&o&&r!=="idle"&&s("starting");const c=D.request(()=>{s("idle")});return()=>{D.cancel(c)}},[e,t,o,s,r]),f.useMemo(()=>({mounted:o,setMounted:a,transitionStatus:r}),[o,r])}let fe=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const cn={[fe.startingStyle]:""},un={[fe.endingStyle]:""},Ur={transitionStatus(t){return t==="starting"?cn:t==="ending"?un:null}},q=typeof navigator<"u",we=fn(),st=pn(),Le=dn(),zr=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Yr=we.platform==="MacIntel"&&we.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(we.platform),Gr=q&&/firefox/i.test(Le),ln=q&&/apple/i.test(navigator.vendor),Oe=q&&/android/i.test(st)||/android/i.test(Le),Xr=q&&st.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,ot=Le.includes("jsdom/");function fn(){if(!q)return{platform:"",maxTouchPoints:-1};const t=navigator.userAgentData;return t?.platform?{platform:t.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function dn(){if(!q)return"";const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:n})=>`${e}/${n}`).join(" "):navigator.userAgent}function pn(){if(!q)return"";const t=navigator.userAgentData;return t?.platform?t.platform:navigator.platform??""}const Pe="data-base-ui-focusable",at="active",it="selected",hn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Jr="ArrowLeft",Zr="ArrowRight",Qr="ArrowUp",es="ArrowDown";function gn(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function ee(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&Wt(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function U(t){return"composedPath"in t?t.composedPath()[0]:t.target}function A(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function mn(t){return t.matches("html,body")}function Y(t){return t?.ownerDocument||document}function bn(t){return nt(t)&&t.matches(hn)}function ts(t){return t?t.getAttribute("role")==="combobox"&&bn(t):!1}function ns(t){if(!t||ot)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function rs(t){return t?t.hasAttribute(Pe)?t:t.querySelector(`[${Pe}]`)||t:null}function ue(t,e,n=!0){return t.filter(s=>s.parentId===e&&(!n||s.context?.open)).flatMap(s=>[s,...ue(t,s.id,n)])}function ss(t,e){let n=[],r=t.find(s=>s.id===e)?.parentId;for(;r;){const s=t.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function os(t){t.preventDefault(),t.stopPropagation()}function vn(t){return"nativeEvent"in t}function as(t){return t.mozInputSource===0&&t.isTrusted?!0:Oe&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function is(t){return ot?!1:!Oe&&t.width===0&&t.height===0||Oe&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function cs(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function En(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}var yn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],de=yn.join(","),ct=typeof Element>"u",G=ct?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,pe=!ct&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},ne=function(e,n){var r;n===void 0&&(n=!0);var s=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),o=s===""||s==="true",a=o||n&&e&&ne(e.parentNode);return a},Sn=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},ut=function(e,n,r){if(ne(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(de));return n&&G.call(e,de)&&s.unshift(e),s=s.filter(r),s},he=function(e,n,r){for(var s=[],o=Array.from(e);o.length;){var a=o.shift();if(!ne(a,!1))if(a.tagName==="SLOT"){var c=a.assignedElements(),l=c.length?c:a.children,i=he(l,!0,r);r.flatten?s.push.apply(s,i):s.push({scopeParent:a,candidates:i})}else{var p=G.call(a,de);p&&r.filter(a)&&(n||!e.includes(a))&&s.push(a);var g=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),E=!ne(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(g&&E){var b=he(g===!0?a.children:g.children,!0,r);r.flatten?s.push.apply(s,b):s.push({scopeParent:a,candidates:b})}else o.unshift.apply(o,a.children)}}return s},lt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ft=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Sn(e))&&!lt(e)?0:e.tabIndex},Rn=function(e,n){var r=ft(e);return r<0&&n&&!lt(e)?0:r},Tn=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},dt=function(e){return e.tagName==="INPUT"},In=function(e){return dt(e)&&e.type==="hidden"},Cn=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},wn=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},xn=function(e){if(!e.name)return!0;var n=e.form||pe(e),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(e.name));else try{s=r(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var o=wn(s,e.form);return!o||o===e},On=function(e){return dt(e)&&e.type==="radio"},Pn=function(e){return On(e)&&!xn(e)},An=function(e){var n,r=e&&pe(e),s=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==e){var a,c,l;for(o=!!((a=s)!==null&&a!==void 0&&(c=a.ownerDocument)!==null&&c!==void 0&&c.contains(s)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!o&&s;){var i,p,g;r=pe(s),s=(i=r)===null||i===void 0?void 0:i.host,o=!!((p=s)!==null&&p!==void 0&&(g=p.ownerDocument)!==null&&g!==void 0&&g.contains(s))}}return o},Ge=function(e){var n=e.getBoundingClientRect(),r=n.width,s=n.height;return r===0&&s===0},Nn=function(e,n){var r=n.displayCheck,s=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var o=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(e).visibility==="hidden")return!0;var a=G.call(e,"details>summary:first-of-type"),c=a?e.parentElement:e;if(G.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var l=e;e;){var i=e.parentElement,p=pe(e);if(i&&!i.shadowRoot&&s(i)===!0)return Ge(e);e.assignedSlot?e=e.assignedSlot:!i&&p!==e.ownerDocument?e=p.host:e=i}e=l}if(An(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ge(e);return!1},kn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var s=n.children.item(r);if(s.tagName==="LEGEND")return G.call(n,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}n=n.parentElement}return!1},Ae=function(e,n){return!(n.disabled||ne(n)||In(n)||Nn(n,e)||Cn(n)||kn(n))},Ne=function(e,n){return!(Pn(n)||ft(n)<0||!Ae(e,n))},Mn=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},pt=function(e){var n=[],r=[];return e.forEach(function(s,o){var a=!!s.scopeParent,c=a?s.scopeParent:s,l=Rn(c,a),i=a?pt(s.candidates):c;l===0?a?n.push.apply(n,i):n.push(c):r.push({documentOrder:o,tabIndex:l,item:s,isScope:a,content:i})}),r.sort(Tn).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(n)},Fe=function(e,n){n=n||{};var r;return n.getShadowRoot?r=he([e],n.includeContainer,{filter:Ne.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Mn}):r=ut(e,n.includeContainer,Ne.bind(null,n)),pt(r)},us=function(e,n){n=n||{};var r;return n.getShadowRoot?r=he([e],n.includeContainer,{filter:Ae.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=ut(e,n.includeContainer,Ae.bind(null,n)),r},ls=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return G.call(e,de)===!1?!1:Ne(n,e)};const Ve=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ht(t,e){const n=Fe(t,Ve()),r=n.length;if(r===0)return;const s=gn(Y(t)),o=n.indexOf(s),a=o===-1?e===1?0:r-1:o+e;return n[a]}function Dn(t){return ht(Y(t).body,1)||t}function Ln(t){return ht(Y(t).body,-1)||t}function gt(t,e){if(!t)return null;const n=Fe(Y(t).body,Ve()),r=n.length;if(r===0)return null;const s=n.indexOf(t);if(s===-1)return null;const o=(s+e+r)%r;return n[o]}function fs(t){return gt(t,1)}function ds(t){return gt(t,-1)}function xe(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!ee(n,r)}function Fn(t){Fe(t,Ve()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Xe(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Vn(t){const e=me(jn,t).current;return e.next=t,N(e.effect),e}function jn(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}function ps(t){const{enabled:e=!0,open:n,ref:r,onComplete:s}=t,o=Vn(n),a=S(s),c=an(r,n);f.useEffect(()=>{e&&c(()=>{n===o.current&&a()})},[e,n,a,c,o])}function hs(t){return t?.ownerDocument||document}const Z=0;class be{static create(){return new be}currentId=Z;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Z,n()},e)}isStarted(){return this.currentId!==Z}clear=()=>{this.currentId!==Z&&(clearTimeout(this.currentId),this.currentId=Z)};disposeEffect=()=>this.clear}function Je(){const t=me(be.create).current;return rt(t.disposeEffect),t}function mt(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class _n{nodesRef={current:[]};events=mt();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(r=>r===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const bt=f.createContext(null),vt=f.createContext(null),Et=()=>f.useContext(bt)?.id||null,yt=t=>{const e=f.useContext(vt);return t??e};function gs(t){const e=De(),n=yt(t),r=Et();return N(()=>{if(!e)return;const s={id:e,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,e,r]),e}function ms(t){const{children:e,id:n}=t,r=Et();return L.jsx(bt.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:e})}function bs(t){const{children:e,externalTree:n}=t,r=me(()=>n??new _n).current;return L.jsx(vt.Provider,{value:r,children:e})}function St(t){return`data-base-ui-${t}`}const Wn={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Ze=f.forwardRef(function(e,n){const[r,s]=f.useState();N(()=>{ln&&s("button")},[]);const o={tabIndex:0,role:r};return L.jsx("span",{...e,ref:n,style:Wn,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Rt=f.createContext(null),qn=()=>f.useContext(Rt),Kn=St("portal");function Bn(t={}){const{ref:e,container:n,componentProps:r=Me,elementProps:s,elementState:o}=t,a=De(),l=qn()?.portalNode,[i,p]=f.useState(null),[g,E]=f.useState(null),b=f.useRef(null);N(()=>{if(n===null){b.current&&(b.current=null,E(null),p(null));return}if(a==null)return;const k=(n&&(qt(n)?n:n.current))??l??document.body;if(k==null){b.current&&(b.current=null,E(null),p(null));return}b.current!==k&&(b.current=k,E(null),p(k))},[n,l,a]);const y=Kt("div",r,{ref:[e,E],state:o,props:[{id:a,[Kn]:""},s]});return{portalNode:g,portalSubtree:i&&y?le.createPortal(y,i):null}}const vs=f.forwardRef(function(e,n){const{children:r,container:s,className:o,render:a,renderGuards:c,...l}=e,{portalNode:i,portalSubtree:p}=Bn({container:s,ref:n,componentProps:e,elementProps:l}),g=f.useRef(null),E=f.useRef(null),b=f.useRef(null),y=f.useRef(null),[v,k]=f.useState(null),F=v?.modal,x=v?.open,V=typeof c=="boolean"?c:!!v&&!v.modal&&v.open&&!!i;f.useEffect(()=>{if(!i||F)return;function T(P){i&&xe(P)&&(P.type==="focusin"?Xe:Fn)(i)}return i.addEventListener("focusin",T,!0),i.addEventListener("focusout",T,!0),()=>{i.removeEventListener("focusin",T,!0),i.removeEventListener("focusout",T,!0)}},[i,F]),f.useEffect(()=>{!i||x||Xe(i)},[x,i]);const M=f.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:E,beforeInsideRef:b,afterInsideRef:y,portalNode:i,setFocusManagerState:k}),[i]);return L.jsxs(f.Fragment,{children:[p,L.jsxs(Rt.Provider,{value:M,children:[V&&i&&L.jsx(Ze,{"data-type":"outside",ref:g,onFocus:T=>{if(xe(T,i))b.current?.focus();else{const P=v?v.domReference:null;Ln(P)?.focus()}}}),V&&i&&L.jsx("span",{"aria-owns":i.id,style:Gt}),i&&le.createPortal(r,i),V&&i&&L.jsx(Ze,{"data-type":"outside",ref:E,onFocus:T=>{if(xe(T,i))y.current?.focus();else{const P=v?v.domReference:null;Dn(P)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,z(Zt,T.nativeEvent))}}})]})]})}),$n={intentional:"onClick",sloppy:"onPointerDown"};function Hn(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function Es(t,e={}){const n="rootStore"in t?t.rootStore:t,r=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("referenceElement"),a=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:l}=n.context,{enabled:i=!0,escapeKey:p=!0,outsidePress:g=!0,outsidePressEvent:E="sloppy",referencePress:b=!1,referencePressEvent:y="sloppy",ancestorScroll:v=!1,bubbles:k,externalTree:F}=e,x=yt(F),V=S(typeof g=="function"?g:()=>!1),M=typeof g=="function"?V:g,T=f.useRef(!1),{escapeKey:P,outsidePress:X}=Hn(k),I=f.useRef(null),re=Je(),_e=Je(),K=S(()=>{_e.clear(),l.current.insideReactTree=!1}),ve=f.useRef(!1),We=f.useRef(""),Ee=S(u=>{We.current=u.pointerType}),B=S(()=>{const u=We.current,h=u==="pen"||!u?"mouse":u,d=typeof E=="function"?E():E;return typeof d=="string"?d:d[h]}),j=S(u=>{if(!r||!i||!p||u.key!=="Escape"||ve.current)return;const h=l.current.floatingContext?.nodeId,d=x?ue(x.nodesRef.current,h):[];if(!P&&d.length>0){let C=!0;if(d.forEach(R=>{R.context?.open&&!R.context.dataRef.current.__escapeKeyBubbles&&(C=!1)}),!C)return}const O=vn(u)?u.nativeEvent:u,m=z(Qt,O);n.setOpen(!1,m),!P&&!m.isPropagationAllowed&&u.stopPropagation()}),Ct=S(u=>{const h=B();return h==="intentional"&&u.type!=="click"||h==="sloppy"&&u.type==="click"}),_=S(()=>{l.current.insideReactTree=!0,_e.start(0,K)}),J=S((u,h=!1)=>{if(Ct(u)){K();return}if(l.current.insideReactTree){K();return}if(B()==="intentional"&&h||typeof M=="function"&&!M(u))return;const d=U(u),O=`[${St("inert")}]`,m=Y(n.select("floatingElement")).querySelectorAll(O),C=n.context.triggerElements;if(d&&(C.hasElement(d)||C.hasMatchingElement(w=>ee(w,d))))return;let R=H(d)?d:null;for(;R&&!Ie(R);){const w=Bt(R);if(Ie(w)||!H(w))break;R=w}if(m.length&&H(d)&&!mn(d)&&!ee(d,n.select("floatingElement"))&&Array.from(m).every(w=>!ee(R,w)))return;if(nt(d)&&!("touches"in u)){const w=Ie(d),$=$t(d),He=/auto|scroll/,At=w||He.test($.overflowX),Nt=w||He.test($.overflowY),kt=At&&d.clientWidth>0&&d.scrollWidth>d.clientWidth,Mt=Nt&&d.clientHeight>0&&d.scrollHeight>d.clientHeight,Dt=$.direction==="rtl",Lt=Mt&&(Dt?u.offsetX<=d.offsetWidth-d.clientWidth:u.offsetX>d.clientWidth),Ft=kt&&u.offsetY>d.clientHeight;if(Lt||Ft)return}const Be=l.current.floatingContext?.nodeId,Pt=x&&ue(x.nodesRef.current,Be).some(w=>A(u,w.context?.elements.floating));if(A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||Pt)return;const $e=x?ue(x.nodesRef.current,Be):[];if($e.length>0){let w=!0;if($e.forEach($=>{$.context?.open&&!$.context.dataRef.current.__outsidePressBubbles&&(w=!1)}),!w)return}n.setOpen(!1,z(Jt,u)),K()}),qe=S(u=>{B()!=="sloppy"||u.pointerType==="touch"||!n.select("open")||!i||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||J(u)}),wt=S(u=>{if(B()!=="sloppy"||!n.select("open")||!i||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement")))return;const h=u.touches[0];h&&(I.current={startTime:Date.now(),startX:h.clientX,startY:h.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},re.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),ye=S(u=>{const h=U(u);function d(){wt(u),h?.removeEventListener(u.type,d)}h?.addEventListener(u.type,d)}),W=S(u=>{const h=T.current;if(T.current=!1,re.clear(),u.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const d=U(u);function O(){u.type==="pointerdown"?qe(u):J(u,h),d?.removeEventListener(u.type,O)}d?.addEventListener(u.type,O)}),xt=S(u=>{if(B()!=="sloppy"||!I.current||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement")))return;const h=u.touches[0];if(!h)return;const d=Math.abs(h.clientX-I.current.startX),O=Math.abs(h.clientY-I.current.startY),m=Math.sqrt(d*d+O*O);m>5&&(I.current.dismissOnTouchEnd=!0),m>10&&(J(u),re.clear(),I.current=null)}),Se=S(u=>{const h=U(u);function d(){xt(u),h?.removeEventListener(u.type,d)}h?.addEventListener(u.type,d)}),Ot=S(u=>{B()!=="sloppy"||!I.current||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&J(u),re.clear(),I.current=null)}),Re=S(u=>{const h=U(u);function d(){Ot(u),h?.removeEventListener(u.type,d)}h?.addEventListener(u.type,d)});f.useEffect(()=>{if(!r||!i)return;l.current.__escapeKeyBubbles=P,l.current.__outsidePressBubbles=X;const u=new be;function h(R){n.setOpen(!1,z(Xt,R))}function d(){u.clear(),ve.current=!0}function O(){u.start(Ht()?5:0,()=>{ve.current=!1})}const m=Y(s);m.addEventListener("pointerdown",Ee,!0),p&&(m.addEventListener("keydown",j),m.addEventListener("compositionstart",d),m.addEventListener("compositionend",O)),M&&(m.addEventListener("click",W,!0),m.addEventListener("pointerdown",W,!0),m.addEventListener("touchstart",ye,!0),m.addEventListener("touchmove",Se,!0),m.addEventListener("touchend",Re,!0),m.addEventListener("mousedown",W,!0));let C=[];return v&&(H(a)&&(C=Ce(a)),H(s)&&(C=C.concat(Ce(s))),!H(o)&&o&&o.contextElement&&(C=C.concat(Ce(o.contextElement)))),C=C.filter(R=>R!==m.defaultView?.visualViewport),C.forEach(R=>{R.addEventListener("scroll",h,{passive:!0})}),()=>{m.removeEventListener("pointerdown",Ee,!0),p&&(m.removeEventListener("keydown",j),m.removeEventListener("compositionstart",d),m.removeEventListener("compositionend",O)),M&&(m.removeEventListener("click",W,!0),m.removeEventListener("pointerdown",W,!0),m.removeEventListener("touchstart",ye,!0),m.removeEventListener("touchmove",Se,!0),m.removeEventListener("touchend",Re,!0),m.removeEventListener("mousedown",W,!0)),C.forEach(R=>{R.removeEventListener("scroll",h)}),u.clear()}},[l,s,o,a,p,M,r,c,v,i,P,X,j,J,W,qe,ye,Se,Re,Ee,n]),f.useEffect(K,[M,K]);const Te=f.useMemo(()=>({onKeyDown:j,...b&&{[$n[y]]:u=>{n.setOpen(!1,z(Ue,u.nativeEvent))},...y!=="intentional"&&{onClick(u){n.setOpen(!1,z(Ue,u.nativeEvent))}}}}),[j,n,b,y]),se=S(u=>{const h=U(u.nativeEvent);!ee(n.select("floatingElement"),h)||u.button!==0||(T.current=!0)}),Ke=f.useMemo(()=>({onKeyDown:j,onPointerDown:se,onMouseDown:se,onMouseUp:se,onClickCapture:_,onMouseDownCapture:_,onPointerDownCapture:_,onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[j,se,_]);return f.useMemo(()=>i?{reference:Te,floating:Ke,trigger:Te}:{},[i,Te,Ke])}var ge=Symbol("NOT_FOUND");function Un(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function zn(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function Yn(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(n=>typeof n=="function")){const n=t.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${e}[${n}]`)}}var Qe=t=>Array.isArray(t)?t:[t];function Gn(t){const e=Array.isArray(t[0])?t[0]:t;return Yn(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function Xn(t,e){const n=[],{length:r}=t;for(let s=0;s<r;s++)n.push(t[s].apply(null,e));return n}function Jn(t){let e;return{get(n){return e&&t(e.key,n)?e.value:ge},put(n,r){e={key:n,value:r}},getEntries(){return e?[e]:[]},clear(){e=void 0}}}function Zn(t,e){let n=[];function r(c){const l=n.findIndex(i=>e(c,i.key));if(l>-1){const i=n[l];return l>0&&(n.splice(l,1),n.unshift(i)),i.value}return ge}function s(c,l){r(c)===ge&&(n.unshift({key:c,value:l}),n.length>t&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:s,getEntries:o,clear:a}}var Qn=(t,e)=>t===e;function er(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:s}=n;for(let o=0;o<s;o++)if(!t(n[o],r[o]))return!1;return!0}}function tr(t,e){const n=typeof e=="object"?e:{equalityCheck:e},{equalityCheck:r=Qn,maxSize:s=1,resultEqualityCheck:o}=n,a=er(r);let c=0;const l=s<=1?Jn(a):Zn(s,a);function i(){let p=l.get(arguments);if(p===ge){if(p=t.apply(null,arguments),c++,o){const E=l.getEntries().find(b=>o(b.value,p));E&&(p=E.value,c!==0&&c--)}l.put(arguments,p)}return p}return i.clearCache=()=>{l.clear(),i.resetResultsCount()},i.resultsCount=()=>c,i.resetResultsCount=()=>{c=0},i}var nr=class{constructor(t){this.value=t}deref(){return this.value}},rr=typeof WeakRef<"u"?WeakRef:nr,sr=0,et=1;function ie(){return{s:sr,v:void 0,o:null,p:null}}function Tt(t,e={}){let n=ie();const{resultEqualityCheck:r}=e;let s,o=0;function a(){let c=n;const{length:l}=arguments;for(let g=0,E=l;g<E;g++){const b=arguments[g];if(typeof b=="function"||typeof b=="object"&&b!==null){let y=c.o;y===null&&(c.o=y=new WeakMap);const v=y.get(b);v===void 0?(c=ie(),y.set(b,c)):c=v}else{let y=c.p;y===null&&(c.p=y=new Map);const v=y.get(b);v===void 0?(c=ie(),y.set(b,c)):c=v}}const i=c;let p;if(c.s===et)p=c.v;else if(p=t.apply(null,arguments),o++,r){const g=s?.deref?.()??s;g!=null&&r(g,p)&&(p=g,o!==0&&o--),s=typeof p=="object"&&p!==null||typeof p=="function"?new rr(p):p}return i.s=et,i.v=p,p}return a.clearCache=()=>{n=ie(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function It(t,...e){const n=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,r=(...s)=>{let o=0,a=0,c,l={},i=s.pop();typeof i=="object"&&(l=i,i=s.pop()),Un(i,`createSelector expects an output function after the inputs, but received: [${typeof i}]`);const p={...n,...l},{memoize:g,memoizeOptions:E=[],argsMemoize:b=Tt,argsMemoizeOptions:y=[]}=p,v=Qe(E),k=Qe(y),F=Gn(s),x=g(function(){return o++,i.apply(null,arguments)},...v),V=b(function(){a++;const T=Xn(F,arguments);return c=x.apply(null,T),c},...k);return Object.assign(V,{resultFunc:i,memoizedResultFunc:x,dependencies:F,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:g,argsMemoize:b})};return Object.assign(r,{withTypes:()=>r}),r}var or=It(Tt),ar=Object.assign((t,e=or)=>{zn(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const n=Object.keys(t),r=n.map(o=>t[o]);return e(r,(...o)=>o.reduce((a,c,l)=>(a[n[l]]=c,a),{}))},{withTypes:()=>ar});It({memoize:tr,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Q=(t,e,n,r,s,o,...a)=>{if(a.length>0)throw new Error(Ut(1));let c;if(t)c=t;else throw new Error("Missing arguments");return c};var ir=jt();const cr=zt(19),ur=cr?fr:dr;function lr(t,e,n,r,s){return ur(t,e,n,r,s)}function fr(t,e,n,r,s){const o=f.useCallback(()=>e(t.getSnapshot(),n,r,s),[t,e,n,r,s]);return ir.useSyncExternalStore(t.subscribe,o,o)}function dr(t,e,n,r,s){return _t.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,o=>e(o,n,r,s))}class te{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){te.prototype.setState.call(this,{...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||te.prototype.setState.call(this,{...this.state,[e]:n})}notifyAll(){const e={...this.state};te.prototype.setState.call(this,e)}}class pr extends te{constructor(e,n={},r){super(e),this.context=n,this.selectors=r}controlledValues=new Map;useSyncedValue(e,n){f.useDebugValue(e),N(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}useSyncedValueWithCleanup(e,n){N(()=>(this.state[e]!==n&&this.set(e,n),()=>{this.set(e,void 0)}),[e,n])}useSyncedValues(e){const n=Object.values(e);N(()=>{this.update(e)},n)}useControlledProp(e,n,r){f.useDebugValue(e);const s=n!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,s),!s&&!Object.is(this.state[e],r)&&super.setState({...this.state,[e]:r})),N(()=>{s&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})},[e,n,r,s])}set(e,n){this.controlledValues.get(e)!==!0&&super.set(e,n)}update(e){const n={...e};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.update(n)}setState(e){const n={...e};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.setState({...this.state,...n})}select=(e,n,r,s)=>{const o=this.selectors[e];return o(this.state,n,r,s)};useState=(e,n,r,s)=>{f.useDebugValue(e);const o=this.selectors[e];return lr(this,o,n,r,s)};useContextCallback(e,n){f.useDebugValue(e);const r=S(n??Yt);this.context[e]=r}useStateSetter(e){const n=f.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(e,r)}),n.current}observe(e,n){let r;typeof e=="function"?r=e:r=this.selectors[e];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const a=r(o);if(!Object.is(s,a)){const c=s;s=a,n(a,c,this)}})}}const hr={open:Q(t=>t.open),domReferenceElement:Q(t=>t.domReferenceElement),referenceElement:Q(t=>t.positionReference??t.referenceElement),floatingElement:Q(t=>t.floatingElement),floatingId:Q(t=>t.floatingId)};class ys extends pr{constructor(e){const{nested:n,noEmit:r,onOpenChange:s,triggerElements:o,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:mt(),nested:n,noEmit:r,triggerElements:o},hr)}setOpen=(e,n)=>{if((!e||!this.state.open||En(n.event))&&(this.context.dataRef.current.openEvent=e?n.event:void 0),!this.context.noEmit){const r={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(e,n)}}class Ss{constructor(){this.elements=new Set,this.idMap=new Map}add(e,n){const r=this.idMap.get(e);r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(e,n))}delete(e){const n=this.idMap.get(e);n&&(this.elements.delete(n),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(const n of this.elements)if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Rs(t=[]){const e=t.map(i=>i?.reference),n=t.map(i=>i?.floating),r=t.map(i=>i?.item),s=t.map(i=>i?.trigger),o=f.useCallback(i=>ce(i,t,"reference"),e),a=f.useCallback(i=>ce(i,t,"floating"),n),c=f.useCallback(i=>ce(i,t,"item"),r),l=f.useCallback(i=>ce(i,t,"trigger"),s);return f.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:c,getTriggerProps:l}),[o,a,c,l])}function ce(t,e,n){const r=new Map,s=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[Pe]="");for(const a in t)s&&t&&(a===at||a===it)||(o[a]=t[a]);for(let a=0;a<e.length;a+=1){let c;const l=e[a]?.[n];typeof l=="function"?c=t?l(t):null:c=l,c&&tt(o,c,s,r)}return tt(o,t,s,r),o}function tt(t,e,n,r){for(const s in e){const o=e[s];n&&(s===at||s===it)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof o=="function"&&(r.get(s)?.push(o),t[s]=(...a)=>r.get(s)?.map(c=>c(...a)).find(c=>c!==void 0))):t[s]=o)}}let je=(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=fe.startingStyle]="startingStyle",t[t.endingStyle=fe.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t})({}),ke=(function(t){return t.popupOpen="data-popup-open",t.pressed="data-pressed",t})({});const gr={[ke.popupOpen]:""},mr={[ke.popupOpen]:"",[ke.pressed]:""},br={[je.open]:""},vr={[je.closed]:""},Er={[je.anchorHidden]:""},Ts={open(t){return t?gr:null}},Is={open(t){return t?mr:null}},Cs={open(t){return t?br:vr},anchorHidden(t){return t?Er:null}};export{Tr as $,Jt as A,ms as B,je as C,wr as D,Wr as E,vs as F,_n as G,gs as H,Et as I,De as J,Zt as K,Fr as L,sn as M,bs as N,Rr as O,Ss as P,hs as Q,pr as R,yt as S,be as T,_r as U,ds as V,xe as W,fs as X,Dn as Y,Is as Z,Ze as _,ee as a,Vn as a0,gn as a1,Vr as a2,Dr as a3,jr as a4,Mr as a5,rt as a6,Wn as a7,an as a8,St as a9,zr as aA,D as aB,qn as aC,Fe as aD,Ve as aE,ss as aF,on as aG,Ln as aH,ls as aI,us as aJ,En as aK,bn as aa,ns as ab,Y as ac,Xr as ad,ln as ae,hn as af,ue as ag,rs as ah,Hr as ai,ys as aj,Qr as ak,os as al,es as am,Jr as an,Zr as ao,ts as ap,as as aq,is as ar,te as as,lr as at,Lr as au,Gr as av,Oe as aw,kr as ax,Ir as ay,Yr as az,Bn as b,z as c,Q as d,Pr as e,Ue as f,U as g,Qt as h,cs as i,qr as j,Es as k,Rs as l,Kr as m,Xt as n,$r as o,Ts as p,xr as q,Cs as r,ps as s,Or as t,Je as u,Ur as v,Nr as w,Cr as x,Br as y,Ar as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as R,r as C,q as J,j as o,e as K,I as Y}from"./index-BCY9aD4r.js";import{u as U,t as x,s as ee,a as te,b as ne,l as re,L as ae,e as se,r as oe,c as ie,d as ce,f as ue,g as de,h as le,i as fe,p as he,j as v,k as me}from"./observability.css-dztiak5K.js";import{u as ge}from"./useConfigList-Du__Gu7q.js";import{c as we,u as pe,d as xe,f as S}from"./index-DvzXLQL6.js";import{B as j}from"./button-DftzA6-1.js";import{T as ye,a as be,b as E,c as Oe,d as ke,e as Me}from"./table-xLf4iXV8.js";import{P as Te,a as Pe,b as Ce}from"./popover-CSR0ctop.js";import{a as N,t as g,c as k,n as De,g as q,d as Ne,f as G,e as Ye}from"./en-US-C8ut0f5H.js";import{C as je}from"./check-PaWYhFn6.js";import{C as ve}from"./chevron-right-Dz77YeP_.js";/* empty css */import"./useButton-Ct8hIyjz.js";import"./InternalBackdrop-CXjGP6a9.js";import"./popupStateMapping-DkOpwBhG.js";import"./useSyncedFloatingRootContext-BzuhbdSw.js";import"./useRole-DP91D1OX.js";import"./usePopupAutoResize-ddPHogUJ.js";import"./getDisabledMountTransitionStyles-CKUvhO4q.js";const Se=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ee=R("chevron-left",Se);const qe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],We=R("columns-3",qe);function P(t,e){const n=N(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=g(t,e?.in),s=a.getDay(),u=(s<r?7:0)+s-r;return a.setDate(a.getDate()-u),a.setHours(0,0,0,0),a}function D(t,e){return P(t,{...e,weekStartsOn:1})}function _(t,e){const n=g(t,e?.in),r=n.getFullYear(),a=k(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=D(a),u=k(n,0);u.setFullYear(r,0,4),u.setHours(0,0,0,0);const h=D(u);return n.getTime()>=s.getTime()?r+1:n.getTime()>=h.getTime()?r:r-1}function W(t,e){const n=g(t,e?.in);return n.setHours(0,0,0,0),n}function He(t,e,n){const[r,a]=De(n?.in,t,e),s=W(r),u=W(a),h=+s-q(s),m=+u-q(u);return Math.round((h-m)/Ne)}function Le(t,e){const n=_(t,e),r=k(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),D(r)}function Fe(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Ie(t){return!(!Fe(t)&&typeof t!="number"||isNaN(+g(t)))}function Re(t,e){const n=g(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ge(t,e){const n=g(t,e?.in);return He(n,Re(n))+1}function _e(t,e){const n=g(t,e?.in),r=+D(n)-+Le(n);return Math.round(r/G)+1}function B(t,e){const n=g(t,e?.in),r=n.getFullYear(),a=N(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,u=k(e?.in||t,0);u.setFullYear(r+1,0,s),u.setHours(0,0,0,0);const h=P(u,e),m=k(e?.in||t,0);m.setFullYear(r,0,s),m.setHours(0,0,0,0);const M=P(m,e);return+n>=+h?r+1:+n>=+M?r:r-1}function Be(t,e){const n=N(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=B(t,e),s=k(e?.in||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),P(s,e)}function Ve(t,e){const n=g(t,e?.in),r=+P(n,e)-+Be(n,e);return Math.round(r/G)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const w={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},O={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},H={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return w.y(t,e)},Y:function(t,e,n,r){const a=B(t,r),s=a>0?a:1-a;if(e==="YY"){const u=s%100;return c(u,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):c(s,e.length)},R:function(t,e){const n=_(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return w.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ve(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=_e(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):w.d(t,e)},D:function(t,e,n){const r=Ge(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return c(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return c(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=O.noon:r===0?a=O.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=O.evening:r>=12?a=O.afternoon:r>=4?a=O.morning:a=O.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return w.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):w.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):w.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):w.s(t,e)},S:function(t,e){return w.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return F(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return F(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+L(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+L(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return c(r,e.length)},T:function(t,e,n){return c(+t,e.length)}};function L(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+e+c(s,2)}function F(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),s=c(r%60,2);return n+a+e+s}const I=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},V=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Qe=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return I(t,e);let s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",I(r,e)).replace("{{time}}",V(a,e))},Xe={p:V,P:Qe},$e=/^D+$/,ze=/^Y+$/,Ae=["D","DD","YY","YYYY"];function Ze(t){return $e.test(t)}function Je(t){return ze.test(t)}function Ke(t,e,n){const r=Ue(t,e,n);if(console.warn(r),Ae.includes(t))throw new RangeError(r)}function Ue(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const et=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nt=/^'([^]*?)'?$/,rt=/''/g,at=/[a-zA-Z]/;function st(t,e,n){const r=N(),a=r.locale??Ye,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,u=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,h=g(t,n?.in);if(!Ie(h))throw new RangeError("Invalid time value");let m=e.match(tt).map(l=>{const d=l[0];if(d==="p"||d==="P"){const T=Xe[d];return T(l,a.formatLong)}return l}).join("").match(et).map(l=>{if(l==="''")return{isToken:!1,value:"'"};const d=l[0];if(d==="'")return{isToken:!1,value:ot(l)};if(H[d])return{isToken:!0,value:l};if(d.match(at))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:l}});a.localize.preprocessor&&(m=a.localize.preprocessor(h,m));const M={firstWeekContainsDate:s,weekStartsOn:u,locale:a};return m.map(l=>{if(!l.isToken)return l.value;const d=l.value;(Je(d)||Ze(d))&&Ke(d,e,String(t));const T=H[d[0]];return T(h,d,a.localize,M)}).join("")}function ot(t){const e=t.match(nt);return e?e[1].replace(rt,"'"):t}const p=we(),y=10,it=t=>{const e=t/1e6;return e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`};function Ct(){const[t,e]=C.useState(0),n=J({from:"/(app)/observability"}),[r,a]=C.useState({provider:!1}),{data:s,isLoading:u}=U({limit:y,offset:t,startDate:n.from,endDate:n.to}),{data:h}=ge(),m=C.useMemo(()=>h?new Map(h.map(i=>[i.id,i.name])):new Map,[h]),M=C.useMemo(()=>[p.accessor("createdAt",{id:"timestamp",header:"Timestamp",cell:i=>o.jsx("span",{className:x,children:st(new Date(i.getValue()),"yyyy-MM-dd HH:mm:ss")})}),p.accessor("configId",{id:"config",header:"Config",cell:i=>{const f=i.getValue(),Z=f?m.get(f):null;return o.jsx("span",{className:x,children:Z??"—"})}}),p.accessor("provider",{header:"Provider",cell:i=>o.jsx("span",{className:x,children:i.getValue()})}),p.accessor("model",{header:"Model",cell:i=>o.jsx("span",{className:x,children:i.getValue()})}),p.accessor("statusCode",{id:"status",header:"Status",cell:i=>{const f=i.getValue();return o.jsx("span",{className:K(ee,f>=200&&f<300?te:ne),children:f})}}),p.display({id:"tokens",header:"Tokens (In → Out)",cell:i=>o.jsxs("span",{className:x,children:[i.row.original.promptTokens.toLocaleString()," →"," ",i.row.original.completionTokens.toLocaleString()]})}),p.accessor("cost",{header:"Cost",cell:i=>o.jsx("span",{className:x,children:it(i.getValue())})}),p.accessor("latencyMs",{id:"latency",header:"Latency",cell:i=>o.jsxs("span",{className:x,children:[i.getValue(),"ms"]})})],[m]),l=pe({data:s?.data||[],columns:M,state:{columnVisibility:r},onColumnVisibilityChange:a,getCoreRowModel:xe()}),d=s?.total??0,T=Math.floor(t/y)+1,Q=Math.ceil(d/y),X=t>0,$=t+y<d,z=()=>{e(Math.max(0,t-y))},A=()=>{e(t+y)};return u?o.jsx("div",{className:re,children:o.jsx(ae,{className:"animate-spin",size:24})}):!s?.data||s.data.length===0?o.jsxs("div",{className:se,children:[o.jsx("p",{children:"No requests found in the selected time range."}),o.jsx("p",{children:"Make some API requests through the gateway to see them here."})]}):o.jsxs("div",{className:oe,children:[o.jsxs("div",{className:ie,children:[o.jsx("h3",{className:ce,children:"Request Logs"}),o.jsxs(Te,{children:[o.jsx(Pe,{asChild:!0,children:o.jsxs(j,{variant:"outline",size:"sm",scheme:"gray",children:[o.jsx(Y,{icon:We,size:"sm"}),"Columns"]})}),o.jsx(Ce,{align:"end",sideOffset:4,children:o.jsx("div",{className:ue,children:l.getAllLeafColumns().map(i=>o.jsxs("label",{className:de,children:[o.jsx("span",{className:le,"data-checked":i.getIsVisible(),children:i.getIsVisible()&&o.jsx(je,{size:12})}),typeof i.columnDef.header=="string"?i.columnDef.header:i.id,o.jsx("input",{type:"checkbox",checked:i.getIsVisible(),onChange:i.getToggleVisibilityHandler(),style:{display:"none"}})]},i.id))})})]})]}),o.jsx("div",{className:fe,children:o.jsxs(ye,{children:[o.jsx(be,{children:l.getHeaderGroups().map(i=>o.jsx(E,{children:i.headers.map(f=>o.jsx(Oe,{children:f.isPlaceholder?null:S(f.column.columnDef.header,f.getContext())},f.id))},i.id))}),o.jsx(ke,{children:l.getRowModel().rows.map(i=>o.jsx(E,{children:i.getVisibleCells().map(f=>o.jsx(Me,{children:S(f.column.columnDef.cell,f.getContext())},f.id))},i.id))})]})}),o.jsxs("div",{className:he,children:[o.jsxs("span",{className:v,children:["Showing ",t+1,"–",Math.min(t+y,d)," of"," ",d.toLocaleString()," requests"]}),o.jsxs("div",{className:me,children:[o.jsxs(j,{variant:"outline",size:"sm",scheme:"gray",onClick:z,disabled:!X,children:[o.jsx(Y,{icon:Ee,size:"sm"}),"Previous"]}),o.jsxs("span",{className:v,children:["Page ",T," of ",Q]}),o.jsxs(j,{variant:"outline",size:"sm",scheme:"gray",onClick:A,disabled:!$,children:["Next",o.jsx(Y,{icon:ve,size:"sm"})]})]})]})]})}export{Ct as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v,g as j,i as N,W as y,d as _,r as C,j as s}from"./index-BCY9aD4r.js";import{u as S}from"./useMutation-VUB-GXkv.js";import{q as I}from"./useConfigList-Du__Gu7q.js";import{D as T,b as F,d as R,e as k,f as b,F as w,A,a as B,c as P}from"./Form-B1rZ0Hvr.js";/* empty css */import"./useButton-Ct8hIyjz.js";import"./InternalBackdrop-CXjGP6a9.js";import"./popupStateMapping-DkOpwBhG.js";import"./useSyncedFloatingRootContext-BzuhbdSw.js";import"./useRole-DP91D1OX.js";import"./useValueChanged-vz8uKgCk.js";const q=()=>{const e=v.c(2),t=j();let a;return e[0]!==t?(a={mutationFn:E,onSuccess:()=>{t.invalidateQueries({queryKey:I})}},e[0]=t,e[1]=a):a=e[1],S(a)};async function E(e){const a=await(await N.v1.configs[":id"].$delete({param:{id:e}})).json();return"data"in a?a.data:void 0}var $="b432xx0",M="b432xx1",Q="b432xx2",Z="b432xx3",K="b432xx4",O="b432xx5",W="b432xx6",z="b432xx7",G="b432xx8",H="b432xx9",J="b432xxa",L="b432xxb",U="b432xxc",V="b432xxd",X="b432xxe",Y="b432xxf",ee="b432xxg";function ge(){const e=v.c(15),{id:t}=y.useParams(),a=_(),f=q(),[n,h]=C.useState(!1);let i;e[0]!==t||e[1]!==f||e[2]!==a?(i=async()=>{h(!0);try{await f.mutateAsync(t),a({to:"/configs"})}catch(D){console.error("Failed to delete config:",D),h(!1)}},e[0]=t,e[1]=f,e[2]=a,e[3]=i):i=e[3];const p=i;let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("h3",{className:Z,children:"Danger Zone"}),e[4]=o):o=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:W,children:[s.jsx("span",{className:z,children:"Delete this config"}),s.jsx("span",{className:G,children:"Once you delete a config, there is no going back. Please be certain."})]}),e[5]=r):r=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(T,{className:H,children:"Delete Config"}),e[6]=l):l=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{className:J}),e[7]=c):c=e[7];let m,d;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(R,{className:U,children:"Delete config?"}),d=s.jsx(k,{className:V,children:"This action cannot be undone. This will permanently delete the config and all associated variants and targeting rules."}),e[8]=m,e[9]=d):(m=e[8],d=e[9]);let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(b,{className:Y,children:"Cancel"}),e[10]=x):x=e[10];const u=n?"Deleting...":"Delete";let g;return e[11]!==p||e[12]!==n||e[13]!==u?(g=s.jsx("div",{className:$,children:s.jsx(w,{className:M,children:s.jsxs("div",{className:Q,children:[o,s.jsx("div",{className:K,children:s.jsxs("div",{className:O,children:[r,s.jsxs(A,{children:[l,s.jsxs(B,{children:[c,s.jsxs(P,{className:L,children:[m,d,s.jsxs("div",{className:X,children:[x,s.jsx(b,{className:ee,onClick:p,disabled:n,children:u})]})]})]})]})]})})]})})}),e[11]=p,e[12]=n,e[13]=u,e[14]=g):g=e[14],g}export{ge as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g,g as j,i as D,x as f,k,d as w,r as N,j as t}from"./index-BCY9aD4r.js";import{u as y}from"./useMutation-VUB-GXkv.js";import{g as b}from"./useEnvironments-CYkrqAdO.js";import{T}from"./tooltip-BKoDpdAC.js";import{F as E,A as I,D as C,a as P,b as S,c as B,d as F,e as R,f as p}from"./Form-B1rZ0Hvr.js";/* empty css */import"./useButton-Ct8hIyjz.js";import"./popupStateMapping-DkOpwBhG.js";import"./usePopupAutoResize-ddPHogUJ.js";import"./getDisabledMountTransitionStyles-CKUvhO4q.js";import"./useSyncedFloatingRootContext-BzuhbdSw.js";import"./useFocus-Du1aH2j1.js";import"./InternalBackdrop-CXjGP6a9.js";import"./useRole-DP91D1OX.js";import"./useValueChanged-vz8uKgCk.js";const _=()=>{const e=g.c(2),n=j();let s;return e[0]!==n?(s={mutationFn:A,onSuccess:()=>{n.invalidateQueries({queryKey:b()})}},e[0]=n,e[1]=s):s=e[1],y(s)};async function A(e){const s=await(await D.v1.environments[":id"].$delete({param:{id:e}})).json();return"data"in s?s.data:void 0}var Q="xvtkwc0",$="xvtkwc1",q="xvtkwc2",K="xvtkwc3",M="xvtkwc4",Z="xvtkwc5",O="xvtkwc6",Y="xvtkwc7",z="xvtkwc8",u="xvtkwc9",G="xvtkwca",H="xvtkwcb",J="xvtkwcc",L="xvtkwcd",U="xvtkwce",V="xvtkwcf",W="xvtkwcg";function ue(){const e=g.c(11),{environment:n}=f.useParams(),{data:s}=k(n),m=w(),d=_(),[r,x]=N.useState(!1),a=s?.isProd??!1;let i;e[0]!==d||e[1]!==n||e[2]!==a||e[3]!==m?(i=async()=>{if(!a){x(!0);try{await d.mutateAsync(n),m({to:"/environments"})}catch(h){console.error("Failed to delete environment:",h),x(!1)}}},e[0]=d,e[1]=n,e[2]=a,e[3]=m,e[4]=i):i=e[4];const v=i;let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("h3",{className:K,children:"Danger Zone"}),e[5]=o):o=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsxs("div",{className:O,children:[t.jsx("span",{className:Y,children:"Delete this environment"}),t.jsx("span",{className:z,children:"Once you delete an environment, there is no going back. Please be certain."})]}),e[6]=c):c=e[6];let l;return e[7]!==v||e[8]!==r||e[9]!==a?(l=t.jsx("div",{className:Q,children:t.jsx(E,{className:$,children:t.jsxs("div",{className:q,children:[o,t.jsx("div",{className:M,children:t.jsxs("div",{className:Z,children:[c,a?t.jsx(T,{content:"You can't delete the Production environment.",children:t.jsx("span",{children:t.jsx("button",{className:u,disabled:!0,children:"Delete Environment"})})}):t.jsxs(I,{children:[t.jsx(C,{className:u,children:"Delete Environment"}),t.jsxs(P,{children:[t.jsx(S,{className:G}),t.jsxs(B,{className:H,children:[t.jsx(F,{className:J,children:"Delete environment?"}),t.jsx(R,{className:L,children:"This action cannot be undone. This will permanently delete the environment and all associated secrets."}),t.jsxs("div",{className:U,children:[t.jsx(p,{className:V,children:"Cancel"}),t.jsx(p,{className:W,onClick:v,disabled:r,children:r?"Deleting...":"Delete"})]})]})]})]})]})})]})})}),e[7]=v,e[8]=r,e[9]=a,e[10]=l):l=e[10],l}export{ue as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,ax as te}from"./index-BCY9aD4r.js";const T={};function v(e,t){const n=a.useRef(T);return n.current===T&&(n.current=e(t)),n}const C=te[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ne=C&&C!==a.useLayoutEffect?C:e=>e();function O(e){const t=v(oe).current;return t.next=e,ne(t.effect),t.trampoline}function oe(){const e={next:void 0,callback:re,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function re(){}const se=()=>{},ce=typeof document<"u"?a.useLayoutEffect:se;function B(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}function A(e,t,n,r){const o=v(U).current;return ue(o,e,t,n,r)&&j(o,[e,t,n,r]),o.callback}function ie(e){const t=v(U).current;return ae(t,e)&&j(t,e),t.callback}function U(){return{callback:null,cleanup:null,refs:[]}}function ue(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function ae(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function j(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(r[o]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=r[o];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const le=parseInt(a.version,10);function fe(e){return le>=e}function L(e){if(!a.isValidElement(e))return null;const t=e,n=t.props;return(fe(19)?n?.ref:t.ref)??null}function k(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function de(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function pe(e,t){return typeof e=="function"?e(t):e}function be(e,t){return typeof e=="function"?e(t):e}const w={};function K(e,t,n,r,o){let s={...N(e,w)};return t&&(s=h(s,t)),n&&(s=h(s,n)),r&&(s=h(s,r)),s}function me(e){if(e.length===0)return w;if(e.length===1)return N(e[0],w);let t={...N(e[0],w)};for(let n=1;n<e.length;n+=1)t=h(t,e[n]);return t}function h(e,t){return V(t)?t(e):ye(e,t)}function ye(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=k(e.style,r);break}case"className":{e[n]=W(e.className,r);break}default:we(n,r)?e[n]=Ee(e[n],r):e[n]=r}}return e}function we(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function V(e){return typeof e=="function"}function N(e,t){return V(e)?e(t):e??w}function Ee(e,t){return t?e?n=>{if(he(n)){const o=n;D(o);const s=t(o);return o.baseUIHandlerPrevented||e?.(o),s}const r=t(n);return e?.(n),r}:t:e}function D(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function W(e,t){return t?e?t+" "+e:t:e}function he(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function We(){}const Fe=Object.freeze([]),m=Object.freeze({});function $e(e,t,n={}){const r=t.render,o=ge(t,n);if(n.enabled===!1)return null;const s=n.state??m;return Ce(e,r,o,s)}function ge(e,t={}){const{className:n,style:r,render:o}=e,{state:s=m,ref:i,props:f,stateAttributesMapping:p,enabled:u=!0}=t,b=u?pe(n,s):void 0,E=u?be(r,s):void 0,d=u?de(s,p):m,l=u?k(d,Array.isArray(f)?me(f):f)??m:m;return typeof document<"u"&&(u?Array.isArray(i)?l.ref=ie([l.ref,L(o),...i]):l.ref=A(l.ref,L(o),i):A(null,null)),u?(b!==void 0&&(l.className=W(l.className,b)),E!==void 0&&(l.style=k(l.style,E)),l):m}function Ce(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=K(n,t.props);return o.ref=n.ref,a.cloneElement(t,o)}if(e&&typeof e=="string")return ke(e,n);throw new Error(B(8))}function ke(e,t){return e==="button"?a.createElement("button",{type:"button",...t,key:t.key}):e==="img"?a.createElement("img",{alt:"",...t,key:t.key}):a.createElement(e,t)}function g(){return typeof window<"u"}function P(e){return F(e)?(e.nodeName||"").toLowerCase():"#document"}function y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ne(e){var t;return(t=(F(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function F(e){return g()?e instanceof Node||e instanceof y(e).Node:!1}function $(e){return g()?e instanceof Element||e instanceof y(e).Element:!1}function x(e){return g()?e instanceof HTMLElement||e instanceof y(e).HTMLElement:!1}function R(e){return!g()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof y(e).ShadowRoot}const De=new Set(["inline","contents"]);function _(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!De.has(o)}const Se=new Set(["table","td","th"]);function _e(e){return Se.has(P(e))}const ve=[":popover-open",":modal"];function Pe(e){return ve.some(t=>{try{return e.matches(t)}catch{return!1}})}const xe=["transform","translate","scale","rotate","perspective"],Ie=["transform","translate","scale","rotate","perspective","filter"],Te=["paint","layout","strict","content"];function Oe(e){const t=Ae(),n=$(e)?H(e):e;return xe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ie.some(r=>(n.willChange||"").includes(r))||Te.some(r=>(n.contain||"").includes(r))}function Ye(e){let t=S(e);for(;x(t)&&!Y(t);){if(Oe(t))return t;if(Pe(t))return null;t=S(t)}return null}function Ae(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Le=new Set(["html","body","#document"]);function Y(e){return Le.has(P(e))}function H(e){return y(e).getComputedStyle(e)}function He(e){return $(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function S(e){if(P(e)==="html")return e;const t=e.assignedSlot||e.parentNode||R(e)&&e.host||Ne(e);return R(t)?t.host:t}function z(e){const t=S(e);return Y(t)?e.ownerDocument?e.ownerDocument.body:e.body:x(t)&&_(t)?t:z(t)}function M(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=z(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=y(o);if(s){const f=Re(i);return t.concat(i,i.visualViewport||[],_(o)?o:[],f&&n?M(f):[])}return t.concat(o,M(o,[],n))}function Re(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Me=a.createContext(void 0);function Be(e=!1){const t=a.useContext(Me);if(t===void 0&&!e)throw new Error(B(16));return t}function Ue(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,f=r&&t===!1;return{props:a.useMemo(()=>{const u={onKeyDown(b){n&&t&&b.key!=="Tab"&&b.preventDefault()}};return r||(u.tabIndex=o,!s&&n&&(u.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||f)&&(u.disabled=n),u},[r,n,t,i,f,s,o])}}function ze(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,s=a.useRef(null),i=Be(!0)!==void 0,f=O(()=>{const d=s.current;return!!(d?.tagName==="A"&&d?.href)}),{props:p}=Ue({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:o}),u=a.useCallback(()=>{const d=s.current;je(d)&&i&&t&&p.disabled===void 0&&d.disabled&&(d.disabled=!1)},[t,p.disabled,i]);ce(u,[u]);const b=a.useCallback((d={})=>{const{onClick:l,onMouseDown:G,onKeyUp:X,onKeyDown:q,onPointerDown:J,...Z}=d;return K({type:o?"button":void 0,onClick(c){if(t){c.preventDefault();return}l?.(c)},onMouseDown(c){t||G?.(c)},onKeyDown(c){if(t||(D(c),q?.(c)),c.baseUIHandlerPrevented)return;const Q=c.target===c.currentTarget&&!o&&!f()&&!t,I=c.key==="Enter",ee=c.key===" ";Q&&((ee||I)&&c.preventDefault(),I&&l?.(c))},onKeyUp(c){t||(D(c),X?.(c)),!c.baseUIHandlerPrevented&&c.target===c.currentTarget&&!o&&!t&&c.key===" "&&l?.(c)},onPointerDown(c){if(t){c.preventDefault();return}J?.(c)}},o?void 0:{role:"button"},p,Z)},[t,p,o,f]),E=O(d=>{s.current=d,u()});return{getButtonProps:b,buttonRef:E}}function je(e){return x(e)&&e.tagName==="BUTTON"}export{He as A,fe as B,R as C,F as D,m as E,We as N,O as a,v as b,$e as c,ze as d,A as e,B as f,y as g,Fe as h,Be as i,x as j,Y as k,S as l,K as m,$ as n,H as o,M as p,Ne as q,Re as r,Ae as s,Pe as t,ce as u,_e as v,Oe as w,Ye as x,P as y,_ as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,j,y as Sn,l as hr,a as lt,e as Vt,a1 as br,a2 as xr,a3 as Ir,a4 as yr,a5 as Cr,a6 as vr,a7 as Rr,a8 as Er,a9 as Pr,aa as wr,ab as Mr,ac as Sr,ad as Vr,ae as In,af as Or,ag as kr,ah as Ar,ai as Tr,aj as Lr,ak as Nr,al as Dr,am as Fr,an as jr,ao as _r,t as Hr,z as qr,i as Vn,g as Br}from"./index-BCY9aD4r.js";import{a as ce,b as Dt,u as ne,j as yn,h as it,f as rt,N as Ie,E as nn,n as Kr,e as zr,d as sn,c as Be}from"./useButton-Ct8hIyjz.js";import{ak as an,al as be,am as It,an as $e,ao as Qe,ah as Ur,a0 as tt,I as Gr,S as Wr,ap as $r,a1 as Cn,ac as Qr,a as qe,c as te,L as Nt,g as xt,K as Yr,aq as Jr,ar as Xr,u as On,d as D,o as kn,as as Zr,at as y,ai as ln,y as mt,au as We,a3 as nt,z as eo,n as je,s as Ft,k as to,l as no,a7 as ro,Z as An,Q as oo,av as vn,h as so,aw as io,p as ao,v as un,ax as Rn,F as lo,D as uo,r as Tn}from"./popupStateMapping-DkOpwBhG.js";import{f as En,c as co,b as fo,u as po,g as mo}from"./getDisabledMountTransitionStyles-CKUvhO4q.js";import{e as go,u as ho,b as Ln,a as bo,I as xo,i as Io,F as yo}from"./InternalBackdrop-CXjGP6a9.js";import{a as Nn,u as Ot}from"./useValueChanged-vz8uKgCk.js";import{u as Co}from"./useMutation-VUB-GXkv.js";import{g as vo}from"./useTargetingRules-DS57orU0.js";function Zt({controlled:e,default:t,name:n,state:r="value"}){const{current:f}=s.useRef(e!==void 0),[a,p]=s.useState(t),l=f?e:a,i=s.useCallback(c=>{f||p(c)},[]);return[l,i]}const Dn=s.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Ro(){return s.useContext(Dn)}function Eo(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:f}=e,a=ce(f),p=s.useRef(0),l=Dt(wo).current,i=Dt(Po).current,[c,g]=s.useState(0),u=s.useRef(c),P=ce((d,o)=>{i.set(d,o??null),u.current+=1,g(u.current)}),h=ce(d=>{i.delete(d),u.current+=1,g(u.current)}),O=s.useMemo(()=>{const d=new Map;return Array.from(i.keys()).filter(M=>M.isConnected).sort(Mo).forEach((M,I)=>{const w=i.get(M)??{};d.set(M,{...w,index:I})}),d},[i,c]);ne(()=>{if(typeof MutationObserver!="function"||O.size===0)return;const d=new MutationObserver(o=>{const M=new Set,I=w=>M.has(w)?M.delete(w):M.add(w);o.forEach(w=>{w.removedNodes.forEach(I),w.addedNodes.forEach(I)}),M.size===0&&(u.current+=1,g(u.current))});return O.forEach((o,M)=>{M.parentElement&&d.observe(M.parentElement,{childList:!0})}),()=>{d.disconnect()}},[O]),ne(()=>{u.current===c&&(n.current.length!==O.size&&(n.current.length=O.size),r&&r.current.length!==O.size&&(r.current.length=O.size),p.current=O.size),a(O)},[a,O,n,r,c]),ne(()=>()=>{n.current=[]},[n]),ne(()=>()=>{r&&(r.current=[])},[r]);const m=ce(d=>(l.add(d),()=>{l.delete(d)}));ne(()=>{l.forEach(d=>d(O))},[l,O]);const x=s.useMemo(()=>({register:P,unregister:h,subscribeMapChange:m,elementsRef:n,labelsRef:r,nextIndexRef:p}),[P,h,m,n,r,p]);return j.jsx(Dn.Provider,{value:x,children:t})}function Po(){return new Map}function wo(){return new Set}function Mo(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}let Fn=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function So(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:f,index:a}=e,{register:p,unregister:l,subscribeMapChange:i,elementsRef:c,labelsRef:g,nextIndexRef:u}=Ro(),P=s.useRef(-1),[h,O]=s.useState(a??(f===Fn.GuessFromOrder?()=>{if(P.current===-1){const d=u.current;u.current+=1,P.current=d}return P.current}:-1)),m=s.useRef(null),x=s.useCallback(d=>{if(m.current=d,h!==-1&&d!==null&&(c.current[h]=d,g)){const o=t!==void 0;g.current[h]=o?t:r?.current?.textContent??d.textContent}},[h,c,g,t,r]);return ne(()=>{if(a!=null)return;const d=m.current;if(d)return p(d,n),()=>{l(d)}},[a,p,l,n]),ne(()=>{if(a==null)return i(d=>{const o=m.current?d.get(m.current)?.index:null;o!=null&&O(o)})},[a,i,O]),s.useMemo(()=>({ref:x,index:h}),[h,x])}function kt(e,t,n){return Math.floor(e/t)!==n}function ht(e,t){return t<0||t>=e.current.length}function en(e,t){return Pe(e,{disabledIndices:t})}function Pn(e,t){return Pe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Pe(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:f=1}={}){let a=t;do a+=n?-f:f;while(a>=0&&a<=e.current.length-1&&bt(e,a,r));return a}function Vo(e,{event:t,orientation:n,loopFocus:r,rtl:f,cols:a,disabledIndices:p,minIndex:l,maxIndex:i,prevIndex:c,stopEvent:g=!1}){let u=c;const P=[],h={};let O=!1;{let d=null,o=-1;e.current.forEach((M,I)=>{if(M==null)return;const w=M.closest('[role="row"]');w&&(O=!0),(w!==d||o===-1)&&(d=w,o+=1,P[o]=[]),P[o].push(I),h[I]=o})}const m=O&&P.length>0&&P.some(d=>d.length!==a);function x(d){if(!m||c===-1)return;const o=h[c];if(o==null)return;const M=P[o].indexOf(c);let I=d==="up"?o-1:o+1;r&&(I<0?I=P.length-1:I>=P.length&&(I=0));const w=new Set;for(;I>=0&&I<P.length&&!w.has(I);){w.add(I);const v=P[I];if(v.length===0){I=d==="up"?I-1:I+1;continue}const R=Math.min(M,v.length-1);for(let T=R;T>=0;T-=1){const z=v[T];if(!bt(e,z,p))return z}I=d==="up"?I-1:I+1,r&&(I<0?I=P.length-1:I>=P.length&&(I=0))}}if(t.key===an){const d=x("up");if(d!==void 0)g&&be(t),u=d;else{if(g&&be(t),c===-1)u=i;else if(u=Pe(e,{startingIndex:u,amount:a,decrement:!0,disabledIndices:p}),r&&(c-a<l||u<0)){const o=c%a,M=i%a,I=i-(M-o);M===o?u=i:u=M>o?I:I-a}ht(e,u)&&(u=c)}}if(t.key===It){const d=x("down");d!==void 0?(g&&be(t),u=d):(g&&be(t),c===-1?u=l:(u=Pe(e,{startingIndex:c,amount:a,disabledIndices:p}),r&&c+a>i&&(u=Pe(e,{startingIndex:c%a-a,amount:a,disabledIndices:p}))),ht(e,u)&&(u=c))}if(n==="both"){const d=En(c/a);t.key===(f?$e:Qe)&&(g&&be(t),c%a!==a-1?(u=Pe(e,{startingIndex:c,disabledIndices:p}),r&&kt(u,a,d)&&(u=Pe(e,{startingIndex:c-c%a-1,disabledIndices:p}))):r&&(u=Pe(e,{startingIndex:c-c%a-1,disabledIndices:p})),kt(u,a,d)&&(u=c)),t.key===(f?Qe:$e)&&(g&&be(t),c%a!==0?(u=Pe(e,{startingIndex:c,decrement:!0,disabledIndices:p}),r&&kt(u,a,d)&&(u=Pe(e,{startingIndex:c+(a-c%a),decrement:!0,disabledIndices:p}))):r&&(u=Pe(e,{startingIndex:c+(a-c%a),decrement:!0,disabledIndices:p})),kt(u,a,d)&&(u=c));const o=En(i/a)===d;ht(e,u)&&(r&&o?u=t.key===(f?Qe:$e)?i:Pe(e,{startingIndex:c-c%a-1,disabledIndices:p}):u=c)}return u}function Oo(e,t,n){const r=[];let f=0;return e.forEach(({width:a,height:p},l)=>{let i=!1;for(n&&(f=0);!i;){const c=[];for(let g=0;g<a;g+=1)for(let u=0;u<p;u+=1)c.push(f+g+u*t);f%t+a<=t&&c.every(g=>r[g]==null)?(c.forEach(g=>{r[g]=l}),i=!0):f+=1}}),[...r]}function ko(e,t,n,r,f){if(e===-1)return-1;const a=n.indexOf(e),p=t[e];switch(f){case"tl":return a;case"tr":return p?a+p.width-1:a;case"bl":return p?a+(p.height-1)*r:a;case"br":return n.lastIndexOf(e);default:return-1}}function Ao(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function bt(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}const To="Escape";function jt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function At(e,t){return jt(t,e===an||e===It,e===$e||e===Qe)}function tn(e,t,n){return jt(t,e===It,n?e===$e:e===Qe)||e==="Enter"||e===" "||e===""}function Lo(e,t,n){return jt(t,n?e===$e:e===Qe,e===It)}function No(e,t,n,r){const f=n?e===Qe:e===$e,a=e===an;return t==="both"||t==="horizontal"&&r&&r>1?e===To:jt(t,f,a)}function Do(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),f=n.useState("floatingElement"),a=n.useState("domReferenceElement"),p=n.context.dataRef,{listRef:l,activeIndex:i,onNavigate:c=()=>{},enabled:g=!0,selectedIndex:u=null,allowEscape:P=!1,loopFocus:h=!1,nested:O=!1,rtl:m=!1,virtual:x=!1,focusItemOnOpen:d="auto",focusItemOnHover:o=!0,openOnArrowKeyDown:M=!0,disabledIndices:I=void 0,orientation:w="vertical",parentOrientation:v,cols:R=1,scrollItemIntoView:T=!0,itemSizes:z,dense:re=!1,id:q,resetOnPointerLeave:ie=!0,externalTree:X}=t,K=Ur(f),S=tt(K),U=Gr(),ae=Wr(X);ne(()=>{p.current.orientation=w},[p,w]);const ye=$r(a),Z=s.useRef(d),k=s.useRef(u??-1),G=s.useRef(null),pe=s.useRef(!0),J=ce(V=>{c(k.current===-1?null:k.current,V)}),Q=s.useRef(J),A=s.useRef(!!f),de=s.useRef(r),le=s.useRef(!1),ue=s.useRef(!1),me=tt(I),E=tt(r),_=tt(T),W=tt(u),Ce=tt(ie),ve=ce(()=>{function V(se){x?ae?.events.emit("virtualfocus",se):go(se,{sync:le.current,preventScroll:!0})}const $=l.current[k.current],L=ue.current;$&&V($),(le.current?se=>se():requestAnimationFrame)(()=>{const se=l.current[k.current]||$;if(!se)return;$||V(se);const ee=_.current;ee&&we&&(L||!pe.current)&&se.scrollIntoView?.(typeof ee=="boolean"?{block:"nearest",inline:"nearest"}:ee)})});ne(()=>{g&&(r&&f?(k.current=u??-1,Z.current&&u!=null&&(ue.current=!0,J())):A.current&&(k.current=-1,Q.current()))},[g,r,f,u,J]),ne(()=>{if(g){if(!r){le.current=!1;return}if(f)if(i==null){if(le.current=!1,W.current!=null)return;if(A.current&&(k.current=-1,ve()),(!de.current||!A.current)&&Z.current&&(G.current!=null||Z.current===!0&&G.current==null)){let V=0;const $=()=>{l.current[0]==null?(V<2&&(V?requestAnimationFrame:queueMicrotask)($),V+=1):(k.current=G.current==null||tn(G.current,w,m)||O?en(l):Pn(l),G.current=null,J())};$()}}else ht(l,i)||(k.current=i,ve(),ue.current=!1)}},[g,r,f,i,W,O,l,w,m,J,ve,me]),ne(()=>{if(!g||f||!ae||x||!A.current)return;const V=ae.nodesRef.current,$=V.find(se=>se.id===U)?.context?.elements.floating,L=Cn(Qr(f)),oe=V.some(se=>se.context&&qe(se.context.elements.floating,L));$&&!oe&&pe.current&&$.focus({preventScroll:!0})},[g,f,ae,U,x]),ne(()=>{Q.current=J,de.current=r,A.current=!!f}),ne(()=>{r||(G.current=null,Z.current=d)},[r,d]);const Y=i!=null,we=s.useMemo(()=>{function V(L){if(!E.current)return;const oe=l.current.indexOf(L.currentTarget);oe!==-1&&k.current!==oe&&(k.current=oe,J(L))}return{onFocus(L){le.current=!0,V(L)},onClick:({currentTarget:L})=>L.focus({preventScroll:!0}),onMouseMove(L){le.current=!0,ue.current=!1,o&&V(L)},onPointerLeave(L){if(!E.current||!pe.current||L.pointerType==="touch")return;le.current=!0;const oe=L.relatedTarget;!o||l.current.includes(oe)||Ce.current&&(k.current=-1,J(L),x||S.current?.focus({preventScroll:!0}))}}},[E,S,o,l,J,Ce,x]),Oe=s.useCallback(()=>v??ae?.nodesRef.current.find(V=>V.id===U)?.context?.dataRef?.current.orientation,[U,ae,v]),ze=ce(V=>{if(pe.current=!1,le.current=!0,V.which===229||!E.current&&V.currentTarget===S.current)return;if(O&&No(V.key,w,m,R)){At(V.key,Oe())||be(V),n.setOpen(!1,te(Nt,V.nativeEvent)),yn(a)&&(x?ae?.events.emit("virtualfocus",a):a.focus());return}const $=k.current,L=en(l,I),oe=Pn(l,I);if(ye||(V.key==="Home"&&(be(V),k.current=L,J(V)),V.key==="End"&&(be(V),k.current=oe,J(V))),R>1){const se=z||Array.from({length:l.current.length},()=>({width:1,height:1})),ee=Oo(se,R,re),Re=ee.findIndex(ke=>ke!=null&&!bt(l,ke,I)),Fe=ee.reduce((ke,ge,F)=>ge!=null&&!bt(l,ge,I)?F:ke,-1),Ne=ee[Vo({current:ee.map(ke=>ke!=null?l.current[ke]:null)},{event:V,orientation:w,loopFocus:h,rtl:m,cols:R,disabledIndices:Ao([...(typeof I!="function"?I:null)||l.current.map((ke,ge)=>bt(l,ge,I)?ge:void 0),void 0],ee),minIndex:Re,maxIndex:Fe,prevIndex:ko(k.current>oe?L:k.current,se,ee,R,V.key===It?"bl":V.key===(m?$e:Qe)?"tr":"tl"),stopEvent:!0})];if(Ne!=null&&(k.current=Ne,J(V)),w==="both")return}if(At(V.key,w)){if(be(V),r&&!x&&Cn(V.currentTarget.ownerDocument)===V.currentTarget){k.current=tn(V.key,w,m)?L:oe,J(V);return}tn(V.key,w,m)?h?$>=oe?P&&$!==l.current.length?k.current=-1:(le.current=!1,k.current=L):k.current=Pe(l,{startingIndex:$,disabledIndices:I}):k.current=Math.min(oe,Pe(l,{startingIndex:$,disabledIndices:I})):h?$<=L?P&&$!==-1?k.current=l.current.length:(le.current=!1,k.current=oe):k.current=Pe(l,{startingIndex:$,decrement:!0,disabledIndices:I}):k.current=Math.max(L,Pe(l,{startingIndex:$,decrement:!0,disabledIndices:I})),ht(l,k.current)&&(k.current=-1),J(V)}}),Ye=s.useMemo(()=>x&&r&&Y&&{"aria-activedescendant":`${q}-${i}`},[x,r,Y,q,i]),ut=s.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...ye?{}:Ye,onKeyDown(V){if(V.key==="Tab"&&V.shiftKey&&r&&!x){const $=xt(V.nativeEvent);if($&&!qe(S.current,$))return;be(V),n.setOpen(!1,te(Yr,V.nativeEvent)),yn(a)&&a.focus();return}ze(V)},onPointerMove(){pe.current=!0}}),[Ye,ze,S,w,ye,n,r,x,a]),Ue=s.useMemo(()=>{function V(L){d==="auto"&&Jr(L.nativeEvent)&&(Z.current=!x)}function $(L){Z.current=d,d==="auto"&&Xr(L.nativeEvent)&&(Z.current=!0)}return{onKeyDown(L){const oe=n.select("open");pe.current=!1;const se=L.key.startsWith("Arrow"),ee=Lo(L.key,Oe(),m),Re=At(L.key,w),Fe=(O?ee:Re)||L.key==="Enter"||L.key.trim()==="";if(x&&oe)return ze(L);if(!(!oe&&!M&&se)){if(Fe){const Ne=At(L.key,Oe());G.current=O&&Ne?null:L.key}if(O){ee&&(be(L),oe?(k.current=en(l,me.current),J(L)):n.setOpen(!0,te(Nt,L.nativeEvent,L.currentTarget)));return}Re&&(W.current!=null&&(k.current=W.current),be(L),!oe&&M?n.setOpen(!0,te(Nt,L.nativeEvent,L.currentTarget)):ze(L),oe&&J(L))}},onFocus(L){n.select("open")&&!x&&(k.current=-1,J(L))},onPointerDown:$,onPointerEnter:$,onMouseDown:V,onClick:V}},[ze,me,d,l,O,J,n,M,w,Oe,m,W,x]),Ve=s.useMemo(()=>({...Ye,...Ue}),[Ye,Ue]);return s.useMemo(()=>g?{reference:Ve,floating:ut,item:we,trigger:Ue}:{},[g,Ve,ut,Ue,we])}function Fo(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),f=n.context.dataRef,{listRef:a,activeIndex:p,onMatch:l,onTypingChange:i,enabled:c=!0,findMatch:g=null,resetMs:u=750,ignoreKeys:P=it,selectedIndex:h=null}=t,O=On(),m=s.useRef(""),x=s.useRef(h??p??-1),d=s.useRef(null);ne(()=>{r&&(O.clear(),d.current=null,m.current="")},[r,O]),ne(()=>{r&&m.current===""&&(x.current=h??p??-1)},[r,h,p]);const o=ce(v=>{v?f.current.typing||(f.current.typing=v,i?.(v)):f.current.typing&&(f.current.typing=v,i?.(v))}),M=ce(v=>{function R(ie,X,K){const S=g?g(X,K):X.find(U=>U?.toLocaleLowerCase().indexOf(K.toLocaleLowerCase())===0);return S?ie.indexOf(S):-1}const T=a.current;if(m.current.length>0&&m.current[0]!==" "&&(R(T,T,m.current)===-1?o(!1):v.key===" "&&be(v)),T==null||P.includes(v.key)||v.key.length!==1||v.ctrlKey||v.metaKey||v.altKey)return;r&&v.key!==" "&&(be(v),o(!0)),T.every(ie=>ie?ie[0]?.toLocaleLowerCase()!==ie[1]?.toLocaleLowerCase():!0)&&m.current===v.key&&(m.current="",x.current=d.current),m.current+=v.key,O.start(u,()=>{m.current="",x.current=d.current,o(!1)});const re=x.current,q=R(T,[...T.slice((re||0)+1),...T.slice(0,(re||0)+1)],m.current);q!==-1?(l?.(q),d.current=q):v.key!==" "&&(m.current="",o(!1))}),I=s.useMemo(()=>({onKeyDown:M}),[M]),w=s.useMemo(()=>({onKeyDown:M,onKeyUp(v){v.key===" "&&o(!1)}}),[M,o]);return s.useMemo(()=>c?{reference:I,floating:w}:{},[c,I,w])}function jo(e){const t=s.useRef(!0);t.current&&(t.current=!1,e())}const jn=s.createContext(void 0),_n=s.createContext(void 0),Hn=s.createContext(void 0),qn=s.createContext("");function Ke(){const e=s.useContext(jn);if(!e)throw new Error(rt(22));return e}function _t(){const e=s.useContext(_n);if(!e)throw new Error(rt(23));return e}function ot(){const e=s.useContext(Hn);if(!e)throw new Error(rt(24));return e}function cn(){return s.useContext(qn)}const _o=(e,t)=>Object.is(e,t);function at(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Tt(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:at(r,t,n))}function rn(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:at(r,t,n))}function Ho(e,t,n){return e.filter(r=>!at(r,t,n))}const C={id:D(e=>e.id),query:D(e=>e.query),items:D(e=>e.items),selectedValue:D(e=>e.selectedValue),open:D(e=>e.open),mounted:D(e=>e.mounted),forceMounted:D(e=>e.forceMounted),inline:D(e=>e.inline),activeIndex:D(e=>e.activeIndex),selectedIndex:D(e=>e.selectedIndex),isActive:D((e,t)=>e.activeIndex===t),isSelected:D((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(f=>at(f,t,n)):at(r,t,n)}),transitionStatus:D(e=>e.transitionStatus),popupProps:D(e=>e.popupProps),inputProps:D(e=>e.inputProps),triggerProps:D(e=>e.triggerProps),getItemProps:D(e=>e.getItemProps),positionerElement:D(e=>e.positionerElement),listElement:D(e=>e.listElement),triggerElement:D(e=>e.triggerElement),inputElement:D(e=>e.inputElement),popupSide:D(e=>e.popupSide),openMethod:D(e=>e.openMethod),inputInsidePopup:D(e=>e.inputInsidePopup),selectionMode:D(e=>e.selectionMode),listRef:D(e=>e.listRef),labelsRef:D(e=>e.labelsRef),popupRef:D(e=>e.popupRef),emptyRef:D(e=>e.emptyRef),inputRef:D(e=>e.inputRef),keyboardActiveRef:D(e=>e.keyboardActiveRef),chipsContainerRef:D(e=>e.chipsContainerRef),clearRef:D(e=>e.clearRef),valuesRef:D(e=>e.valuesRef),allValuesRef:D(e=>e.allValuesRef),name:D(e=>e.name),disabled:D(e=>e.disabled),readOnly:D(e=>e.readOnly),required:D(e=>e.required),grid:D(e=>e.grid),isGrouped:D(e=>e.isGrouped),virtualized:D(e=>e.virtualized),onOpenChangeComplete:D(e=>e.onOpenChangeComplete),openOnInputClick:D(e=>e.openOnInputClick),itemToStringLabel:D(e=>e.itemToStringLabel),isItemEqualToValue:D(e=>e.isItemEqualToValue),modal:D(e=>e.modal),autoHighlight:D(e=>e.autoHighlight),submitOnItemClick:D(e=>e.submitOnItemClick)};let wn=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const qo={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Bn={valid(e){return e===null?null:e?{[wn.valid]:""}:{[wn.invalid]:""}}},Bo=s.createContext({invalid:void 0,name:void 0,validityData:{state:qo,errors:[],error:"",value:"",initialValue:null},setValidityData:Ie,disabled:void 0,touched:!1,setTouched:Ie,dirty:!1,setDirty:Ie,filled:!1,setFilled:Ie,focused:!1,setFocused:Ie,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=nn)=>e,getInputValidationProps:(e=nn)=>e,inputRef:{current:null},commit:async()=>{}}});function yt(e=!0){const t=s.useContext(Bo);if(t.setValidityData===Ie&&!e)throw new Error(rt(28));return t}function Ko(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function zo(e){const{enabled:t=!0,value:n,id:r,name:f,controlRef:a,commit:p}=e,{formRef:l}=Nn(),{invalid:i,markedDirtyRef:c,validityData:g,setValidityData:u}=yt(),P=ce(e.getValue);ne(()=>{if(!t)return;let h=n;h===void 0&&(h=P()),g.initialValue===null&&h!==null&&u(O=>({...O,initialValue:h}))},[t,u,n,g.initialValue,P]),ne(()=>{!t||!r||l.current.fields.set(r,{getValue:P,name:f,controlRef:a,validityData:Ko(g,i),validate(){let h=n;h===void 0&&(h=P()),c.current=!0,Sn.flushSync(()=>p(h))}})},[p,a,t,l,P,r,i,c,f,g,n]),ne(()=>{const h=l.current.fields;return()=>{r&&h.delete(r)}},[l,r])}const Uo=s.createContext({controlId:void 0,setControlId:Ie,labelId:void 0,setLabelId:Ie,messageIds:[],setMessageIds:Ie,getDescriptionProps:e=>e});function dn(){return s.useContext(Uo)}function Go(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:f,setControlId:a}=dn(),p=kn(t);return ne(()=>{if(!(!n&&!t||a===Ie)){if(n){const l=r?.current;Kr(l)&&l.closest("label")!=null?a(t??null):a(f??p)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,f,a,n,p]),f??p}function on(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Wo(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Se(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return on(e)}function gt(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?on(e.value):on(e)}function $o(e,t){return(n,r)=>{if(n==null)return!1;const f=Se(n,t);return e.contains(f,r)}}function Qo(e,t,n){return(r,f)=>{if(r==null)return!1;if(!f)return!0;const a=Se(r,t),p=n!=null?Se(n,t):"";return p&&e.contains(p,f)&&p.length===f.length?!0:e.contains(a,f)}}const Mn=new Map;function Kn(e){return Array.isArray(e)?e.map(t=>Kn(t)).join(","):e==null?"":String(e)}function Yo(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Kn(e.locale)}|${JSON.stringify(t)}`,r=Mn.get(n);if(r)return r;const f=new Intl.Collator(e.locale,t),a={contains(p,l,i){if(!l)return!0;const c=Se(p,i);for(let g=0;g<=c.length-l.length;g+=1)if(f.compare(c.slice(g,g+l.length),l)===0)return!0;return!1},startsWith(p,l,i){if(!l)return!0;const c=Se(p,i);return f.compare(c.slice(0,l.length),l)===0},endsWith(p,l,i){if(!l)return!0;const c=Se(p,i),g=l.length;return c.length>=g&&f.compare(c.slice(c.length-g),l)===0}};return Mn.set(n,a),a}const Jo=Yo,zn=Symbol("none"),et={value:zn,index:-1};function Xo(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:f,onSelectedValueChange:a,defaultInputValue:p,inputValue:l,selectionMode:i="none",onItemHighlighted:c,name:g,disabled:u=!1,readOnly:P=!1,required:h=!1,inputRef:O,grid:m=!1,items:x,filteredItems:d,filter:o,openOnInputClick:M=!0,autoHighlight:I=!1,keepHighlight:w=!1,highlightItemOnHover:v=!0,itemToStringLabel:R,itemToStringValue:T,isItemEqualToValue:z=_o,virtualized:re=!1,inline:q=!1,fillInputOnItemPress:ie=!0,modal:X=!1,limit:K=-1,autoComplete:S="list",locale:U,submitOnItemClick:ae=!1}=e,{clearErrors:ye}=Nn(),{setDirty:Z,validityData:k,shouldValidateOnChange:G,setFilled:pe,name:J,disabled:Q,validation:A}=yt(),de=Go({id:t}),le=Jo({locale:U}),[ue,me]=s.useState(!1),[E,_]=s.useState(null),W=s.useRef([]),Ce=s.useRef([]),ve=s.useRef(null),Y=s.useRef(null),we=s.useRef(null),Oe=s.useRef(!0),ze=s.useRef(!1),Ye=s.useRef(null),ut=s.useRef(null),Ue=s.useRef(null),Ve=s.useRef(et),V=s.useRef(null),$=s.useRef([]),L=s.useRef([]),oe=Q||u,se=J??g,ee=i==="multiple",Re=i==="single",Fe=l!==void 0||p!==void 0,Ne=x!==void 0,ke=d!==void 0;let ge;I==="always"?ge="always":ge=I?"input-change":!1;const[F,Ct]=Zt({controlled:f,default:ee?r??it:r,name:"Combobox",state:"selectedValue"}),vt=s.useMemo(()=>o===null?()=>!0:o!==void 0?o:Re&&!ue?Qo(le,R,F):$o(le,R),[o,Re,F,ue,le,R]),pn=Dt(()=>Fe?p??"":Re?Se(F,R):"").current,[Ae,Qn]=Zt({controlled:l,default:pn,name:"Combobox",state:"inputValue"}),[xe,Yn]=Zt({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),_e=Wo(x),Me=E??(Ae===""?"":String(Ae).trim()),Ht=Re?Se(F,R):"",mn=Re&&!ue&&Me!==""&&Ht!==""&&Ht.length===Me.length&&le.contains(Ht,Me),ct=mn?"":Me,gn=Ne&&ke&&mn,Ge=s.useMemo(()=>x?_e?x.flatMap(b=>b.items):x:it,[x,_e]),dt=s.useMemo(()=>{if(d&&!gn)return d;if(!x)return it;if(_e){const N=x,H=[];let fe=0;for(const he of N){if(K>-1&&fe>=K)break;const Ee=ct===""?he.items:he.items.filter(St=>vt(St,ct,R));if(Ee.length===0)continue;const Xe=K>-1?K-fe:1/0,Ze=Ee.slice(0,Xe);if(Ze.length>0){const St={...he,items:Ze};H.push(St),fe+=Ze.length}}return H}if(ct==="")return K>-1?Ge.slice(0,K):Ge;const b=[];for(const N of Ge){if(K>-1&&b.length>=K)break;vt(N,ct,R)&&b.push(N)}return b},[d,gn,x,_e,ct,K,vt,R,Ge]),De=s.useMemo(()=>_e?dt.flatMap(N=>N.items):dt,[dt,_e]),B=Dt(()=>new Zr({id:de,selectedValue:F,open:xe,filter:vt,query:Me,items:x,selectionMode:i,listRef:W,labelsRef:Ce,popupRef:ve,emptyRef:we,inputRef:Y,keyboardActiveRef:Oe,chipsContainerRef:Ye,clearRef:ut,valuesRef:$,allValuesRef:L,selectionEventRef:Ue,name:se,disabled:oe,readOnly:P,required:h,grid:m,isGrouped:_e,virtualized:re,openOnInputClick:M,itemToStringLabel:R,isItemEqualToValue:z,modal:X,autoHighlight:ge,submitOnItemClick:ae,hasInputValue:Fe,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:q,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Ie,setOpen:Ie,setInputValue:Ie,setSelectedValue:Ie,setIndices:Ie,onItemHighlighted:Ie,handleSelection:Ie,getItemProps:()=>nn,forceMount:Ie,requestSubmit:Ie})).current,st=i==="none"?Ae:F,Jn=s.useMemo(()=>i==="none"?st:Array.isArray(F)?F.map(b=>gt(b,T)):gt(F,T),[st,T,i,F]),qt=ce(c),Bt=ce(n),Rt=y(B,C.activeIndex),Xn=y(B,C.selectedIndex),Et=y(B,C.positionerElement),hn=y(B,C.listElement),ft=y(B,C.triggerElement),Kt=y(B,C.inputElement),He=y(B,C.inline),Je=y(B,C.inputInsidePopup),Zn=tt(ft),{mounted:bn,setMounted:er,transitionStatus:zt}=ln(xe),{openMethod:xn,triggerProps:Ut,reset:tr}=ho(xe);zo({id:de,name:se,commit:A.commit,value:st,controlRef:Je?Zn:Y,getValue:()=>Jn});const Pt=ce(()=>{x?Ce.current=De.map(b=>Se(b,R)):B.set("forceMounted",!0)}),nr=s.useRef(F);ne(()=>{F!==nr.current&&Pt()},[Pt,F]);const Te=ce(b=>{B.update(b);const N=b.type||"none";if(b.activeIndex!==void 0)if(b.activeIndex===null)Ve.current!==et&&(Ve.current=et,qt(void 0,mt(N,void 0,{index:-1})));else{const H=$.current[b.activeIndex];Ve.current={value:H,index:b.activeIndex},qt(H,mt(N,void 0,{index:b.activeIndex}))}}),Le=ce((b,N)=>{if(ze.current=N.reason===We,e.onInputValueChange?.(b,N),!N.isCanceled){if(N.reason===nt){const H=b.trim()!=="";H&&me(!0),V.current={hasQuery:H},H&&ge&&B.state.activeIndex==null&&B.set("activeIndex",0)}Qn(b)}}),pt=ce((b,N)=>{xe!==b&&(N.reason==="escape-key"&&Ne&&De.length===0&&!B.state.emptyRef.current&&N.allowPropagation(),e.onOpenChange?.(b,N),!N.isCanceled&&(!b&&ue&&(Re?(_(Me),Me===""&&me(!1)):ee&&(He||Je?Te({activeIndex:null}):_(Me),Le("",te(We,N.event)))),Yn(b)))}),wt=ce((b,N)=>{if(a?.(b,N),N.isCanceled)return;Ct(b),(i==="none"&&ve.current&&ie||Re&&!B.state.inputInsidePopup)&&Le(Se(b,R),te(N.reason,N.event)),Re&&b!=null&&N.reason!==nt&&ue&&_(Me)}),rr=ce((b,N)=>{let H=N;if(H===void 0){if(Rt===null)return;H=$.current[Rt]}const fe=xt(b),he=Ue.current??b;Ue.current=null;const Ee=te(eo,he),Xe=fe?.closest("a")?.getAttribute("href");if(Xe){Xe.startsWith("#")&&pt(!1,Ee);return}if(ee){const Ze=Array.isArray(F)?F:[],gr=Tt(Ze,H,B.state.isItemEqualToValue)?Ho(Ze,H,B.state.isItemEqualToValue):[...Ze,H];if(wt(gr,Ee),!(Y.current?Y.current.value.trim()!=="":!1))return;B.state.inputInsidePopup?Le("",te(We,Ee.event)):pt(!1,Ee)}else wt(H,Ee),pt(!1,Ee)}),Gt=ce(()=>{if(!B.state.submitOnItemClick)return;const b=B.state.inputElement?.form;b&&typeof b.requestSubmit=="function"&&b.requestSubmit()}),Wt=ce(()=>{if(er(!1),Bt?.(!1),me(!1),tr(),_(null),Te(i==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ee&&Y.current&&Y.current.value!==""&&!ze.current&&Le("",te(We)),Re)if(B.state.inputInsidePopup)Y.current&&Y.current.value!==""&&Le("",te(We));else{const b=Se(F,R);Y.current&&Y.current.value!==b&&Le(b,te(b===""?We:je))}}),or=s.useMemo(()=>He&&Et?{current:Et.closest('[role="dialog"]')}:ve,[He,Et]);Ft({enabled:!e.actionsRef,open:xe,ref:or,onComplete(){xe||Wt()}}),s.useImperativeHandle(e.actionsRef,()=>({unmount:Wt}),[Wt]),ne(function(){if(xe||i==="none")return;const N=x?Ge:L.current;if(ee){const H=Array.isArray(F)?F:[],fe=H[H.length-1],he=rn(N,fe,z);Te({selectedIndex:he===-1?null:he})}else{const H=rn(N,F,z);Te({selectedIndex:H===-1?null:H})}},[xe,F,x,i,Ge,ee,z,Te]),ne(()=>{x&&($.current=De,W.current.length=De.length)},[x,De]),ne(()=>{const b=V.current;if(b&&(b.hasQuery?ge&&B.set("activeIndex",0):ge==="always"&&B.set("activeIndex",0),V.current=null),!xe&&!He)return;const H=Ne||ke?De:$.current,fe=B.state.activeIndex;if(fe==null){if(ge==="always"&&H.length>0){B.set("activeIndex",0);return}Ve.current!==et&&(Ve.current=et,B.state.onItemHighlighted(void 0,mt(je,void 0,{index:-1})));return}if(fe>=H.length){Ve.current!==et&&(Ve.current=et,B.state.onItemHighlighted(void 0,mt(je,void 0,{index:-1}))),B.set("activeIndex",null);return}const he=H[fe],Ee=Ve.current.value,Xe=Ee!==zn&&B.state.isItemEqualToValue(he,Ee);(Ve.current.index!==fe||!Xe)&&(Ve.current={value:he,index:fe},B.state.onItemHighlighted(he,mt(je,void 0,{index:fe})))},[Rt,ge,ke,Ne,De,He,xe,B]),ne(()=>{if(!x||i==="none")return;const b=Ge;if(ee){const fe=Array.isArray(F)?F:it,he=fe.filter(Ee=>Tt(b,Ee,B.state.isItemEqualToValue));he.length!==fe.length&&Ct(he);return}if(F==null?!0:Tt(b,F,B.state.isItemEqualToValue))return;let H=null;if(r!=null&&Tt(b,r,B.state.isItemEqualToValue)&&(H=r),Ct(H),!B.state.inputInsidePopup){const fe=Se(H,R);Y.current&&Y.current.value!==fe&&Le(fe,te(je))}},[x,Ge,ee,i,F,r,Ct,R,B,Le]),ne(()=>{if(i==="none"){pe(String(Ae)!=="");return}pe(ee?Array.isArray(F)&&F.length>0:F!=null)},[pe,i,Ae,F,ee]),s.useEffect(()=>{Ne&&ge&&De.length===0&&Te({activeIndex:null})},[Ne,ge,De.length,Te]),Ot(Me,()=>{!xe||Me===""||Me===String(pn)||me(!0)}),Ot(F,()=>{if(i!=="none"&&(ye(se),Z(F!==k.initialValue),G()?A.commit(F):A.commit(F,!0),ee&&B.state.selectedIndex!==null&&(!Array.isArray(F)||F.length===0)&&Te({activeIndex:null,selectedIndex:null}),Re&&!Fe&&!Je)){const b=Se(F,R);Ae!==b&&Le(b,te(je))}}),Ot(Ae,()=>{i==="none"&&(ye(se),Z(Ae!==k.initialValue),G()?A.commit(Ae):A.commit(Ae,!0))}),Ot(x,()=>{if(!Re||Fe||Je||ue)return;const b=Se(F,R);Ae!==b&&Le(b,te(je))});const Mt=co({open:He?!0:xe,onOpenChange:pt,elements:{reference:Je?ft:Kt,floating:Et}});let $t,Qt;He||($t=m?"grid":"listbox",Qt=xe?"true":"false");const sr=s.useMemo(()=>{const b=Kt?.tagName==="INPUT",N=b||xe,H=b?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return N&&(H.role="combobox",H["aria-expanded"]=Qt,H["aria-haspopup"]=$t,H["aria-controls"]=xe?hn?.id:void 0,H["aria-autocomplete"]=S),{reference:H,floating:{role:"presentation"}}},[Kt,xe,Qt,$t,hn?.id,S]),ir=Ln(Mt,{enabled:!P&&!oe&&M,event:"mousedown-only",toggle:!1,touchOpenDelay:Je?0:50}),ar=to(Mt,{enabled:!P&&!oe&&!He,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:He?!0:void 0,outsidePress(b){const N=xt(b);return!qe(ft,N)&&!qe(ut.current,N)&&!qe(Ye.current,N)}}),lr=Do(Mt,{enabled:!P&&!oe,id:de,listRef:W,activeIndex:Rt,selectedIndex:Xn,virtual:!0,loopFocus:!0,allowEscape:!ge,focusItemOnOpen:ue||i==="none"&&!ge?!1:"auto",focusItemOnHover:v,resetOnPointerLeave:!w,cols:m?2:1,orientation:m?"horizontal":void 0,disabledIndices:it,onNavigate(b,N){!N&&!xe||zt==="ending"||Te(N?{activeIndex:b,type:Oe.current?"keyboard":"pointer"}:{activeIndex:b})}}),{getReferenceProps:Yt,getFloatingProps:Jt,getItemProps:Xt}=no([sr,ir,ar,lr]);jo(()=>{B.update({inline:q,popupProps:Jt(),inputProps:Yt(),triggerProps:Ut,getItemProps:Xt,setOpen:pt,setInputValue:Le,setSelectedValue:wt,setIndices:Te,onItemHighlighted:qt,handleSelection:rr,forceMount:Pt,requestSubmit:Gt})}),ne(()=>{B.update({id:de,selectedValue:F,open:xe,mounted:bn,transitionStatus:zt,items:x,inline:q,popupProps:Jt(),inputProps:Yt(),triggerProps:Ut,openMethod:xn,getItemProps:Xt,selectionMode:i,name:se,disabled:oe,readOnly:P,required:h,grid:m,isGrouped:_e,virtualized:re,onOpenChangeComplete:Bt,openOnInputClick:M,itemToStringLabel:R,modal:X,autoHighlight:ge,isItemEqualToValue:z,submitOnItemClick:ae,hasInputValue:Fe,requestSubmit:Gt})},[B,de,F,xe,bn,zt,x,Jt,Yt,Xt,xn,Ut,i,se,oe,P,h,A,m,_e,re,Bt,M,R,X,z,ae,Fe,q,Gt,ge]);const ur=zr(O,A.inputRef),cr=s.useMemo(()=>({query:Me,filteredItems:dt,flatFilteredItems:De}),[Me,dt,De]),dr=s.useMemo(()=>Array.isArray(st)?"":gt(st,T),[st,T]),fr=ee&&Array.isArray(F)&&F.length>0,pr=s.useMemo(()=>!ee||!Array.isArray(F)||!se?null:F.map(b=>{const N=gt(b,T);return j.jsx("input",{type:"hidden",name:se,value:N},N)}),[ee,F,se,T]),mr=j.jsxs(s.Fragment,{children:[e.children,j.jsx("input",{...A.getInputValidationProps({onFocus(){if(Je){ft?.focus();return}(Y.current||ft)?.focus()},onChange(b){if(b.nativeEvent.defaultPrevented)return;const N=b.target.value,H=te(nt,b.nativeEvent);function fe(){if(ee)return;if(i==="none"){Z(N!==k.initialValue),Le(N,H),G()&&A.commit(N);return}const he=$.current.find(Ee=>gt(Ee,T).toLowerCase()===N.toLowerCase());he!=null&&(Z(he!==k.initialValue),wt?.(he,H),G()&&A.commit(he))}x?fe():(Pt(),queueMicrotask(fe))}}),id:de,name:ee||i==="none"?void 0:se,disabled:oe,required:h&&!fr,readOnly:P,value:dr,ref:ur,style:ro,tabIndex:-1,"aria-hidden":!0}),pr]});return j.jsx(jn.Provider,{value:B,children:j.jsx(_n.Provider,{value:Mt,children:j.jsx(Hn.Provider,{value:cr,children:j.jsx(qn.Provider,{value:Ae,children:mr})})})})}function Zo(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const a=parseFloat(n.width)||0,p=parseFloat(n.height)||0,l=parseFloat(r.width)||0,i=parseFloat(r.height)||0,c=Math.max(t.width,a,l),g=Math.max(t.height,p,i),u=c-t.width,P=g-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-P/2,bottom:t.bottom+P/2}}const Lt=2,es={...An,...Bn},ts=s.forwardRef(function(t,n){const{render:r,className:f,nativeButton:a=!0,disabled:p=!1,...l}=t,{state:i,disabled:c,setTouched:g,setFocused:u,validationMode:P,validation:h}=yt(),{labelId:O}=dn(),m=Ke(),x=y(m,C.selectionMode),d=y(m,C.disabled),o=y(m,C.readOnly),M=y(m,C.listElement),I=y(m,C.triggerProps),w=y(m,C.triggerElement),v=y(m,C.inputInsidePopup),R=y(m,C.open),T=y(m,C.selectedValue),z=y(m,C.activeIndex),re=y(m,C.selectedIndex),q=_t(),ie=cn(),X=On(),K=c||d||p,S=s.useRef("");function U(A){S.current=A.pointerType}const ae=q.select("domReferenceElement");s.useEffect(()=>{v&&w&&w!==ae&&q.set("domReferenceElement",w)},[w,ae,q,v]);const{reference:ye}=Fo(q,{enabled:!R&&!o&&!d&&x==="single",listRef:m.state.labelsRef,activeIndex:z,selectedIndex:re,onMatch(A){const de=m.state.valuesRef.current[A];de!==void 0&&m.state.setSelectedValue(de,te("none"))}}),{reference:Z}=Ln(q,{enabled:!o&&!d,event:"mousedown"}),{buttonRef:k,getButtonProps:G}=sn({native:a,disabled:K}),pe=s.useMemo(()=>({...i,open:R,disabled:K}),[i,R,K]),J=ce(A=>{m.set("triggerElement",A)});return Be("button",t,{ref:[n,k,J],state:pe,props:[I,Z,ye,{tabIndex:v?0:-1,disabled:K,role:v?"combobox":void 0,"aria-expanded":R?"true":"false","aria-haspopup":v?"dialog":"listbox","aria-controls":R?M?.id:void 0,"aria-readonly":o||void 0,"aria-labelledby":O,onPointerDown:U,onPointerEnter:U,onFocus(){u(!0),!(K||o)&&X.start(0,m.state.forceMount)},onBlur(){if(g(!0),u(!1),P==="onBlur"){const A=x==="none"?ie:T;h.commit(A)}},onMouseDown(A){if(K||o||(v||q.set("domReferenceElement",A.currentTarget),m.state.forceMount(),S.current!=="touch"&&(m.state.inputRef.current?.focus(),v||A.preventDefault()),R))return;const de=oo(A.currentTarget);function le(ue){if(!w)return;const me=xt(ue),E=m.state.positionerElement,_=m.state.listElement;if(qe(w,me)||qe(E,me)||qe(_,me)||me===w)return;const W=Zo(w),Ce=ue.clientX>=W.left-Lt&&ue.clientX<=W.right+Lt,ve=ue.clientY>=W.top-Lt&&ue.clientY<=W.bottom+Lt;Ce&&ve||m.state.setOpen(!1,te("cancel-open",ue))}v&&de.addEventListener("mouseup",le,{once:!0})},onKeyDown(A){K||o||(A.key==="ArrowDown"||A.key==="ArrowUp")&&(be(A),m.state.setOpen(!0,te(Nt,A.nativeEvent)),m.state.inputRef.current?.focus())}},h?h.getValidationProps(l):l,G],stateAttributesMapping:es})}),ns=s.createContext(void 0);function rs(){return s.useContext(ns)}const Un=s.createContext(void 0);function fn(e){const t=s.useContext(Un);if(t===void 0&&!e)throw new Error(rt(21));return t}const os={...An,...Bn,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},ss=s.forwardRef(function(t,n){const{render:r,className:f,disabled:a=!1,id:p,...l}=t,{state:i,disabled:c,setTouched:g,setFocused:u,validationMode:P,validation:h}=yt(),{labelId:O}=dn(),m=rs(),d=!!fn(!0),o=Ke(),{filteredItems:M}=ot(),I=cn(),w=kn(p),v=fo(),R=y(o,C.disabled),T=y(o,C.readOnly),z=y(o,C.name),re=y(o,C.selectionMode),q=y(o,C.autoHighlight),ie=y(o,C.inputProps),X=y(o,C.triggerProps),K=y(o,C.open),S=y(o,C.mounted),U=y(o,C.selectedValue),ae=y(o,C.popupSide),ye=y(o,C.positionerElement),Z=!!q,k=S&&ye?ae:null,G=c||R||a,pe=M.length===0,[J,Q]=s.useState(null),A=s.useRef(!1),de=ce(E=>{const _=d||o.state.inline;_&&!o.state.hasInputValue&&o.state.setInputValue("",te(je)),o.update({inputElement:E,inputInsidePopup:_})}),le=s.useMemo(()=>({...i,open:K,disabled:G,readOnly:T,popupSide:k,listEmpty:pe}),[i,K,G,T,k,pe]);function ue(E){if(!m)return;let _;const{highlightedChipIndex:W}=m;if(W!==void 0){if(E.key==="ArrowLeft")E.preventDefault(),W>0?_=W-1:_=void 0;else if(E.key==="ArrowRight")E.preventDefault(),W<U.length-1?_=W+1:_=void 0;else if(E.key==="Backspace"||E.key==="Delete"){E.preventDefault();const Ce=W>=U.length-1?U.length-2:W;_=Ce>=0?Ce:void 0,o.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return _}return E.key==="ArrowLeft"&&(E.currentTarget.selectionStart??0)===0&&U.length>0?(E.preventDefault(),_=Math.max(U.length-1,0)):E.key==="Backspace"&&E.currentTarget.value===""&&U.length>0&&(o.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),E.preventDefault()),_}return Be("input",t,{state:le,ref:[n,o.state.inputRef,de],props:[ie,X,{type:"text",value:t.value??J??I,"aria-readonly":T||void 0,"aria-labelledby":O,disabled:G,readOnly:T,...re==="none"&&z&&{name:z},id:w,onFocus(){u(!0)},onBlur(){if(g(!0),u(!1),P==="onBlur"){const E=re==="none"?I:U;h.commit(E)}},onCompositionStart(E){io||(A.current=!0,Q(E.currentTarget.value))},onCompositionEnd(E){A.current=!1;const _=E.currentTarget.value;Q(null),o.state.setInputValue(_,te(nt,E.nativeEvent))},onChange(E){if(A.current){const ve=E.currentTarget.value;Q(ve),ve===""&&!o.state.openOnInputClick&&!o.state.inputInsidePopup&&o.state.setOpen(!1,te(We,E.nativeEvent));const Y=ve.trim(),we=Z&&Y!=="";!T&&!G&&Y!==""&&(o.state.setOpen(!0,te(nt,E.nativeEvent)),Z||o.state.setIndices({activeIndex:null,selectedIndex:null,type:o.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&o.state.activeIndex!==null&&!we&&o.state.setIndices({activeIndex:null,selectedIndex:null,type:o.state.keyboardActiveRef.current?"keyboard":"pointer"});return}o.state.setInputValue(E.currentTarget.value,te(nt,E.nativeEvent));const _=E.currentTarget.value==="",W=te(We,E.nativeEvent);_&&!o.state.inputInsidePopup&&(re==="single"&&o.state.setSelectedValue(null,W),o.state.openOnInputClick||o.state.setOpen(!1,W));const Ce=E.currentTarget.value.trim();!T&&!G&&Ce!==""&&(o.state.setOpen(!0,te(nt,E.nativeEvent)),Z||o.state.setIndices({activeIndex:null,selectedIndex:null,type:o.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&o.state.activeIndex!==null&&!Z&&o.state.setIndices({activeIndex:null,selectedIndex:null,type:o.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(E){if(G||T||E.ctrlKey||E.shiftKey||E.altKey||E.metaKey)return;o.state.keyboardActiveRef.current=!0;const _=E.currentTarget,W=_.scrollWidth-_.clientWidth,Ce=v==="rtl";if(E.key==="Home"){be(E);const Y=vn&&Ce?_.value.length:0;_.setSelectionRange(Y,Y),_.scrollLeft=0;return}if(E.key==="End"){be(E);const Y=vn&&Ce?0:_.value.length;_.setSelectionRange(Y,Y),_.scrollLeft=Ce?-W:W;return}if(!S&&E.key==="Escape"){const Y=re==="multiple"&&Array.isArray(U)?U.length===0:U===null,we=te(so,E.nativeEvent),Oe=re==="multiple"?[]:null;o.state.setInputValue("",we),o.state.setSelectedValue(Oe,we),!Y&&!o.state.inline&&!we.isPropagationAllowed&&E.stopPropagation();return}if(m&&E.key==="Backspace"&&_.value===""&&m.highlightedChipIndex===void 0&&Array.isArray(U)&&U.length>0){const Y=U.slice(0,-1);o.state.setIndices({activeIndex:null,selectedIndex:null,type:o.state.keyboardActiveRef.current?"keyboard":"pointer"}),o.state.setSelectedValue(Y,te(je,E.nativeEvent));return}const ve=ue(E);if(m?.setHighlightedChipIndex(ve),ve!==void 0?m?.chipsRef.current[ve]?.focus():o.state.inputRef.current?.focus(),E.which!==229&&E.key==="Enter"&&K){const Y=o.state.activeIndex,we=E.nativeEvent;if(Y===null){o.state.setOpen(!1,te(je,we));return}be(E);const Oe=o.state.listRef.current[Y];Oe&&(o.state.selectionEventRef.current=we,Oe.click(),o.state.selectionEventRef.current=null)}},onPointerMove(){o.state.keyboardActiveRef.current=!1},onPointerDown(){o.state.keyboardActiveRef.current=!1}},h?h.getValidationProps(l):l],stateAttributesMapping:os})}),is={...un,...ao},as=s.forwardRef(function(t,n){const{render:r,className:f,disabled:a=!1,nativeButton:p=!0,keepMounted:l=!1,...i}=t,{disabled:c}=yt(),g=Ke(),u=y(g,C.selectionMode),P=y(g,C.disabled),h=y(g,C.readOnly),O=y(g,C.open),m=y(g,C.selectedValue),x=cn();let d=!1;u==="none"?d=x!=="":u==="single"?d=m!=null:d=Array.isArray(m)&&m.length>0;const o=c||P||a,{buttonRef:M,getButtonProps:I}=sn({native:p,disabled:o}),{mounted:w,transitionStatus:v,setMounted:R}=ln(d),T=s.useMemo(()=>({disabled:o,open:O,transitionStatus:v}),[o,O,v]);Ft({open:d,ref:g.state.clearRef,onComplete(){d||R(!1)}});const z=Be("button",t,{state:T,ref:[n,M,g.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:o,"aria-readonly":h||void 0,onMouseDown(q){q.preventDefault()},onClick(q){if(o||h)return;const ie=g.state.keyboardActiveRef;g.state.setInputValue("",te(Rn,q.nativeEvent)),u!=="none"?(g.state.setSelectedValue(Array.isArray(m)?[]:null,te(Rn,q.nativeEvent)),g.state.setIndices({activeIndex:null,selectedIndex:null,type:ie.current?"keyboard":"pointer"})):g.state.setIndices({activeIndex:null,type:ie.current?"keyboard":"pointer"}),g.state.inputRef.current?.focus()}},i,I],stateAttributesMapping:is});return l||w?z:null}),ls=s.createContext(null);function us(){return s.useContext(ls)}function cs(e){const{children:t}=e,{filteredItems:n}=ot(),r=us(),f=r?r.items:n;return f?j.jsx(s.Fragment,{children:f.map(t)}):null}const ds=s.forwardRef(function(t,n){var r;const{render:f,className:a,children:p,...l}=t,i=Ke(),c=_t(),g=!!fn(!0),{filteredItems:u}=ot(),P=y(i,C.items),h=y(i,C.labelsRef),O=y(i,C.listRef),m=y(i,C.selectionMode),x=y(i,C.grid),d=y(i,C.popupProps),o=y(i,C.disabled),M=y(i,C.readOnly),I=y(i,C.virtualized),w=m==="multiple",v=u.length===0,R=ce(X=>{i.set("positionerElement",X)}),T=ce(X=>{i.set("listElement",X)}),z=s.useMemo(()=>typeof p=="function"?r||(r=j.jsx(cs,{children:p})):p,[p]),re=s.useMemo(()=>({empty:v}),[v]),q=c.useState("floatingId"),ie=Be("div",t,{state:re,ref:[n,T,g?null:R],props:[d,{children:z,tabIndex:-1,id:q,role:x?"grid":"listbox","aria-multiselectable":w?"true":void 0,onKeyDown(X){if(!(o||M)&&X.key==="Enter"){const K=i.state.activeIndex;if(K==null)return;be(X);const S=X.nativeEvent,U=i.state.listRef.current[K];U&&(i.state.selectionEventRef.current=S,U.click(),i.state.selectionEventRef.current=null)}},onKeyDownCapture(){i.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){i.state.keyboardActiveRef.current=!1}},l]});return I?ie:j.jsx(Eo,{elementsRef:O,labelsRef:P?void 0:h,children:ie})}),Gn=s.createContext(void 0);function fs(){const e=s.useContext(Gn);if(e===void 0)throw new Error(rt(20));return e}const ps=s.forwardRef(function(t,n){const{keepMounted:r=!1,...f}=t,a=Ke(),p=y(a,C.mounted),l=y(a,C.forceMounted);return p||r||l?j.jsx(Gn.Provider,{value:r,children:j.jsx(lo,{ref:n,...f})}):null}),ms=s.forwardRef(function(t,n){const{render:r,className:f,anchor:a,positionMethod:p="absolute",side:l="bottom",align:i="center",sideOffset:c=0,alignOffset:g=0,collisionBoundary:u="clipping-ancestors",collisionPadding:P=5,arrowPadding:h=5,sticky:O=!1,disableAnchorTracking:m=!1,collisionAvoidance:x=uo,...d}=t,o=Ke(),{filteredItems:M}=ot(),I=_t(),w=fs(),v=y(o,C.modal),R=y(o,C.open),T=y(o,C.mounted),z=y(o,C.openMethod),re=y(o,C.triggerElement),q=y(o,C.inputElement),ie=y(o,C.inputInsidePopup),X=M.length===0,S=po({anchor:a??(ie?re:q),floatingRootContext:I,positionMethod:p,mounted:T,side:l,sideOffset:c,align:i,alignOffset:g,arrowPadding:h,collisionBoundary:u,collisionPadding:P,sticky:O,disableAnchorTracking:m,keepMounted:w,collisionAvoidance:x,lazyFlip:!0});bo(R&&v&&z!=="touch",re);const U=s.useMemo(()=>{const G={...S.positionerStyles};return R||(G.pointerEvents="none"),{role:"presentation",hidden:!T,style:G}},[R,T,S.positionerStyles]),ae=s.useMemo(()=>({open:R,side:S.side,align:S.align,anchorHidden:S.anchorHidden,empty:X}),[R,S.side,S.align,S.anchorHidden,X]);ne(()=>{o.set("popupSide",S.side)},[o,S.side]);const ye=s.useMemo(()=>({side:S.side,align:S.align,arrowRef:S.arrowRef,arrowUncentered:S.arrowUncentered,arrowStyles:S.arrowStyles,anchorHidden:S.anchorHidden,isPositioned:S.isPositioned}),[S.side,S.align,S.arrowRef,S.arrowUncentered,S.arrowStyles,S.anchorHidden,S.isPositioned]),Z=ce(G=>{o.set("positionerElement",G)}),k=Be("div",t,{state:ae,ref:[n,Z],props:[U,d],stateAttributesMapping:Tn});return j.jsxs(Un.Provider,{value:ye,children:[T&&v&&j.jsx(xo,{inert:Io(!R),cutout:q??re}),k]})}),gs={...Tn,...un},hs=s.forwardRef(function(t,n){const{render:r,className:f,initialFocus:a,finalFocus:p,...l}=t,i=Ke(),c=fn(),g=_t(),{filteredItems:u}=ot(),P=y(i,C.mounted),h=y(i,C.open),O=y(i,C.openMethod),m=y(i,C.transitionStatus),x=y(i,C.inputInsidePopup),d=y(i,C.inputElement),o=u.length===0;Ft({open:h,ref:i.state.popupRef,onComplete(){h&&i.state.onOpenChangeComplete(!0)}});const M=s.useMemo(()=>({open:h,side:c.side,align:c.align,anchorHidden:c.anchorHidden,transitionStatus:m,empty:o}),[h,c.side,c.align,c.anchorHidden,m,o]),I=Be("div",t,{state:M,ref:[n,i.state.popupRef],props:[{role:x?"dialog":"presentation",tabIndex:-1,onFocus(T){const z=xt(T.nativeEvent);O!=="touch"&&(qe(i.state.listElement,z)||z===T.currentTarget)&&i.state.inputRef.current?.focus()}},mo(m),l],stateAttributesMapping:gs}),v=a===void 0?x?T=>T==="touch"?i.state.popupRef.current:d:!1:a;let R;return p!=null?R=p:R=x?void 0:!1,j.jsx(yo,{context:g,disabled:!P,modal:!x,openInteractionType:O,initialFocus:v,returnFocus:R,children:I})}),Wn=s.createContext(void 0);function $n(){const e=s.useContext(Wn);if(!e)throw new Error(rt(19));return e}const bs=s.createContext(!1);function xs(){return s.useContext(bs)}const Is=s.memo(s.forwardRef(function(t,n){const{render:r,className:f,value:a=null,index:p,disabled:l=!1,nativeButton:i=!1,...c}=t,g=s.useRef(!1),u=s.useRef(null),P=So({index:p,textRef:u,indexGuessBehavior:Fn.GuessFromOrder}),h=Ke(),O=xs(),{flatFilteredItems:m}=ot(),x=y(h,C.open),d=y(h,C.selectionMode),o=y(h,C.readOnly),M=y(h,C.virtualized),I=y(h,C.isItemEqualToValue),w=d!=="none",v=p??(M?rn(m,a,I):P.index),R=P.index!==-1,T=y(h,C.id),z=y(h,C.isActive,v),re=y(h,C.isSelected,a),q=y(h,C.items),ie=y(h,C.getItemProps),X=s.useRef(null),K=T!=null&&R?`${T}-${v}`:void 0,S=re&&w;ne(()=>{if(!(R&&(M||p!=null)))return;const A=h.state.listRef.current;return A[v]=X.current,()=>{delete A[v]}},[R,M,v,p,h]),ne(()=>{if(!R||q)return;const Q=h.state.valuesRef.current;return Q[v]=a,d!=="none"&&h.state.allValuesRef.current.push(a),()=>{delete Q[v]}},[R,q,v,a,h,d]),ne(()=>{if(!x){g.current=!1;return}if(!R||q)return;const Q=h.state.selectedValue,A=Array.isArray(Q)?Q[Q.length-1]:Q;at(A,a,I)&&h.set("selectedIndex",v)},[R,q,x,h,v,a,I]);const U=s.useMemo(()=>({disabled:l,selected:S,highlighted:z}),[l,S,z]),ae=ie({active:z,selected:S});ae.id=void 0,ae.onFocus=void 0;const{getButtonProps:ye,buttonRef:Z}=sn({disabled:l,focusableWhenDisabled:!0,native:i});function k(Q){function A(){h.state.handleSelection(Q,a)}h.state.submitOnItemClick?(Sn.flushSync(A),h.state.requestSubmit()):A()}const G={id:K,role:O?"gridcell":"option","aria-disabled":l||void 0,"aria-selected":w?S:void 0,tabIndex:void 0,onPointerDownCapture(Q){g.current=!0,Q.preventDefault()},onClick(Q){l||o||k(Q.nativeEvent)},onMouseUp(Q){const A=g.current;g.current=!1,!(l||o||Q.button!==0||A||!z)&&k(Q.nativeEvent)}},pe=Be("div",t,{ref:[Z,n,P.ref,X],state:U,props:[ae,G,c,ye]}),J=s.useMemo(()=>({selected:S,textRef:u}),[S,u]);return j.jsx(Wn.Provider,{value:J,children:pe})})),ys=s.forwardRef(function(t,n){const{render:r,className:f,children:a,...p}=t,{filteredItems:l}=ot(),i=Ke(),c=l.length===0?a:null;return Be("div",t,{ref:[n,i.state.emptyRef],props:[{children:c,role:"status","aria-live":"polite","aria-atomic":!0},p]})});function Cs(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:f,...a}=e;return j.jsx(Xo,{...a,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:f})}const vs=s.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:f}=$n();return r||f?j.jsx(Rs,{...t,ref:n}):null}),Rs=s.memo(s.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:f,...a}=e,{selected:p}=$n(),l=s.useRef(null),{transitionStatus:i,setMounted:c}=ln(p),g=s.useMemo(()=>({selected:p,transitionStatus:i}),[p,i]),u=Be("span",e,{ref:[t,l],state:g,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:un});return Ft({open:p,ref:l,onComplete(){p||c(!1)}}),u}));const Es=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Hs=hr("save",Es);function Ps(e){const t=lt.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=j.jsx("path",{d:"M9.1603 1.12218C9.50684 1.34873 9.60427 1.81354 9.37792 2.16038L5.13603 8.66012C5.01614 8.8438 4.82192 8.96576 4.60451 8.99384C4.3871 9.02194 4.1683 8.95335 4.00574 8.80615L1.24664 6.30769C0.939709 6.02975 0.916013 5.55541 1.19372 5.24822C1.47142 4.94102 1.94536 4.91731 2.2523 5.19524L4.36085 7.10461L8.12299 1.33999C8.34934 0.993152 8.81376 0.895638 9.1603 1.12218Z"}),t[0]=n):n=t[0];let r;return t[1]!==e?(r=j.jsx("svg",{fill:"currentcolor",width:"10",height:"10",viewBox:"0 0 10 10",...e,children:n}),t[1]=e,t[2]=r):r=t[2],r}function ws(e){const t=lt.c(4);let n,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=j.jsx("path",{d:"M18 6L6 18"}),r=j.jsx("path",{d:"M6 6l12 12"}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let f;return t[2]!==e?(f=j.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[n,r]}),t[2]=e,t[3]=f):f=t[3],f}function Ms(e){const t=lt.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=j.jsx("path",{d:"M6 9l6 6 6-6"}),t[0]=n):n=t[0];let r;return t[1]!==e?(r=j.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:n}),t[1]=e,t[2]=r):r=t[2],r}function qs(e){const t=lt.c(44),{items:n,label:r,placeholder:f,id:a,value:p,defaultValue:l,onValueChange:i,disabled:c,className:g,itemToString:u,itemToIcon:P,variant:h}=e,O=f===void 0?"Search...":f,m=c===void 0?!1:c,x=h===void 0?"default":h,d=s.useId(),o=a||d,M=x==="inline",I=M?Pr:wr,w=M?br:xr,v=m&&(M?Ir:yr);let R;t[0]!==w||t[1]!==v?(R=Vt(w,v),t[0]=w,t[1]=v,t[2]=R):R=t[2];const T=R,z=M?Cr:vr,re=m&&(M?Rr:Er);let q;t[3]!==z||t[4]!==re?(q=Vt(z,re),t[3]=z,t[4]=re,t[5]=q):q=t[5];const ie=q,X=M?Sr:Vr;let K;t[6]!==i?(K=(_,W)=>{i?.(_)},t[6]=i,t[7]=K):K=t[7];const S=K,U=p!==void 0,ae=U?p??void 0:void 0,ye=U?void 0:l??void 0;let Z;t[8]!==g||t[9]!==I?(Z=Vt(I,g),t[8]=g,t[9]=I,t[10]=Z):Z=t[10];let k;t[11]!==o||t[12]!==r?(k=r&&j.jsx("label",{htmlFor:o,children:r}),t[11]=o,t[12]=r,t[13]=k):k=t[13];let G;t[14]!==o||t[15]!==ie||t[16]!==O?(G=j.jsx(ss,{placeholder:O,id:o,className:ie}),t[14]=o,t[15]=ie,t[16]=O,t[17]=G):G=t[17];let pe;t[18]===Symbol.for("react.memo_cache_sentinel")?(pe=Vt(Mr,"combobox-clear"),t[18]=pe):pe=t[18];let J;t[19]===Symbol.for("react.memo_cache_sentinel")?(J=j.jsx(as,{className:pe,"aria-label":"Clear selection",children:j.jsx(ws,{className:In})}),t[19]=J):J=t[19];let Q;t[20]===Symbol.for("react.memo_cache_sentinel")?(Q=j.jsx(ts,{className:Or,"aria-label":"Open popup",children:j.jsx(Ms,{className:In})}),t[20]=Q):Q=t[20];let A;t[21]!==X?(A=j.jsxs("div",{className:X,children:[J,Q]}),t[21]=X,t[22]=A):A=t[22];let de;t[23]!==G||t[24]!==A||t[25]!==T?(de=j.jsxs("div",{className:T,children:[G,A]}),t[23]=G,t[24]=A,t[25]=T,t[26]=de):de=t[26];let le;t[27]!==Z||t[28]!==k||t[29]!==de?(le=j.jsxs("div",{className:Z,children:[k,de]}),t[27]=Z,t[28]=k,t[29]=de,t[30]=le):le=t[30];let ue;t[31]===Symbol.for("react.memo_cache_sentinel")?(ue=j.jsx(ys,{className:kr,children:"No items found."}),t[31]=ue):ue=t[31];let me;t[32]!==P||t[33]!==u?(me=j.jsx(ps,{children:j.jsx(ms,{className:Ar,sideOffset:4,children:j.jsxs(hs,{className:Tr,children:[ue,j.jsx(ds,{className:Lr,children:_=>{const W=!!P;return j.jsxs(Is,{value:_,className:Nr({withIcon:W}),children:[j.jsx(vs,{className:Dr({withIcon:W}),children:j.jsx(Ps,{className:Fr})}),P&&j.jsx("div",{className:jr({withIcon:W}),children:P(_)}),j.jsx("div",{className:_r({withIcon:W}),children:u?u(_):String(_)})]},u?u(_):String(_))}})]})})}),t[32]=P,t[33]=u,t[34]=me):me=t[34];let E;return t[35]!==m||t[36]!==S||t[37]!==u||t[38]!==n||t[39]!==ae||t[40]!==ye||t[41]!==le||t[42]!==me?(E=j.jsxs(Cs,{items:n,value:ae,defaultValue:ye,onValueChange:S,disabled:m,itemToStringLabel:u,children:[le,me]}),t[35]=m,t[36]=S,t[37]=u,t[38]=n,t[39]=ae,t[40]=ye,t[41]=le,t[42]=me,t[43]=E):E=t[43],E}var Bs="_1oq6p8e0",Ks="_1oq6p8e1",zs="_1oq6p8e3",Us="_1oq6p8e4",Gs="_1oq6p8e5",Ws="_1oq6p8e6",$s="_1oq6p8e7",Qs="_1oq6p8e8",Ys="_1oq6p8e9";const Ss=e=>["variant-versions",e],Vs=e=>qr({queryKey:Ss(e),queryFn:async()=>{const n=await(await Vn.v1.variants[":id"].versions.$get({param:{id:e}})).json();return"data"in n?n.data:[]},enabled:!!e,staleTime:1e3*60*5}),Js=e=>{const t=lt.c(2);let n;return t[0]!==e?(n=Vs(e),t[0]=e,t[1]=n):n=t[1],Hr(n)},Xs=()=>{const e=lt.c(2),t=Br();let n;return e[0]!==t?(n={mutationFn:Os,onSuccess:(r,f)=>{t.invalidateQueries({queryKey:vo(f.configId)})}},e[0]=t,e[1]=n):n=e[1],Co(n)};async function Os(e){const t=await Vn.v1.targeting.set.$post({json:{environmentId:e.environmentId,configId:e.configId,configVariantId:e.configVariantId,variantVersionId:e.variantVersionId}}),n=await t.json();if(!t.ok||!("data"in n))throw new Error("message"in n?n.message:"Failed to set targeting");return n.data}export{Eo as C,Hs as S,Do as a,Fo as b,yt as c,dn as d,Zt as e,zo as f,Zo as g,Go as h,qs as i,Gs as j,Ys as k,Ws as l,Qs as m,Us as n,Ss as o,Xs as p,Js as q,Bs as r,Ks as s,zs as t,So as u,$s as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-BCY9aD4r.js";var r="tye0o0",t="tye0o1";export{r as a,t as v};
|