dccxx-s3-explorer 1.0.21 → 1.0.22
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/s3-explorer.js +4015 -4396
- package/dist/s3-explorer.js.map +1 -1
- package/dist/s3-explorer.umd.cjs +33 -38
- package/dist/s3-explorer.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/s3-explorer.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Le,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(Le=typeof globalThis<"u"?globalThis:Le||self,l(Le.S3Explorer={},Le.jsxRuntime,Le.React,Le.ReactDOM))})(this,function(Le,l,
|
|
1
|
+
(function(Le,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(Le=typeof globalThis<"u"?globalThis:Le||self,l(Le.S3Explorer={},Le.jsxRuntime,Le.React,Le.ReactDOM))})(this,function(Le,l,O,Yr){"use strict";function gi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=gi(O),Hn=gi(Yr);function Cd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const hi=d.forwardRef(Cd);function Sd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const Ed=d.forwardRef(Sd);function Nd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const Td=d.forwardRef(Nd);function Pd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Ad=d.forwardRef(Pd);function _d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Zr=d.forwardRef(_d);function Fd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const Od=d.forwardRef(Fd);function Dd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const Md=d.forwardRef(Dd);function $d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const mi=d.forwardRef($d);/**
|
|
2
2
|
* table-core
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) TanStack
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* LICENSE.md file in the root directory of this source tree.
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/function
|
|
10
|
+
*/function vt(e,t){return typeof e=="function"?e(t):e}function Fe(e,t){return n=>{t.setState(r=>({...r,[e]:vt(n,r[e])}))}}function zn(e){return e instanceof Function}function kd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Id(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function J(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((f,g)=>r[g]!==f)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-c)*100)/100,m=g/16,p=(v,h)=>{for(v=String(v);v.length<h;)v=" "+v;return v};console.info(`%c⏱ ${p(g,5)} /${p(f,5)} ms`,`
|
|
11
11
|
font-size: .6rem;
|
|
12
12
|
font-weight: bold;
|
|
13
|
-
color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function J(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function uf(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:X(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),J(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function df(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let c=(o=(s=a.id)!=null?s:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:u&&(u.includes(".")?f=h=>{let p=h;for(const m of u.split(".")){var v;p=(v=p)==null?void 0:v[m],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${m}" in deeply nested key "${u}" returned undefined.`)}return p}:f=h=>h[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(c)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:X(()=>[!0],()=>{var h;return[g,...(h=g.columns)==null?void 0:h.flatMap(p=>p.getFlatColumns())]},J(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:X(()=>[e._getOrderColumnsFn()],h=>{var p;if((p=g.columns)!=null&&p.length){let v=g.columns.flatMap(m=>m.getLeafColumns());return h(v)}return[g]},J(e.options,"debugColumns","column.getLeafColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(g,e);return g}const be="debugHeaders";function Pi(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),i.push(u)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const ff={createTable:e=>{e.getHeaderGroups=X(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(g=>n.find(h=>h.id===g)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(g=>n.find(h=>h.id===g)).filter(Boolean))!=null?i:[],c=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Gn(t,[...a,...c,...u],e)},J(e.options,be,"getHeaderGroups")),e.getCenterHeaderGroups=X(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Gn(t,n,e,"center")),J(e.options,be,"getCenterHeaderGroups")),e.getLeftHeaderGroups=X(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Gn(t,s,e,"left")},J(e.options,be,"getLeftHeaderGroups")),e.getRightHeaderGroups=X(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Gn(t,s,e,"right")},J(e.options,be,"getRightHeaderGroups")),e.getFooterGroups=X(()=>[e.getHeaderGroups()],t=>[...t].reverse(),J(e.options,be,"getFooterGroups")),e.getLeftFooterGroups=X(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),J(e.options,be,"getLeftFooterGroups")),e.getCenterFooterGroups=X(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),J(e.options,be,"getCenterFooterGroups")),e.getRightFooterGroups=X(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),J(e.options,be,"getRightFooterGroups")),e.getFlatHeaders=X(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,be,"getFlatHeaders")),e.getLeftFlatHeaders=X(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,be,"getLeftFlatHeaders")),e.getCenterFlatHeaders=X(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,be,"getCenterFlatHeaders")),e.getRightFlatHeaders=X(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,be,"getRightFlatHeaders")),e.getCenterLeafHeaders=X(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,be,"getCenterLeafHeaders")),e.getLeftLeafHeaders=X(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,be,"getLeftLeafHeaders")),e.getRightLeafHeaders=X(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,be,"getRightLeafHeaders")),e.getLeafHeaders=X(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,u,c;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(u=(c=r[0])==null?void 0:c.headers)!=null?u:[]].map(f=>f.getLeafHeaders()).flat()},J(e.options,be,"getLeafHeaders"))}};function Gn(e,t,n,r){var o,s;let i=0;const a=function(h,p){p===void 0&&(p=1),i=Math.max(i,p),h.filter(v=>v.getIsVisible()).forEach(v=>{var m;(m=v.columns)!=null&&m.length&&a(v.columns,p+1)},0)};a(e);let u=[];const c=(h,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},m=[];h.forEach(y=>{const w=[...m].reverse()[0],C=y.column.depth===v.depth;let N,P=!1;if(C&&y.column.parent?N=y.column.parent:(N=y.column,P=!0),w&&(w==null?void 0:w.column)===N)w.subHeaders.push(y);else{const b=Pi(n,N,{id:[r,p,N.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:P,placeholderId:P?`${m.filter(S=>S.column===N).length}`:void 0,depth:p,index:m.length});b.subHeaders.push(y),m.push(b)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(m,p-1)},f=t.map((h,p)=>Pi(n,h,{depth:i,index:p}));c(f,i-1),u.reverse();const g=h=>h.filter(v=>v.column.getIsVisible()).map(v=>{let m=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],g(v.subHeaders).forEach(N=>{let{colSpan:P,rowSpan:b}=N;m+=P,w.push(b)})):m=1;const C=Math.min(...w);return y=y+C,v.colSpan=m,v.rowSpan=y,{colSpan:m,rowSpan:y}});return g((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const to=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return a._valuesCache[u]=c.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var c;return(c=a.getValue(u))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>cf(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],c=a;for(;;){const f=c.getParentRow();if(!f)break;u.push(f),c=f}return u.reverse()},getAllCells:X(()=>[e.getAllLeafColumns()],u=>u.map(c=>uf(e,a,c,c.id)),J(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:X(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),J(e.options,"debugRows","getAllCellsByColumnId"))};for(let u=0;u<e._features.length;u++){const c=e._features[u];c==null||c.createRow==null||c.createRow(a,e)}return a},pf={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Ti=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};Ti.autoRemove=e=>Ve(e);const Ai=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ai.autoRemove=e=>Ve(e);const _i=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};_i.autoRemove=e=>Ve(e);const Fi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Fi.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Oi=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Oi.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Di=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Di.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Mi=(e,t,n)=>e.getValue(t)===n;Mi.autoRemove=e=>Ve(e);const ki=(e,t,n)=>e.getValue(t)==n;ki.autoRemove=e=>Ve(e);const no=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};no.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]},no.autoRemove=e=>Ve(e)||Ve(e[0])&&Ve(e[1]);const it={includesString:Ti,includesStringSensitive:Ai,equalsString:_i,arrIncludes:Fi,arrIncludesAll:Oi,arrIncludesSome:Di,equals:Mi,weakEquals:ki,inNumberRange:no};function Ve(e){return e==null||e===""}const gf={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Fe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?it.includesString:typeof r=="number"?it.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?it.equals:Array.isArray(r)?it.arrIncludes:it.weakEquals},e.getFilterFn=()=>{var n,r;return Un(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:it[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(f=>f.id===e.id),i=xt(n,s?s.value:void 0);if(Ii(o,i,e)){var a;return(a=r==null?void 0:r.filter(f=>f.id!==e.id))!=null?a:[]}const u={id:e.id,value:i};if(s){var c;return(c=r==null?void 0:r.map(f=>f.id===e.id?u:f))!=null?c:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=xt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Ii(u,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ii(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ro={sum:(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!lf(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},hf={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Fe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return ro.sum;if(Object.prototype.toString.call(r)==="[object Date]")return ro.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Un(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:ro[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function mf(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const vf={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Fe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=X(n=>[mn(t,n)],n=>n.findIndex(r=>r.id===e.id),J(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=mn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=mn(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=X(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const u=i.shift(),c=a.findIndex(f=>f.id===u);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return mf(s,n,r)},J(e.options,"debugTable","_getOrderColumnsFn"))}},oo=()=>({left:[],right:[]}),yf={getInitialState:e=>({columnPinning:oo(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Fe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,u;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var c,f;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=X(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},J(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=X(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),J(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=X(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),J(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?oo():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:oo())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=X(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),J(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=X(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),J(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=X(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},J(e.options,"debugColumns","getCenterLeafColumns"))}},jn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},so=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),wf={getDefaultColumnDef:()=>jn,getInitialState:e=>({columnSizing:{},columnSizingInfo:so(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Fe("columnSizing",e),onColumnSizingInfoChange:Fe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:jn.minSize,(r=s??e.columnDef.size)!=null?r:jn.size),(o=e.columnDef.maxSize)!=null?o:jn.maxSize)},e.getStart=X(n=>[n,mn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),J(t.options,"debugColumns","getStart")),e.getAfter=X(n=>[n,mn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),J(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),io(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=io(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,C)=>{typeof C=="number"&&(t.setColumnSizingInfo(N=>{var P,b;const S=t.options.columnResizeDirection==="rtl"?-1:1,E=(C-((P=N==null?void 0:N.startOffset)!=null?P:0))*S,$=Math.max(E/((b=N==null?void 0:N.startSize)!=null?b:0),-.999999);return N.columnSizingStart.forEach(G=>{let[H,Z]=G;c[H]=Math.round(Math.max(Z+Z*$,0)*100)/100}),{...N,deltaOffset:E,deltaPercentage:$}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(N=>({...N,...c})))},g=w=>f("move",w),h=w=>{f("end",w),t.setColumnSizingInfo(C=>({...C,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>g(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),h(w.clientX)}},m={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var C;p==null||p.removeEventListener("touchmove",m.moveHandler),p==null||p.removeEventListener("touchend",m.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),h((C=w.touches[0])==null?void 0:C.clientX)}},y=bf()?{passive:!1}:!1;io(s)?(p==null||p.addEventListener("touchmove",m.moveHandler,y),p==null||p.addEventListener("touchend",m.upHandler,y)):(p==null||p.addEventListener("mousemove",v.moveHandler,y),p==null||p.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?so():(n=e.initialState.columnSizingInfo)!=null?n:so())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Wn=null;function bf(){if(typeof Wn=="boolean")return Wn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Wn=e,Wn}function io(e){return e.type==="touchstart"}const xf={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Fe("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=X(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),J(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=X(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],J(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>X(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),J(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function mn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Cf={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Sf={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Fe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>it.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Un(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:it[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Ef={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Fe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...u}=i;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},ao=0,lo=10,co=()=>({pageIndex:ao,pageSize:lo}),Nf={getInitialState:e=>({...e,pagination:{...co(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Fe("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>xt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?co():(o=e.initialState.pagination)!=null?o:co())},e.setPageIndex=r=>{e.setPagination(o=>{let s=xt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?ao:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:ao)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?lo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:lo)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,xt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=xt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=X(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},J(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},uo=()=>({top:[],bottom:[]}),Pf={getInitialState:e=>({rowPinning:uo(),...e}),getDefaultOptions:e=>({onRowPinningChange:Fe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(u=>{let{id:c}=u;return c}):[],i=o?e.getParentRows().map(u=>{let{id:c}=u;return c}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(u=>{var c,f;if(n==="bottom"){var g,h;return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((h=u==null?void 0:u.bottom)!=null?h:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=u==null?void 0:u.top)!=null?p:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((v=u==null?void 0:u.bottom)!=null?v:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((c=u==null?void 0:u.top)!=null?c:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(m=>!(a!=null&&a.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?uo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:uo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=X(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),J(e.options,"debugRows","getTopRows")),e.getBottomRows=X(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),J(e.options,"debugRows","getBottomRows")),e.getCenterRows=X(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},J(e.options,"debugRows","getCenterRows"))}},Tf={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Fe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{fo(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=X(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?po(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=X(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?po(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=X(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?po(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return fo(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return go(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return ho(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return ho(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},fo=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>fo(e,a.id,n,r,o))};function po(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=go(u,n);if(f&&(r.push(u),o[u.id]=u),(c=u.subRows)!=null&&c.length&&(u={...u,subRows:s(u.subRows)}),f)return u}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function go(e,t){var n;return(n=t[e.id])!=null?n:!1}function ho(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(go(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=ho(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const mo=/([0-9]+)/gm,Af=(e,t,n)=>Ri(Ct(e.getValue(n)).toLowerCase(),Ct(t.getValue(n)).toLowerCase()),_f=(e,t,n)=>Ri(Ct(e.getValue(n)),Ct(t.getValue(n))),Ff=(e,t,n)=>vo(Ct(e.getValue(n)).toLowerCase(),Ct(t.getValue(n)).toLowerCase()),Of=(e,t,n)=>vo(Ct(e.getValue(n)),Ct(t.getValue(n))),Df=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Mf=(e,t,n)=>vo(e.getValue(n),t.getValue(n));function vo(e,t){return e===t?0:e>t?1:-1}function Ct(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ri(e,t){const n=e.split(mo).filter(Boolean),r=t.split(mo).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),u=[i,a].sort();if(isNaN(u[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(u[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const vn={alphanumeric:Af,alphanumericCaseSensitive:_f,text:Ff,textCaseSensitive:Of,datetime:Df,basic:Mf},kf=[ff,xf,vf,yf,pf,gf,Cf,Sf,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Fe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return vn.datetime;if(typeof s=="string"&&(r=!0,s.split(mo).length>1))return vn.alphanumeric}return r?vn.text:vn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Un(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:vn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(p=>p.id===e.id),u=i==null?void 0:i.findIndex(p=>p.id===e.id);let c=[],f,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?f="toggle":f="add":i!=null&&i.length&&u!==i.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var h;c=[...i,{id:e.id,desc:g}],c.splice(0,c.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(p=>p.id===e.id?{...p,desc:g}:p):f==="remove"?c=i.filter(p=>p.id!==e.id):c=[{id:e.id,desc:g}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},hf,Ef,Nf,Pf,Tf,wf];function If(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...kf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((h,p)=>Object.assign(h,p.getDefaultOptions==null?void 0:p.getDefaultOptions(o)),{}),i=h=>o.options.mergeOptions?o.options.mergeOptions(s,h):{...s,...h};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(h=>{var p;u=(p=h.getInitialState==null?void 0:h.getInitialState(u))!=null?p:u});const c=[];let f=!1;const g={_features:r,options:{...s,...e},initialState:u,_queue:h=>{c.push(h),f||(f=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{o.setState(o.initialState)},setOptions:h=>{const p=xt(h,o.options);o.options=i(p)},getState:()=>o.options.state,setState:h=>{o.options.onStateChange==null||o.options.onStateChange(h)},_getRowId:(h,p,v)=>{var m;return(m=o.options.getRowId==null?void 0:o.options.getRowId(h,p,v))!=null?m:`${v?[v.id,p].join("."):p}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(h,p)=>{let v=(p?o.getPrePaginationRowModel():o.getRowModel()).rowsById[h];if(!v&&(v=o.getCoreRowModel().rowsById[h],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return v},_getDefaultColumnDef:X(()=>[o.options.defaultColumn],h=>{var p;return h=(p=h)!=null?p:{},{header:v=>{const m=v.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:v=>{var m,y;return(m=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?m:null},...o._features.reduce((v,m)=>Object.assign(v,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...h}},J(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:X(()=>[o._getColumnDefs()],h=>{const p=function(v,m,y){return y===void 0&&(y=0),v.map(w=>{const C=df(o,w,y,m),N=w;return C.columns=N.columns?p(N.columns,C,y+1):[],C})};return p(h)},J(e,"debugColumns","getAllColumns")),getAllFlatColumns:X(()=>[o.getAllColumns()],h=>h.flatMap(p=>p.getFlatColumns()),J(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:X(()=>[o.getAllFlatColumns()],h=>h.reduce((p,v)=>(p[v.id]=v,p),{}),J(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:X(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(h,p)=>{let v=h.flatMap(m=>m.getLeafColumns());return p(v)},J(e,"debugColumns","getAllLeafColumns")),getColumn:h=>{const p=o._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!p&&console.error(`[Table] Column with id '${h}' does not exist.`),p}};Object.assign(o,g);for(let h=0;h<o._features.length;h++){const p=o._features[h];p==null||p.createTable==null||p.createTable(o)}return o}function $i(){return e=>X(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let c=0;c<o.length;c++){const f=to(e,e._getRowId(o[c],c,i),o[c],c,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var u;f.originalSubRows=e.options.getSubRows(o[c],c),(u=f.originalSubRows)!=null&&u.length&&(f.subRows=r(f.originalSubRows,s+1,f))}}return a};return n.rows=r(t),n},J(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Rf(e,t,n){return n.options.filterFromLeafRows?$f(e,t,n):Lf(e,t,n)}function $f(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let h=0;h<u.length;h++){var g;let p=u[h];const v=to(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(v.columnFilters=p.columnFilters,(g=p.subRows)!=null&&g.length&&c<i){if(v.subRows=a(p.subRows,c+1),p=v,t(p)&&!v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}if(t(p)||v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}}else p=v,t(p)&&(f.push(p),s[p.id]=p,o.push(p))}return f};return{rows:a(e),flatRows:o,rowsById:s}}function Lf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let h=0;h<u.length;h++){let p=u[h];if(t(p)){var g;if((g=p.subRows)!=null&&g.length&&c<i){const m=to(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);m.subRows=a(p.subRows,c+1),p=m}f.push(p),o.push(p),s[p.id]=p}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function Vf(){return e=>X(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h<t.flatRows.length;h++)t.flatRows[h].columnFilters={},t.flatRows[h].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(h=>{var p;const v=e.getColumn(h.id);if(!v)return;const m=v.getFilterFn();if(!m){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${v.id}.`);return}o.push({id:h.id,filterFn:m,resolvedValue:(p=m.resolveFilterValue==null?void 0:m.resolveFilterValue(h.value))!=null?p:h.value})});const i=(n??[]).map(h=>h.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&a&&u.length&&(i.push("__global__"),u.forEach(h=>{var p;s.push({id:h.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let c,f;for(let h=0;h<t.flatRows.length;h++){const p=t.flatRows[h];if(p.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const m=c.id;p.columnFilters[m]=c.filterFn(p,m,c.resolvedValue,y=>{p.columnFiltersMeta[m]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const m=f.id;if(f.filterFn(p,m,f.resolvedValue,y=>{p.columnFiltersMeta[m]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const g=h=>{for(let p=0;p<i.length;p++)if(h.columnFilters[i[p]]===!1)return!1;return!0};return Rf(t.rows,g,e)},J(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
|
|
13
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Y(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function Rd(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:J(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Y(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Ld(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let c=(o=(s=a.id)!=null?s:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:u&&(u.includes(".")?f=m=>{let p=m;for(const h of u.split(".")){var v;p=(v=p)==null?void 0:v[h],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`)}return p}:f=m=>m[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(c)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:J(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(p=>p.getFlatColumns())]},Y(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:J(()=>[e._getOrderColumnsFn()],m=>{var p;if((p=g.columns)!=null&&p.length){let v=g.columns.flatMap(h=>h.getLeafColumns());return m(v)}return[g]},Y(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const be="debugHeaders";function vi(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),i.push(u)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const Vd={createTable:e=>{e.getHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?i:[],c=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Un(t,[...a,...c,...u],e)},Y(e.options,be,"getHeaderGroups")),e.getCenterHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Un(t,n,e,"center")),Y(e.options,be,"getCenterHeaderGroups")),e.getLeftHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Un(t,s,e,"left")},Y(e.options,be,"getLeftHeaderGroups")),e.getRightHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Un(t,s,e,"right")},Y(e.options,be,"getRightHeaderGroups")),e.getFooterGroups=J(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Y(e.options,be,"getFooterGroups")),e.getLeftFooterGroups=J(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Y(e.options,be,"getLeftFooterGroups")),e.getCenterFooterGroups=J(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Y(e.options,be,"getCenterFooterGroups")),e.getRightFooterGroups=J(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Y(e.options,be,"getRightFooterGroups")),e.getFlatHeaders=J(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,be,"getFlatHeaders")),e.getLeftFlatHeaders=J(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,be,"getLeftFlatHeaders")),e.getCenterFlatHeaders=J(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,be,"getCenterFlatHeaders")),e.getRightFlatHeaders=J(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,be,"getRightFlatHeaders")),e.getCenterLeafHeaders=J(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,be,"getCenterLeafHeaders")),e.getLeftLeafHeaders=J(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,be,"getLeftLeafHeaders")),e.getRightLeafHeaders=J(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,be,"getRightLeafHeaders")),e.getLeafHeaders=J(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,u,c;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(u=(c=r[0])==null?void 0:c.headers)!=null?u:[]].map(f=>f.getLeafHeaders()).flat()},Y(e.options,be,"getLeafHeaders"))}};function Un(e,t,n,r){var o,s;let i=0;const a=function(m,p){p===void 0&&(p=1),i=Math.max(i,p),m.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&a(v.columns,p+1)},0)};a(e);let u=[];const c=(m,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},h=[];m.forEach(y=>{const w=[...h].reverse()[0],x=y.column.depth===v.depth;let E,T=!1;if(x&&y.column.parent?E=y.column.parent:(E=y.column,T=!0),w&&(w==null?void 0:w.column)===E)w.subHeaders.push(y);else{const C=vi(n,E,{id:[r,p,E.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:T,placeholderId:T?`${h.filter(N=>N.column===E).length}`:void 0,depth:p,index:h.length});C.subHeaders.push(y),h.push(C)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(h,p-1)},f=t.map((m,p)=>vi(n,m,{depth:i,index:p}));c(f,i-1),u.reverse();const g=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],g(v.subHeaders).forEach(E=>{let{colSpan:T,rowSpan:C}=E;h+=T,w.push(C)})):h=1;const x=Math.min(...w);return y=y+x,v.colSpan=h,v.rowSpan=y,{colSpan:h,rowSpan:y}});return g((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const Qr=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return a._valuesCache[u]=c.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var c;return(c=a.getValue(u))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Id(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],c=a;for(;;){const f=c.getParentRow();if(!f)break;u.push(f),c=f}return u.reverse()},getAllCells:J(()=>[e.getAllLeafColumns()],u=>u.map(c=>Rd(e,a,c,c.id)),Y(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:J(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),Y(e.options,"debugRows","getAllCellsByColumnId"))};for(let u=0;u<e._features.length;u++){const c=e._features[u];c==null||c.createRow==null||c.createRow(a,e)}return a},Bd={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},yi=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};yi.autoRemove=e=>Ve(e);const wi=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};wi.autoRemove=e=>Ve(e);const bi=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};bi.autoRemove=e=>Ve(e);const xi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};xi.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Ci=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Ci.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Si=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Si.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Ei=(e,t,n)=>e.getValue(t)===n;Ei.autoRemove=e=>Ve(e);const Ni=(e,t,n)=>e.getValue(t)==n;Ni.autoRemove=e=>Ve(e);const eo=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};eo.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]},eo.autoRemove=e=>Ve(e)||Ve(e[0])&&Ve(e[1]);const ot={includesString:yi,includesStringSensitive:wi,equalsString:bi,arrIncludes:xi,arrIncludesAll:Ci,arrIncludesSome:Si,equals:Ei,weakEquals:Ni,inNumberRange:eo};function Ve(e){return e==null||e===""}const Hd={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Fe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ot.includesString:typeof r=="number"?ot.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ot.equals:Array.isArray(r)?ot.arrIncludes:ot.weakEquals},e.getFilterFn=()=>{var n,r;return zn(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ot[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(f=>f.id===e.id),i=vt(n,s?s.value:void 0);if(Ti(o,i,e)){var a;return(a=r==null?void 0:r.filter(f=>f.id!==e.id))!=null?a:[]}const u={id:e.id,value:i};if(s){var c;return(c=r==null?void 0:r.map(f=>f.id===e.id?u:f))!=null?c:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=vt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Ti(u,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ti(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const to={sum:(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!kd(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},zd={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Fe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return to.sum;if(Object.prototype.toString.call(r)==="[object Date]")return to.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return zn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:to[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Ud(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const jd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Fe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=J(n=>[mn(t,n)],n=>n.findIndex(r=>r.id===e.id),Y(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=mn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=mn(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=J(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const u=i.shift(),c=a.findIndex(f=>f.id===u);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return Ud(s,n,r)},Y(e.options,"debugTable","_getOrderColumnsFn"))}},no=()=>({left:[],right:[]}),Wd={getInitialState:e=>({columnPinning:no(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Fe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,u;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var c,f;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},Y(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),Y(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),Y(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?no():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:no())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},Y(e.options,"debugColumns","getCenterLeafColumns"))}},jn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ro=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Gd={getDefaultColumnDef:()=>jn,getInitialState:e=>({columnSizing:{},columnSizingInfo:ro(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Fe("columnSizing",e),onColumnSizingInfoChange:Fe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:jn.minSize,(r=s??e.columnDef.size)!=null?r:jn.size),(o=e.columnDef.maxSize)!=null?o:jn.maxSize)},e.getStart=J(n=>[n,mn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Y(t.options,"debugColumns","getStart")),e.getAfter=J(n=>[n,mn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Y(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),oo(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=oo(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(E=>{var T,C;const N=t.options.columnResizeDirection==="rtl"?-1:1,S=(x-((T=E==null?void 0:E.startOffset)!=null?T:0))*N,A=Math.max(S/((C=E==null?void 0:E.startSize)!=null?C:0),-.999999);return E.columnSizingStart.forEach(B=>{let[H,K]=B;c[H]=Math.round(Math.max(K+K*A,0)*100)/100}),{...E,deltaOffset:S,deltaPercentage:A}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(E=>({...E,...c})))},g=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>g(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),m(w.clientX)}},h={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var x;p==null||p.removeEventListener("touchmove",h.moveHandler),p==null||p.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((x=w.touches[0])==null?void 0:x.clientX)}},y=qd()?{passive:!1}:!1;oo(s)?(p==null||p.addEventListener("touchmove",h.moveHandler,y),p==null||p.addEventListener("touchend",h.upHandler,y)):(p==null||p.addEventListener("mousemove",v.moveHandler,y),p==null||p.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ro():(n=e.initialState.columnSizingInfo)!=null?n:ro())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Wn=null;function qd(){if(typeof Wn=="boolean")return Wn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Wn=e,Wn}function oo(e){return e.type==="touchstart"}const Kd={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Fe("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=J(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Y(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=J(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Y(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>J(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Y(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function mn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Xd={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Jd={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Fe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ot.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return zn(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ot[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Yd={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Fe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...u}=i;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},so=0,io=10,ao=()=>({pageIndex:so,pageSize:io}),Zd={getInitialState:e=>({...e,pagination:{...ao(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Fe("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>vt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?ao():(o=e.initialState.pagination)!=null?o:ao())},e.setPageIndex=r=>{e.setPagination(o=>{let s=vt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?so:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:so)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?io:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:io)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,vt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=vt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=J(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Y(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},lo=()=>({top:[],bottom:[]}),Qd={getInitialState:e=>({rowPinning:lo(),...e}),getDefaultOptions:e=>({onRowPinningChange:Fe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(u=>{let{id:c}=u;return c}):[],i=o?e.getParentRows().map(u=>{let{id:c}=u;return c}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(u=>{var c,f;if(n==="bottom"){var g,m;return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(h=>!(a!=null&&a.has(h))),bottom:[...((m=u==null?void 0:u.bottom)!=null?m:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=u==null?void 0:u.top)!=null?p:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)],bottom:((v=u==null?void 0:u.bottom)!=null?v:[]).filter(h=>!(a!=null&&a.has(h)))}}return{top:((c=u==null?void 0:u.top)!=null?c:[]).filter(h=>!(a!=null&&a.has(h))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(h=>!(a!=null&&a.has(h)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?lo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:lo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Y(e.options,"debugRows","getTopRows")),e.getBottomRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Y(e.options,"debugRows","getBottomRows")),e.getCenterRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},Y(e.options,"debugRows","getCenterRows"))}},ef={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Fe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{co(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=J(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=J(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=J(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return co(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return fo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return po(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return po(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},co=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>co(e,a.id,n,r,o))};function uo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=fo(u,n);if(f&&(r.push(u),o[u.id]=u),(c=u.subRows)!=null&&c.length&&(u={...u,subRows:s(u.subRows)}),f)return u}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function fo(e,t){var n;return(n=t[e.id])!=null?n:!1}function po(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(fo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=po(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const go=/([0-9]+)/gm,tf=(e,t,n)=>Pi(yt(e.getValue(n)).toLowerCase(),yt(t.getValue(n)).toLowerCase()),nf=(e,t,n)=>Pi(yt(e.getValue(n)),yt(t.getValue(n))),rf=(e,t,n)=>ho(yt(e.getValue(n)).toLowerCase(),yt(t.getValue(n)).toLowerCase()),of=(e,t,n)=>ho(yt(e.getValue(n)),yt(t.getValue(n))),sf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},af=(e,t,n)=>ho(e.getValue(n),t.getValue(n));function ho(e,t){return e===t?0:e>t?1:-1}function yt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Pi(e,t){const n=e.split(go).filter(Boolean),r=t.split(go).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),u=[i,a].sort();if(isNaN(u[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(u[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const vn={alphanumeric:tf,alphanumericCaseSensitive:nf,text:rf,textCaseSensitive:of,datetime:sf,basic:af},lf=[Vd,Kd,jd,Wd,Bd,Hd,Xd,Jd,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Fe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return vn.datetime;if(typeof s=="string"&&(r=!0,s.split(go).length>1))return vn.alphanumeric}return r?vn.text:vn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return zn(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:vn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(p=>p.id===e.id),u=i==null?void 0:i.findIndex(p=>p.id===e.id);let c=[],f,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?f="toggle":f="add":i!=null&&i.length&&u!==i.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var m;c=[...i,{id:e.id,desc:g}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(p=>p.id===e.id?{...p,desc:g}:p):f==="remove"?c=i.filter(p=>p.id!==e.id):c=[{id:e.id,desc:g}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},zd,Yd,Zd,Qd,ef,Gd];function cf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...lf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,p)=>Object.assign(m,p.getDefaultOptions==null?void 0:p.getDefaultOptions(o)),{}),i=m=>o.options.mergeOptions?o.options.mergeOptions(s,m):{...s,...m};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(m=>{var p;u=(p=m.getInitialState==null?void 0:m.getInitialState(u))!=null?p:u});const c=[];let f=!1;const g={_features:r,options:{...s,...e},initialState:u,_queue:m=>{c.push(m),f||(f=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const p=vt(m,o.options);o.options=i(p)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,p,v)=>{var h;return(h=o.options.getRowId==null?void 0:o.options.getRowId(m,p,v))!=null?h:`${v?[v.id,p].join("."):p}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,p)=>{let v=(p?o.getPrePaginationRowModel():o.getRowModel()).rowsById[m];if(!v&&(v=o.getCoreRowModel().rowsById[m],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${m}`):new Error;return v},_getDefaultColumnDef:J(()=>[o.options.defaultColumn],m=>{var p;return m=(p=m)!=null?p:{},{header:v=>{const h=v.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:v=>{var h,y;return(h=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?h:null},...o._features.reduce((v,h)=>Object.assign(v,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...m}},Y(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:J(()=>[o._getColumnDefs()],m=>{const p=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const x=Ld(o,w,y,h),E=w;return x.columns=E.columns?p(E.columns,x,y+1):[],x})};return p(m)},Y(e,"debugColumns","getAllColumns")),getAllFlatColumns:J(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),Y(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:J(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),Y(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:J(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},Y(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const p=o._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!p&&console.error(`[Table] Column with id '${m}' does not exist.`),p}};Object.assign(o,g);for(let m=0;m<o._features.length;m++){const p=o._features[m];p==null||p.createTable==null||p.createTable(o)}return o}function Ai(){return e=>J(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let c=0;c<o.length;c++){const f=Qr(e,e._getRowId(o[c],c,i),o[c],c,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var u;f.originalSubRows=e.options.getSubRows(o[c],c),(u=f.originalSubRows)!=null&&u.length&&(f.subRows=r(f.originalSubRows,s+1,f))}}return a};return n.rows=r(t),n},Y(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function uf(e,t,n){return n.options.filterFromLeafRows?df(e,t,n):ff(e,t,n)}function df(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){var g;let p=u[m];const v=Qr(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(v.columnFilters=p.columnFilters,(g=p.subRows)!=null&&g.length&&c<i){if(v.subRows=a(p.subRows,c+1),p=v,t(p)&&!v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}if(t(p)||v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}}else p=v,t(p)&&(f.push(p),s[p.id]=p,o.push(p))}return f};return{rows:a(e),flatRows:o,rowsById:s}}function ff(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){let p=u[m];if(t(p)){var g;if((g=p.subRows)!=null&&g.length&&c<i){const h=Qr(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);h.subRows=a(p.subRows,c+1),p=h}f.push(p),o.push(p),s[p.id]=p}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function pf(){return e=>J(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(m=>{var p;const v=e.getColumn(m.id);if(!v)return;const h=v.getFilterFn();if(!h){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${v.id}.`);return}o.push({id:m.id,filterFn:h,resolvedValue:(p=h.resolveFilterValue==null?void 0:h.resolveFilterValue(m.value))!=null?p:m.value})});const i=(n??[]).map(m=>m.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());r&&a&&u.length&&(i.push("__global__"),u.forEach(m=>{var p;s.push({id:m.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let c,f;for(let m=0;m<t.flatRows.length;m++){const p=t.flatRows[m];if(p.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const h=c.id;p.columnFilters[h]=c.filterFn(p,h,c.resolvedValue,y=>{p.columnFiltersMeta[h]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const h=f.id;if(f.filterFn(p,h,f.resolvedValue,y=>{p.columnFiltersMeta[h]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const g=m=>{for(let p=0;p<i.length;p++)if(m.columnFilters[i[p]]===!1)return!1;return!0};return uf(t.rows,g,e)},Y(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
|
|
14
14
|
* react-table
|
|
15
15
|
*
|
|
16
16
|
* Copyright (c) TanStack
|
|
@@ -19,82 +19,77 @@
|
|
|
19
19
|
* LICENSE.md file in the root directory of this source tree.
|
|
20
20
|
*
|
|
21
21
|
* @license MIT
|
|
22
|
-
*/function qn(e,t){return e?Bf(e)?d.createElement(e,t):e:null}function Bf(e){return zf(e)||typeof e=="function"||Hf(e)}function zf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Hf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Li(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:If(t)})),[r,o]=d.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}function Vi(e,t){return function(){return e.apply(t,arguments)}}const{toString:Uf}=Object.prototype,{getPrototypeOf:yo}=Object,Kn=(e=>t=>{const n=Uf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Be=e=>(e=e.toLowerCase(),t=>Kn(t)===e),Xn=e=>t=>typeof t===e,{isArray:qt}=Array,yn=Xn("undefined");function Gf(e){return e!==null&&!yn(e)&&e.constructor!==null&&!yn(e.constructor)&&Oe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Bi=Be("ArrayBuffer");function jf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Bi(e.buffer),t}const Wf=Xn("string"),Oe=Xn("function"),zi=Xn("number"),Jn=e=>e!==null&&typeof e=="object",qf=e=>e===!0||e===!1,Yn=e=>{if(Kn(e)!=="object")return!1;const t=yo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Kf=Be("Date"),Xf=Be("File"),Jf=Be("Blob"),Yf=Be("FileList"),Zf=e=>Jn(e)&&Oe(e.pipe),Qf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Oe(e.append)&&((t=Kn(e))==="formdata"||t==="object"&&Oe(e.toString)&&e.toString()==="[object FormData]"))},ep=Be("URLSearchParams"),[tp,np,rp,op]=["ReadableStream","Request","Response","Headers"].map(Be),sp=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),qt(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Hi(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const $t=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ui=e=>!yn(e)&&e!==$t;function wo(){const{caseless:e}=Ui(this)&&this||{},t={},n=(r,o)=>{const s=e&&Hi(t,o)||o;Yn(t[s])&&Yn(r)?t[s]=wo(t[s],r):Yn(r)?t[s]=wo({},r):qt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&wn(arguments[r],n);return t}const ip=(e,t,n,{allOwnKeys:r}={})=>(wn(t,(o,s)=>{n&&Oe(o)?e[s]=Vi(o,n):e[s]=o},{allOwnKeys:r}),e),ap=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),lp=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},cp=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&yo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},up=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},dp=e=>{if(!e)return null;if(qt(e))return e;let t=e.length;if(!zi(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},fp=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&yo(Uint8Array)),pp=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},gp=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},hp=Be("HTMLFormElement"),mp=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Gi=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vp=Be("RegExp"),ji=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};wn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},yp=e=>{ji(e,(t,n)=>{if(Oe(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Oe(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wp=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return qt(e)?r(e):r(String(e).split(t)),n},bp=()=>{},xp=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,bo="abcdefghijklmnopqrstuvwxyz",Wi="0123456789",qi={DIGIT:Wi,ALPHA:bo,ALPHA_DIGIT:bo+bo.toUpperCase()+Wi},Cp=(e=16,t=qi.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Sp(e){return!!(e&&Oe(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Ep=e=>{const t=new Array(10),n=(r,o)=>{if(Jn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=qt(r)?[]:{};return wn(r,(i,a)=>{const u=n(i,o+1);!yn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},Np=Be("AsyncFunction"),Pp=e=>e&&(Jn(e)||Oe(e))&&Oe(e.then)&&Oe(e.catch),Ki=((e,t)=>e?setImmediate:t?((n,r)=>($t.addEventListener("message",({source:o,data:s})=>{o===$t&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),$t.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Oe($t.postMessage)),Tp=typeof queueMicrotask<"u"?queueMicrotask.bind($t):typeof process<"u"&&process.nextTick||Ki,A={isArray:qt,isArrayBuffer:Bi,isBuffer:Gf,isFormData:Qf,isArrayBufferView:jf,isString:Wf,isNumber:zi,isBoolean:qf,isObject:Jn,isPlainObject:Yn,isReadableStream:tp,isRequest:np,isResponse:rp,isHeaders:op,isUndefined:yn,isDate:Kf,isFile:Xf,isBlob:Jf,isRegExp:vp,isFunction:Oe,isStream:Zf,isURLSearchParams:ep,isTypedArray:fp,isFileList:Yf,forEach:wn,merge:wo,extend:ip,trim:sp,stripBOM:ap,inherits:lp,toFlatObject:cp,kindOf:Kn,kindOfTest:Be,endsWith:up,toArray:dp,forEachEntry:pp,matchAll:gp,isHTMLForm:hp,hasOwnProperty:Gi,hasOwnProp:Gi,reduceDescriptors:ji,freezeMethods:yp,toObjectSet:wp,toCamelCase:mp,noop:bp,toFiniteNumber:xp,findKey:Hi,global:$t,isContextDefined:Ui,ALPHABET:qi,generateString:Cp,isSpecCompliantForm:Sp,toJSONObject:Ep,isAsyncFn:Np,isThenable:Pp,setImmediate:Ki,asap:Tp};function Q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}A.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}});const Xi=Q.prototype,Ji={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ji[e]={value:e}}),Object.defineProperties(Q,Ji),Object.defineProperty(Xi,"isAxiosError",{value:!0}),Q.from=(e,t,n,r,o,s)=>{const i=Object.create(Xi);return A.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Ap=null;function xo(e){return A.isPlainObject(e)||A.isArray(e)}function Yi(e){return A.endsWith(e,"[]")?e.slice(0,-2):e}function Zi(e,t,n){return e?e.concat(t).map(function(o,s){return o=Yi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function _p(e){return A.isArray(e)&&!e.some(xo)}const Fp=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function Zn(e,t,n){if(!A.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=A.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!A.isUndefined(y[m])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(A.isDate(v))return v.toISOString();if(!u&&A.isBlob(v))throw new Q("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(v)||A.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,m,y){let w=v;if(v&&!y&&typeof v=="object"){if(A.endsWith(m,"{}"))m=r?m:m.slice(0,-2),v=JSON.stringify(v);else if(A.isArray(v)&&_p(v)||(A.isFileList(v)||A.endsWith(m,"[]"))&&(w=A.toArray(v)))return m=Yi(m),w.forEach(function(N,P){!(A.isUndefined(N)||N===null)&&t.append(i===!0?Zi([m],P,s):i===null?m:m+"[]",c(N))}),!1}return xo(v)?!0:(t.append(Zi(y,m,s),c(v)),!1)}const g=[],h=Object.assign(Fp,{defaultVisitor:f,convertValue:c,isVisitable:xo});function p(v,m){if(!A.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));g.push(v),A.forEach(v,function(w,C){(!(A.isUndefined(w)||w===null)&&o.call(t,w,A.isString(C)?C.trim():C,m,h))===!0&&p(w,m?m.concat(C):[C])}),g.pop()}}if(!A.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Qi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Co(e,t){this._pairs=[],e&&Zn(e,this,t)}const ea=Co.prototype;ea.append=function(t,n){this._pairs.push([t,n])},ea.toString=function(t){const n=t?function(r){return t.call(this,r,Qi)}:Qi;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Op(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ta(e,t,n){if(!t)return e;const r=n&&n.encode||Op;A.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=A.isURLSearchParams(t)?t.toString():new Co(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class na{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ra={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Dp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Co,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},So=typeof window<"u"&&typeof document<"u",Eo=typeof navigator=="object"&&navigator||void 0,Mp=So&&(!Eo||["ReactNative","NativeScript","NS"].indexOf(Eo.product)<0),kp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ip=So&&window.location.href||"http://localhost",xe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:So,hasStandardBrowserEnv:Mp,hasStandardBrowserWebWorkerEnv:kp,navigator:Eo,origin:Ip},Symbol.toStringTag,{value:"Module"})),...Dp};function Rp(e,t){return Zn(e,new xe.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return xe.isNode&&A.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function $p(e){return A.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Lp(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function oa(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),u=s>=n.length;return i=!i&&A.isArray(o)?o.length:i,u?(A.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!A.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&A.isArray(o[i])&&(o[i]=Lp(o[i])),!a)}if(A.isFormData(e)&&A.isFunction(e.entries)){const n={};return A.forEachEntry(e,(r,o)=>{t($p(r),o,n,0)}),n}return null}function Vp(e,t,n){if(A.isString(e))try{return(t||JSON.parse)(e),A.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const bn={transitional:ra,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=A.isObject(t);if(s&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return o?JSON.stringify(oa(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Rp(t,this.formSerializer).toString();if((a=A.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Zn(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Vp(t)):t}],transformResponse:[function(t){const n=this.transitional||bn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?Q.from(a,Q.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xe.classes.FormData,Blob:xe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],e=>{bn.headers[e]={}});const Bp=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zp=e=>{const t={};let n,r,o;return e&&e.split(`
|
|
23
|
-
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&
|
|
24
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[sa]=this[sa]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=xn(i);r[a]||(jp(o,i),r[a]=!0)}return A.isArray(t)?t.forEach(s):s(t),this}}Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(Pe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),A.freezeMethods(Pe);function Po(e,t){const n=this||bn,r=t||n,o=Pe.from(r.headers);let s=r.data;return A.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function ia(e){return!!(e&&e.__CANCEL__)}function Kt(e,t,n){Q.call(this,e??"canceled",Q.ERR_CANCELED,t,n),this.name="CanceledError"}A.inherits(Kt,Q,{__CANCEL__:!0});function aa(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Wp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[s];i||(i=c),n[o]=u,r[o]=c;let g=s,h=0;for(;g!==o;)h+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const p=f&&c-f;return p?Math.round(h*1e3/p):void 0}}function Kp(e,t){let n=0,r=1e3/t,o,s;const i=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),g=f-n;g>=r?i(c,f):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-g)))},()=>o&&i(o)]}const er=(e,t,n=3)=>{let r=0;const o=qp(50,250);return Kp(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const g={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(g)},n)},la=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ca=e=>(...t)=>A.asap(()=>e(...t)),Xp=xe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,xe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(xe.origin),xe.navigator&&/(msie|trident)/i.test(xe.navigator.userAgent)):()=>!0,Jp=xe.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];A.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),A.isString(r)&&i.push("path="+r),A.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Yp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ua(e,t){return e&&!Yp(t)?Zp(e,t):t}const da=e=>e instanceof Pe?{...e}:e;function Lt(e,t){t=t||{};const n={};function r(c,f,g,h){return A.isPlainObject(c)&&A.isPlainObject(f)?A.merge.call({caseless:h},c,f):A.isPlainObject(f)?A.merge({},f):A.isArray(f)?f.slice():f}function o(c,f,g,h){if(A.isUndefined(f)){if(!A.isUndefined(c))return r(void 0,c,g,h)}else return r(c,f,g,h)}function s(c,f){if(!A.isUndefined(f))return r(void 0,f)}function i(c,f){if(A.isUndefined(f)){if(!A.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,g){if(g in t)return r(c,f);if(g in e)return r(void 0,c)}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,f,g)=>o(da(c),da(f),g,!0)};return A.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,h=g(e[f],t[f],f);A.isUndefined(h)&&g!==a||(n[f]=h)}),n}const fa=e=>{const t=Lt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Pe.from(i),t.url=ta(ua(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(A.isFormData(n)){if(xe.hasStandardBrowserEnv||xe.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(xe.hasStandardBrowserEnv&&(r&&A.isFunction(r)&&(r=r(t)),r||r!==!1&&Xp(t.url))){const c=o&&s&&Jp.read(s);c&&i.set(o,c)}return t},Qp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=fa(e);let s=o.data;const i=Pe.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,g,h,p,v;function m(){p&&p(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function w(){if(!y)return;const N=Pe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:N,config:e,request:y};aa(function(E){n(E),m()},function(E){r(E),m()},b),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new Q("Request aborted",Q.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new Q("Network Error",Q.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let P=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const b=o.transitional||ra;o.timeoutErrorMessage&&(P=o.timeoutErrorMessage),r(new Q(P,b.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&A.forEach(i.toJSON(),function(P,b){y.setRequestHeader(b,P)}),A.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([h,v]=er(c,!0),y.addEventListener("progress",h)),u&&y.upload&&([g,p]=er(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=N=>{y&&(r(!N||N.type?new Kt(null,e,y):N),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const C=Wp(o.url);if(C&&xe.protocols.indexOf(C)===-1){r(new Q("Unsupported protocol "+C+":",Q.ERR_BAD_REQUEST,e));return}y.send(s||null)})},eg=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof Q?f:new Kt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>A.asap(a),u}},tg=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},ng=async function*(e,t){for await(const n of rg(e))yield*tg(n,t)},rg=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},pa=(e,t,n,r)=>{const o=ng(e,t);let s=0,i,a=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){a(),u.close();return}let g=f.byteLength;if(n){let h=s+=g;n(h)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},tr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ga=tr&&typeof ReadableStream=="function",og=tr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ha=(e,...t)=>{try{return!!e(...t)}catch{return!1}},sg=ga&&ha(()=>{let e=!1;const t=new Request(xe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ma=64*1024,To=ga&&ha(()=>A.isReadableStream(new Response("").body)),nr={stream:To&&(e=>e.body)};tr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!nr[t]&&(nr[t]=A.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Q(`Response type '${t}' is not supported`,Q.ERR_NOT_SUPPORT,r)})})})(new Response);const ig=async e=>{if(e==null)return 0;if(A.isBlob(e))return e.size;if(A.isSpecCompliantForm(e))return(await new Request(xe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(A.isArrayBufferView(e)||A.isArrayBuffer(e))return e.byteLength;if(A.isURLSearchParams(e)&&(e=e+""),A.isString(e))return(await og(e)).byteLength},ag=async(e,t)=>{const n=A.toFiniteNumber(e.getContentLength());return n??ig(t)},Ao={http:Ap,xhr:Qp,fetch:tr&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:g="same-origin",fetchOptions:h}=fa(e);c=c?(c+"").toLowerCase():"text";let p=eg([o,s&&s.toAbortSignal()],i),v;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&sg&&n!=="get"&&n!=="head"&&(y=await ag(f,r))!==0){let b=new Request(t,{method:"POST",body:r,duplex:"half"}),S;if(A.isFormData(r)&&(S=b.headers.get("content-type"))&&f.setContentType(S),b.body){const[E,$]=la(y,er(ca(u)));r=pa(b.body,ma,E,$)}}A.isString(g)||(g=g?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...h,signal:p,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?g:void 0});let C=await fetch(v);const N=To&&(c==="stream"||c==="response");if(To&&(a||N&&m)){const b={};["status","statusText","headers"].forEach(G=>{b[G]=C[G]});const S=A.toFiniteNumber(C.headers.get("content-length")),[E,$]=a&&la(S,er(ca(a),!0))||[];C=new Response(pa(C.body,ma,E,()=>{$&&$(),m&&m()}),b)}c=c||"text";let P=await nr[A.findKey(nr,c)||"text"](C,e);return!N&&m&&m(),await new Promise((b,S)=>{aa(b,S,{data:P,headers:Pe.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:v})})}catch(w){throw m&&m(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,v),{cause:w.cause||w}):Q.from(w,w&&w.code,e,v)}})};A.forEach(Ao,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const va=e=>`- ${e}`,lg=e=>A.isFunction(e)||e===null||e===!1,ya={getAdapter:e=>{e=A.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let i;if(r=n,!lg(n)&&(r=Ao[(i=String(n)).toLowerCase()],r===void 0))throw new Q(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since :
|
|
25
|
-
`+s.map(
|
|
26
|
-
`):" "+
|
|
27
|
-
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n
|
|
22
|
+
*/function Gn(e,t){return e?gf(e)?d.createElement(e,t):e:null}function gf(e){return hf(e)||typeof e=="function"||mf(e)}function hf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function mf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _i(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:cf(t)})),[r,o]=d.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}function Fi(e,t){return function(){return e.apply(t,arguments)}}const{toString:vf}=Object.prototype,{getPrototypeOf:mo}=Object,qn=(e=>t=>{const n=vf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Be=e=>(e=e.toLowerCase(),t=>qn(t)===e),Kn=e=>t=>typeof t===e,{isArray:jt}=Array,yn=Kn("undefined");function yf(e){return e!==null&&!yn(e)&&e.constructor!==null&&!yn(e.constructor)&&Oe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Oi=Be("ArrayBuffer");function wf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Oi(e.buffer),t}const bf=Kn("string"),Oe=Kn("function"),Di=Kn("number"),Xn=e=>e!==null&&typeof e=="object",xf=e=>e===!0||e===!1,Jn=e=>{if(qn(e)!=="object")return!1;const t=mo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Cf=Be("Date"),Sf=Be("File"),Ef=Be("Blob"),Nf=Be("FileList"),Tf=e=>Xn(e)&&Oe(e.pipe),Pf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Oe(e.append)&&((t=qn(e))==="formdata"||t==="object"&&Oe(e.toString)&&e.toString()==="[object FormData]"))},Af=Be("URLSearchParams"),[_f,Ff,Of,Df]=["ReadableStream","Request","Response","Headers"].map(Be),Mf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),jt(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Mi(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Mt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$i=e=>!yn(e)&&e!==Mt;function vo(){const{caseless:e}=$i(this)&&this||{},t={},n=(r,o)=>{const s=e&&Mi(t,o)||o;Jn(t[s])&&Jn(r)?t[s]=vo(t[s],r):Jn(r)?t[s]=vo({},r):jt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&wn(arguments[r],n);return t}const $f=(e,t,n,{allOwnKeys:r}={})=>(wn(t,(o,s)=>{n&&Oe(o)?e[s]=Fi(o,n):e[s]=o},{allOwnKeys:r}),e),kf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),If=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Rf=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&mo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Lf=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Vf=e=>{if(!e)return null;if(jt(e))return e;let t=e.length;if(!Di(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Bf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&mo(Uint8Array)),Hf=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},zf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Uf=Be("HTMLFormElement"),jf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),ki=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Wf=Be("RegExp"),Ii=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};wn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Gf=e=>{Ii(e,(t,n)=>{if(Oe(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Oe(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},qf=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return jt(e)?r(e):r(String(e).split(t)),n},Kf=()=>{},Xf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,yo="abcdefghijklmnopqrstuvwxyz",Ri="0123456789",Li={DIGIT:Ri,ALPHA:yo,ALPHA_DIGIT:yo+yo.toUpperCase()+Ri},Jf=(e=16,t=Li.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Yf(e){return!!(e&&Oe(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Zf=e=>{const t=new Array(10),n=(r,o)=>{if(Xn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=jt(r)?[]:{};return wn(r,(i,a)=>{const u=n(i,o+1);!yn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},Qf=Be("AsyncFunction"),ep=e=>e&&(Xn(e)||Oe(e))&&Oe(e.then)&&Oe(e.catch),Vi=((e,t)=>e?setImmediate:t?((n,r)=>(Mt.addEventListener("message",({source:o,data:s})=>{o===Mt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Mt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Oe(Mt.postMessage)),tp=typeof queueMicrotask<"u"?queueMicrotask.bind(Mt):typeof process<"u"&&process.nextTick||Vi,_={isArray:jt,isArrayBuffer:Oi,isBuffer:yf,isFormData:Pf,isArrayBufferView:wf,isString:bf,isNumber:Di,isBoolean:xf,isObject:Xn,isPlainObject:Jn,isReadableStream:_f,isRequest:Ff,isResponse:Of,isHeaders:Df,isUndefined:yn,isDate:Cf,isFile:Sf,isBlob:Ef,isRegExp:Wf,isFunction:Oe,isStream:Tf,isURLSearchParams:Af,isTypedArray:Bf,isFileList:Nf,forEach:wn,merge:vo,extend:$f,trim:Mf,stripBOM:kf,inherits:If,toFlatObject:Rf,kindOf:qn,kindOfTest:Be,endsWith:Lf,toArray:Vf,forEachEntry:Hf,matchAll:zf,isHTMLForm:Uf,hasOwnProperty:ki,hasOwnProp:ki,reduceDescriptors:Ii,freezeMethods:Gf,toObjectSet:qf,toCamelCase:jf,noop:Kf,toFiniteNumber:Xf,findKey:Mi,global:Mt,isContextDefined:$i,ALPHABET:Li,generateString:Jf,isSpecCompliantForm:Yf,toJSONObject:Zf,isAsyncFn:Qf,isThenable:ep,setImmediate:Vi,asap:tp};function Q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}_.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_.toJSONObject(this.config),code:this.code,status:this.status}}});const Bi=Q.prototype,Hi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Hi[e]={value:e}}),Object.defineProperties(Q,Hi),Object.defineProperty(Bi,"isAxiosError",{value:!0}),Q.from=(e,t,n,r,o,s)=>{const i=Object.create(Bi);return _.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const np=null;function wo(e){return _.isPlainObject(e)||_.isArray(e)}function zi(e){return _.endsWith(e,"[]")?e.slice(0,-2):e}function Ui(e,t,n){return e?e.concat(t).map(function(o,s){return o=zi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function rp(e){return _.isArray(e)&&!e.some(wo)}const op=_.toFlatObject(_,{},null,function(t){return/^is[A-Z]/.test(t)});function Yn(e,t,n){if(!_.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!_.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(t);if(!_.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(_.isDate(v))return v.toISOString();if(!u&&_.isBlob(v))throw new Q("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(v)||_.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,h,y){let w=v;if(v&&!y&&typeof v=="object"){if(_.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(_.isArray(v)&&rp(v)||(_.isFileList(v)||_.endsWith(h,"[]"))&&(w=_.toArray(v)))return h=zi(h),w.forEach(function(E,T){!(_.isUndefined(E)||E===null)&&t.append(i===!0?Ui([h],T,s):i===null?h:h+"[]",c(E))}),!1}return wo(v)?!0:(t.append(Ui(y,h,s),c(v)),!1)}const g=[],m=Object.assign(op,{defaultVisitor:f,convertValue:c,isVisitable:wo});function p(v,h){if(!_.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));g.push(v),_.forEach(v,function(w,x){(!(_.isUndefined(w)||w===null)&&o.call(t,w,_.isString(x)?x.trim():x,h,m))===!0&&p(w,h?h.concat(x):[x])}),g.pop()}}if(!_.isObject(e))throw new TypeError("data must be an object");return p(e),t}function ji(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function bo(e,t){this._pairs=[],e&&Yn(e,this,t)}const Wi=bo.prototype;Wi.append=function(t,n){this._pairs.push([t,n])},Wi.toString=function(t){const n=t?function(r){return t.call(this,r,ji)}:ji;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function sp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Gi(e,t,n){if(!t)return e;const r=n&&n.encode||sp;_.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=_.isURLSearchParams(t)?t.toString():new bo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class qi{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){_.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ki={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ip={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:bo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xo=typeof window<"u"&&typeof document<"u",Co=typeof navigator=="object"&&navigator||void 0,ap=xo&&(!Co||["ReactNative","NativeScript","NS"].indexOf(Co.product)<0),lp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cp=xo&&window.location.href||"http://localhost",xe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xo,hasStandardBrowserEnv:ap,hasStandardBrowserWebWorkerEnv:lp,navigator:Co,origin:cp},Symbol.toStringTag,{value:"Module"})),...ip};function up(e,t){return Yn(e,new xe.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return xe.isNode&&_.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function dp(e){return _.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fp(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Xi(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),u=s>=n.length;return i=!i&&_.isArray(o)?o.length:i,u?(_.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!_.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&_.isArray(o[i])&&(o[i]=fp(o[i])),!a)}if(_.isFormData(e)&&_.isFunction(e.entries)){const n={};return _.forEachEntry(e,(r,o)=>{t(dp(r),o,n,0)}),n}return null}function pp(e,t,n){if(_.isString(e))try{return(t||JSON.parse)(e),_.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const bn={transitional:Ki,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=_.isObject(t);if(s&&_.isHTMLForm(t)&&(t=new FormData(t)),_.isFormData(t))return o?JSON.stringify(Xi(t)):t;if(_.isArrayBuffer(t)||_.isBuffer(t)||_.isStream(t)||_.isFile(t)||_.isBlob(t)||_.isReadableStream(t))return t;if(_.isArrayBufferView(t))return t.buffer;if(_.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return up(t,this.formSerializer).toString();if((a=_.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Yn(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),pp(t)):t}],transformResponse:[function(t){const n=this.transitional||bn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(_.isResponse(t)||_.isReadableStream(t))return t;if(t&&_.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?Q.from(a,Q.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xe.classes.FormData,Blob:xe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_.forEach(["delete","get","head","post","put","patch"],e=>{bn.headers[e]={}});const gp=_.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hp=e=>{const t={};let n,r,o;return e&&e.split(`
|
|
23
|
+
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&gp[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ji=Symbol("internals");function xn(e){return e&&String(e).trim().toLowerCase()}function Zn(e){return e===!1||e==null?e:_.isArray(e)?e.map(Zn):String(e)}function mp(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const vp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function So(e,t,n,r,o){if(_.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!_.isString(t)){if(_.isString(r))return t.indexOf(r)!==-1;if(_.isRegExp(r))return r.test(t)}}function yp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function wp(e,t){const n=_.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class Ne{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=xn(u);if(!f)throw new Error("header name must be a non-empty string");const g=_.findKey(o,f);(!g||o[g]===void 0||c===!0||c===void 0&&o[g]!==!1)&&(o[g||u]=Zn(a))}const i=(a,u)=>_.forEach(a,(c,f)=>s(c,f,u));if(_.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(_.isString(t)&&(t=t.trim())&&!vp(t))i(hp(t),n);else if(_.isHeaders(t))for(const[a,u]of t.entries())s(u,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=xn(t),t){const r=_.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return mp(o);if(_.isFunction(n))return n.call(this,o,r);if(_.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=xn(t),t){const r=_.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||So(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=xn(i),i){const a=_.findKey(r,i);a&&(!n||So(r,r[a],a,n))&&(delete r[a],o=!0)}}return _.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||So(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return _.forEach(this,(o,s)=>{const i=_.findKey(r,s);if(i){n[i]=Zn(o),delete n[s];return}const a=t?yp(s):String(s).trim();a!==s&&delete n[s],n[a]=Zn(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return _.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&_.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
24
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Ji]=this[Ji]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=xn(i);r[a]||(wp(o,i),r[a]=!0)}return _.isArray(t)?t.forEach(s):s(t),this}}Ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_.reduceDescriptors(Ne.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),_.freezeMethods(Ne);function Eo(e,t){const n=this||bn,r=t||n,o=Ne.from(r.headers);let s=r.data;return _.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Yi(e){return!!(e&&e.__CANCEL__)}function Wt(e,t,n){Q.call(this,e??"canceled",Q.ERR_CANCELED,t,n),this.name="CanceledError"}_.inherits(Wt,Q,{__CANCEL__:!0});function Zi(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[s];i||(i=c),n[o]=u,r[o]=c;let g=s,m=0;for(;g!==o;)m+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const p=f&&c-f;return p?Math.round(m*1e3/p):void 0}}function Cp(e,t){let n=0,r=1e3/t,o,s;const i=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),g=f-n;g>=r?i(c,f):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-g)))},()=>o&&i(o)]}const Qn=(e,t,n=3)=>{let r=0;const o=xp(50,250);return Cp(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const g={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(g)},n)},Qi=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ea=e=>(...t)=>_.asap(()=>e(...t)),Sp=xe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,xe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(xe.origin),xe.navigator&&/(msie|trident)/i.test(xe.navigator.userAgent)):()=>!0,Ep=xe.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];_.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),_.isString(r)&&i.push("path="+r),_.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Np(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Tp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ta(e,t){return e&&!Np(t)?Tp(e,t):t}const na=e=>e instanceof Ne?{...e}:e;function $t(e,t){t=t||{};const n={};function r(c,f,g,m){return _.isPlainObject(c)&&_.isPlainObject(f)?_.merge.call({caseless:m},c,f):_.isPlainObject(f)?_.merge({},f):_.isArray(f)?f.slice():f}function o(c,f,g,m){if(_.isUndefined(f)){if(!_.isUndefined(c))return r(void 0,c,g,m)}else return r(c,f,g,m)}function s(c,f){if(!_.isUndefined(f))return r(void 0,f)}function i(c,f){if(_.isUndefined(f)){if(!_.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,g){if(g in t)return r(c,f);if(g in e)return r(void 0,c)}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,f,g)=>o(na(c),na(f),g,!0)};return _.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,m=g(e[f],t[f],f);_.isUndefined(m)&&g!==a||(n[f]=m)}),n}const ra=e=>{const t=$t({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Ne.from(i),t.url=Gi(ta(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(_.isFormData(n)){if(xe.hasStandardBrowserEnv||xe.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(xe.hasStandardBrowserEnv&&(r&&_.isFunction(r)&&(r=r(t)),r||r!==!1&&Sp(t.url))){const c=o&&s&&Ep.read(s);c&&i.set(o,c)}return t},Pp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=ra(e);let s=o.data;const i=Ne.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,g,m,p,v;function h(){p&&p(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function w(){if(!y)return;const E=Ne.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:E,config:e,request:y};Zi(function(S){n(S),h()},function(S){r(S),h()},C),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new Q("Request aborted",Q.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new Q("Network Error",Q.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let T=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ki;o.timeoutErrorMessage&&(T=o.timeoutErrorMessage),r(new Q(T,C.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&_.forEach(i.toJSON(),function(T,C){y.setRequestHeader(C,T)}),_.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([m,v]=Qn(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=Qn(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=E=>{y&&(r(!E||E.type?new Wt(null,e,y):E),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const x=bp(o.url);if(x&&xe.protocols.indexOf(x)===-1){r(new Q("Unsupported protocol "+x+":",Q.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Ap=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof Q?f:new Wt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>_.asap(a),u}},_p=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Fp=async function*(e,t){for await(const n of Op(e))yield*_p(n,t)},Op=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},oa=(e,t,n,r)=>{const o=Fp(e,t);let s=0,i,a=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){a(),u.close();return}let g=f.byteLength;if(n){let m=s+=g;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},er=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sa=er&&typeof ReadableStream=="function",Dp=er&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ia=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Mp=sa&&ia(()=>{let e=!1;const t=new Request(xe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),aa=64*1024,No=sa&&ia(()=>_.isReadableStream(new Response("").body)),tr={stream:No&&(e=>e.body)};er&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!tr[t]&&(tr[t]=_.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Q(`Response type '${t}' is not supported`,Q.ERR_NOT_SUPPORT,r)})})})(new Response);const $p=async e=>{if(e==null)return 0;if(_.isBlob(e))return e.size;if(_.isSpecCompliantForm(e))return(await new Request(xe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(_.isArrayBufferView(e)||_.isArrayBuffer(e))return e.byteLength;if(_.isURLSearchParams(e)&&(e=e+""),_.isString(e))return(await Dp(e)).byteLength},kp=async(e,t)=>{const n=_.toFiniteNumber(e.getContentLength());return n??$p(t)},To={http:np,xhr:Pp,fetch:er&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:g="same-origin",fetchOptions:m}=ra(e);c=c?(c+"").toLowerCase():"text";let p=Ap([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Mp&&n!=="get"&&n!=="head"&&(y=await kp(f,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),N;if(_.isFormData(r)&&(N=C.headers.get("content-type"))&&f.setContentType(N),C.body){const[S,A]=Qi(y,Qn(ea(u)));r=oa(C.body,aa,S,A)}}_.isString(g)||(g=g?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...m,signal:p,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?g:void 0});let x=await fetch(v);const E=No&&(c==="stream"||c==="response");if(No&&(a||E&&h)){const C={};["status","statusText","headers"].forEach(B=>{C[B]=x[B]});const N=_.toFiniteNumber(x.headers.get("content-length")),[S,A]=a&&Qi(N,Qn(ea(a),!0))||[];x=new Response(oa(x.body,aa,S,()=>{A&&A(),h&&h()}),C)}c=c||"text";let T=await tr[_.findKey(tr,c)||"text"](x,e);return!E&&h&&h(),await new Promise((C,N)=>{Zi(C,N,{data:T,headers:Ne.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:v})})}catch(w){throw h&&h(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,v),{cause:w.cause||w}):Q.from(w,w&&w.code,e,v)}})};_.forEach(To,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const la=e=>`- ${e}`,Ip=e=>_.isFunction(e)||e===null||e===!1,ca={getAdapter:e=>{e=_.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let i;if(r=n,!Ip(n)&&(r=To[(i=String(n)).toLowerCase()],r===void 0))throw new Q(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since :
|
|
25
|
+
`+s.map(la).join(`
|
|
26
|
+
`):" "+la(s[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:To};function Po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Wt(null,e)}function ua(e){return Po(e),e.headers=Ne.from(e.headers),e.data=Eo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ca.getAdapter(e.adapter||bn.adapter)(e).then(function(r){return Po(e),r.data=Eo.call(e,e.transformResponse,r),r.headers=Ne.from(r.headers),r},function(r){return Yi(r)||(Po(e),r&&r.response&&(r.response.data=Eo.call(e,e.transformResponse,r.response),r.response.headers=Ne.from(r.response.headers))),Promise.reject(r)})}const da="1.7.9",nr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{nr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const fa={};nr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+da+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new Q(o(i," has been removed"+(n?" in "+n:"")),Q.ERR_DEPRECATED);return n&&!fa[i]&&(fa[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}},nr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Rp(e,t,n){if(typeof e!="object")throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],u=a===void 0||i(a,s,e);if(u!==!0)throw new Q("option "+s+" must be "+u,Q.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Q("Unknown option "+s,Q.ERR_BAD_OPTION)}}const rr={assertOptions:Rp,validators:nr},qe=rr.validators;class kt{constructor(t){this.defaults=t,this.interceptors={request:new qi,response:new qi}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
27
|
+
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$t(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&rr.assertOptions(r,{silentJSONParsing:qe.transitional(qe.boolean),forcedJSONParsing:qe.transitional(qe.boolean),clarifyTimeoutError:qe.transitional(qe.boolean)},!1),o!=null&&(_.isFunction(o)?n.paramsSerializer={serialize:o}:rr.assertOptions(o,{encode:qe.function,serialize:qe.function},!0)),rr.assertOptions(n,{baseUrl:qe.spelling("baseURL"),withXsrfToken:qe.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&_.merge(s.common,s[n.method]);s&&_.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=Ne.concat(i,s);const a=[];let u=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(u=u&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let f,g=0,m;if(!u){const v=[ua.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),m=v.length,f=Promise.resolve(n);g<m;)f=f.then(v[g++],v[g++]);return f}m=a.length;let p=n;for(g=0;g<m;){const v=a[g++],h=a[g++];try{p=v(p)}catch(y){h.call(this,y);break}}try{f=ua.call(this,p)}catch(v){return Promise.reject(v)}for(g=0,m=c.length;g<m;)f=f.then(c[g++],c[g++]);return f}getUri(t){t=$t(this.defaults,t);const n=ta(t.baseURL,t.url);return Gi(n,t.params,t.paramsSerializer)}}_.forEach(["delete","get","head","options"],function(t){kt.prototype[t]=function(n,r){return this.request($t(r||{},{method:t,url:n,data:(r||{}).data}))}}),_.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request($t(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}kt.prototype[t]=n(),kt.prototype[t+"Form"]=n(!0)});class Ao{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new Wt(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ao(function(o){t=o}),cancel:t}}}function Lp(e){return function(n){return e.apply(null,n)}}function Vp(e){return _.isObject(e)&&e.isAxiosError===!0}const _o={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(_o).forEach(([e,t])=>{_o[t]=e});function pa(e){const t=new kt(e),n=Fi(kt.prototype.request,t);return _.extend(n,kt.prototype,t,{allOwnKeys:!0}),_.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return pa($t(e,o))},n}const oe=pa(bn);oe.Axios=kt,oe.CanceledError=Wt,oe.CancelToken=Ao,oe.isCancel=Yi,oe.VERSION=da,oe.toFormData=Yn,oe.AxiosError=Q,oe.Cancel=oe.CanceledError,oe.all=function(t){return Promise.all(t)},oe.spread=Lp,oe.isAxiosError=Vp,oe.mergeConfig=$t,oe.AxiosHeaders=Ne,oe.formToJSON=e=>Xi(_.isHTMLForm(e)?new FormData(e):e),oe.getAdapter=ca.getAdapter,oe.HttpStatusCode=_o,oe.default=oe;/**
|
|
28
28
|
* @license lucide-react v0.468.0 - ISC
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const
|
|
32
|
+
*/const Bp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ga=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
33
33
|
* @license lucide-react v0.468.0 - ISC
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the ISC license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/var
|
|
37
|
+
*/var Hp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
38
38
|
* @license lucide-react v0.468.0 - ISC
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the ISC license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const
|
|
42
|
+
*/const zp=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>O.createElement("svg",{ref:u,...Hp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ga("lucide",o),...a},[...i.map(([c,f])=>O.createElement(c,f)),...Array.isArray(s)?s:[s]]));/**
|
|
43
43
|
* @license lucide-react v0.468.0 - ISC
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the ISC license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const
|
|
47
|
+
*/const wt=(e,t)=>{const n=O.forwardRef(({className:r,...o},s)=>O.createElement(zp,{ref:s,iconNode:t,className:ga(`lucide-${Bp(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
48
48
|
* @license lucide-react v0.468.0 - ISC
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the ISC license.
|
|
51
51
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const
|
|
52
|
+
*/const Up=wt("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
|
|
53
53
|
* @license lucide-react v0.468.0 - ISC
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the ISC license.
|
|
56
56
|
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const
|
|
57
|
+
*/const jp=wt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
58
58
|
* @license lucide-react v0.468.0 - ISC
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const
|
|
62
|
+
*/const Wp=wt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
63
63
|
* @license lucide-react v0.468.0 - ISC
|
|
64
64
|
*
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const
|
|
67
|
+
*/const ha=wt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
68
68
|
* @license lucide-react v0.468.0 - ISC
|
|
69
69
|
*
|
|
70
70
|
* This source code is licensed under the ISC license.
|
|
71
71
|
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const
|
|
72
|
+
*/const Gp=wt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
73
73
|
* @license lucide-react v0.468.0 - ISC
|
|
74
74
|
*
|
|
75
75
|
* This source code is licensed under the ISC license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const
|
|
77
|
+
*/const we=wt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
78
78
|
* @license lucide-react v0.468.0 - ISC
|
|
79
79
|
*
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const
|
|
82
|
+
*/const qp=wt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
83
83
|
* @license lucide-react v0.468.0 - ISC
|
|
84
84
|
*
|
|
85
85
|
* This source code is licensed under the ISC license.
|
|
86
86
|
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const bg=at("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
88
|
-
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const Na=at("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Pa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Pa(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Pa(e[o],null)}}}}var Bt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Cg);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Do,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Do,{...r,ref:t,children:n})});Bt.displayName="Slot";var Do=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Eg(n);return d.cloneElement(n,{...Sg(r,n.props),ref:t?xg(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Do.displayName="SlotClone";var Ta=({children:e})=>l.jsx(l.Fragment,{children:e});function Cg(e){return d.isValidElement(e)&&e.type===Ta}function Sg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Eg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Aa(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Aa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _a(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Aa(e))&&(r&&(r+=" "),r+=t);return r}const Mo="-",Ng=e=>{const t=Tg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Mo);return a[0]===""&&a.length!==1&&a.shift(),Fa(a,t)||Pg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},Fa=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Fa(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Mo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Oa=/^\[(.+)\]$/,Pg=e=>{if(Oa.test(e)){const t=Oa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Tg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return _g(Object.entries(e.classGroups),n).forEach(([s,i])=>{ko(i,r,s,t)}),r},ko=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Da(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Ag(o)){ko(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{ko(i,Da(t,s),n,r)})})},Da=(e,t)=>{let n=e;return t.split(Mo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ag=e=>e.isThemeGetter,_g=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,Fg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Ma="!",Og=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let c=0,f=0,g;for(let y=0;y<a.length;y++){let w=a[y];if(c===0){if(w===o&&(r||a.slice(y,y+s)===t)){u.push(a.slice(f,y)),f=y+s;continue}if(w==="/"){g=y;continue}}w==="["?c++:w==="]"&&c--}const h=u.length===0?a:a.substring(f),p=h.startsWith(Ma),v=p?h.substring(1):h,m=g&&g>f?g-f:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:i}):i},Dg=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Mg=e=>({cache:Fg(e.cacheSize),parseClassName:Og(e),...Ng(e)}),kg=/\s+/,Ig=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(kg);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let v=!!p,m=r(v?h.substring(0,p):h);if(!m){if(!v){a=c+(a.length>0?" "+a:a);continue}if(m=r(h),!m){a=c+(a.length>0?" "+a:a);continue}v=!1}const y=Dg(f).join(":"),w=g?y+Ma:y,C=w+m;if(s.includes(C))continue;s.push(C);const N=o(m,v);for(let P=0;P<N.length;++P){const b=N[P];s.push(w+b)}a=c+(a.length>0?" "+a:a)}return a};function Rg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ka(t))&&(r&&(r+=" "),r+=n);return r}const ka=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ka(e[r]))&&(n&&(n+=" "),n+=t);return n};function $g(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=Mg(c),r=n.cache.get,o=n.cache.set,s=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=Ig(u,n);return o(u,f),f}return function(){return s(Rg.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ia=/^\[(?:([a-z-]+):)?(.+)\]$/i,Lg=/^\d+\/\d+$/,Vg=new Set(["px","full","screen"]),Bg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ug=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lt=e=>Xt(e)||Vg.has(e)||Lg.test(e),St=e=>Jt(e,"length",Zg),Xt=e=>!!e&&!Number.isNaN(Number(e)),Io=e=>Jt(e,"number",Xt),Cn=e=>!!e&&Number.isInteger(Number(e)),jg=e=>e.endsWith("%")&&Xt(e.slice(0,-1)),ee=e=>Ia.test(e),Et=e=>Bg.test(e),Wg=new Set(["length","size","percentage"]),qg=e=>Jt(e,Wg,Ra),Kg=e=>Jt(e,"position",Ra),Xg=new Set(["image","url"]),Jg=e=>Jt(e,Xg,eh),Yg=e=>Jt(e,"",Qg),Sn=()=>!0,Jt=(e,t,n)=>{const r=Ia.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Zg=e=>zg.test(e)&&!Hg.test(e),Ra=()=>!1,Qg=e=>Ug.test(e),eh=e=>Gg.test(e),th=$g(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),s=ue("borderRadius"),i=ue("borderSpacing"),a=ue("borderWidth"),u=ue("contrast"),c=ue("grayscale"),f=ue("hueRotate"),g=ue("invert"),h=ue("gap"),p=ue("gradientColorStops"),v=ue("gradientColorStopPositions"),m=ue("inset"),y=ue("margin"),w=ue("opacity"),C=ue("padding"),N=ue("saturate"),P=ue("scale"),b=ue("sepia"),S=ue("skew"),E=ue("space"),$=ue("translate"),G=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto",ee,t],D=()=>[ee,t],k=()=>["",lt,St],O=()=>["auto",Xt,ee],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",ee],ie=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>[Xt,ee];return{cacheSize:500,separator:":",theme:{colors:[Sn],spacing:[lt,St],blur:["none","",Et,ee],brightness:fe(),borderColor:[e],borderRadius:["none","","full",Et,ee],borderSpacing:D(),borderWidth:k(),contrast:fe(),grayscale:ne(),hueRotate:fe(),invert:ne(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[jg,St],inset:Z(),margin:Z(),opacity:fe(),padding:D(),saturate:fe(),scale:fe(),sepia:ne(),skew:fe(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[Et]}],"break-after":[{"break-after":ie()}],"break-before":[{"break-before":ie()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),ee]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Cn,ee]}],basis:[{basis:Z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",Cn,ee]}],"grid-cols":[{"grid-cols":[Sn]}],"col-start-end":[{col:["auto",{span:["full",Cn,ee]},ee]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[Sn]}],"row-start-end":[{row:["auto",{span:[Cn,ee]},ee]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[Et]},Et]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Et,St]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Io]}],"font-family":[{font:[Sn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ee]}],"line-clamp":[{"line-clamp":["none",Xt,Io]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",lt,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",lt,St]}],"underline-offset":[{"underline-offset":["auto",lt,ee]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),Kg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",qg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:B()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[lt,ee]}],"outline-w":[{outline:[lt,St]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[lt,St]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Et,Yg]}],"shadow-color":[{shadow:[Sn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Et,ee]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[N]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:fe()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:fe()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Cn,ee]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[lt,St,Io]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Y(...e){return th(_a(e))}const nh=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(2))} ${n[r]}`},$a=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Y("s3-explr-ui-breadcrumb",e),...t}));$a.displayName="Breadcrumb";const La=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:Y("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",e),...t}));La.displayName="BreadcrumbList";const Ro=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Y("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));Ro.displayName="BreadcrumbItem";const $o=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Bt:"a";return l.jsx(o,{ref:r,className:Y("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});$o.displayName="BreadcrumbLink";const rh=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Y("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));rh.displayName="BreadcrumbPage";const Va=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:Y("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(Ea,{})});Va.displayName="BreadcrumbSeparator";const Ba=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,za=_a,Lo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return za(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const f=n==null?void 0:n[c],g=s==null?void 0:s[c];if(f===null)return null;const h=Ba(f)||Ba(g);return o[c][h]}),a=n&&Object.entries(n).reduce((c,f)=>{let[g,h]=f;return h===void 0||(c[g]=h),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:g,className:h,...p}=f;return Object.entries(p).every(v=>{let[m,y]=v;return Array.isArray(y)?y.includes({...s,...a}[m]):{...s,...a}[m]===y})?[...c,g,h]:c},[]);return za(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Ha=Lo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),le=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Bt:"button";return l.jsx(i,{className:Y(Ha({variant:t,size:n,className:e})),ref:s,...o})});le.displayName="Button";function oh(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function sr(...e){return t=>e.forEach(n=>oh(n,t))}function Ie(...e){return d.useCallback(sr(...e),e)}function sh(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,u=d.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ke(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];const c=g=>{var w;const{scope:h,children:p,...v}=g,m=((w=h==null?void 0:h[e])==null?void 0:w[u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(m.Provider,{value:y,children:p})};c.displayName=s+"Provider";function f(g,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,ih(o,...t)]}function ih(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Se(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function zt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=ah({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Se(n),u=d.useCallback(c=>{if(s){const g=typeof c=="function"?c(e):c;g!==e&&a(g)}else o(c)},[s,e,o,a]);return[i,u]}function ah({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Se(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function Ua(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ee=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function Vo(e){const[t,n]=d.useState(void 0);return Ee(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function lh(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Yt=e=>{const{present:t,children:n}=e,r=ch(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Ie(r.ref,uh(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Yt.displayName="Presence";function ch(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=lh(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=ir(r.current);s.current=a==="mounted"?c:"none"},[a]),Ee(()=>{const c=r.current,f=o.current;if(f!==e){const h=s.current,p=ir(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Ee(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const m=ir(r.current).includes(p.animationName);if(p.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(s.current=ir(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ir(e){return(e==null?void 0:e.animationName)||"none"}function uh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ga=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(fh);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Bo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Bo,{...r,ref:t,children:n})});Ga.displayName="Slot";var Bo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=gh(n);return d.cloneElement(n,{...ph(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Bo.displayName="SlotClone";var dh=({children:e})=>l.jsx(l.Fragment,{children:e});function fh(e){return d.isValidElement(e)&&e.type===dh}function ph(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function gh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ye=hh.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ga:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ja(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var zo="Checkbox",[mh,CC]=Ke(zo),[vh,yh]=mh(zo),Wa=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...g}=e,[h,p]=d.useState(null),v=Ie(t,P=>p(P)),m=d.useRef(!1),y=h?f||!!h.closest("form"):!0,[w=!1,C]=zt({prop:o,defaultProp:s,onChange:c}),N=d.useRef(w);return d.useEffect(()=>{const P=h==null?void 0:h.form;if(P){const b=()=>C(N.current);return P.addEventListener("reset",b),()=>P.removeEventListener("reset",b)}},[h,C]),l.jsxs(vh,{scope:n,state:w,disabled:a,children:[l.jsx(ye.button,{type:"button",role:"checkbox","aria-checked":Nt(w)?"mixed":w,"aria-required":i,"data-state":Xa(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:ve(e.onKeyDown,P=>{P.key==="Enter"&&P.preventDefault()}),onClick:ve(e.onClick,P=>{C(b=>Nt(b)?!0:!b),y&&(m.current=P.isPropagationStopped(),m.current||P.stopPropagation())})}),y&&l.jsx(wh,{control:h,bubbles:!m.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Nt(s)?!1:s})]})});Wa.displayName=zo;var qa="CheckboxIndicator",Ka=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=yh(qa,n);return l.jsx(Yt,{present:r||Nt(s.state)||s.state===!0,children:l.jsx(ye.span,{"data-state":Xa(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ka.displayName=qa;var wh=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=Ua(n),u=Vo(t);d.useEffect(()=>{const f=i.current,g=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(g,"checked").set;if(a!==n&&p){const v=new Event("click",{bubbles:r});f.indeterminate=Nt(n),p.call(f,Nt(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Nt(n)?!1:n);return l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...s,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Nt(e){return e==="indeterminate"}function Xa(e){return Nt(e)?"indeterminate":e?"checked":"unchecked"}var Ja=Wa,bh=Ka;const Ho=d.forwardRef(({className:e,...t},n)=>l.jsx(Ja,{ref:n,className:Y("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx(bh,{className:Y("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(mg,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));Ho.displayName=Ja.displayName;var xh=d.useId||(()=>{}),Ch=0;function Zt(e){const[t,n]=d.useState(xh());return Ee(()=>{e||n(r=>r??String(Ch++))},[e]),e||(t?`radix-${t}`:"")}function Ya(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Sh="DismissableLayer",Uo="dismissableLayer.update",Eh="dismissableLayer.pointerDownOutside",Nh="dismissableLayer.focusOutside",Za,Qa=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Go=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Qa),[f,g]=d.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Ie(t,E=>g(E)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(y),C=f?m.indexOf(f):-1,N=c.layersWithOutsidePointerEventsDisabled.size>0,P=C>=w,b=Th(E=>{const $=E.target,G=[...c.branches].some(H=>H.contains($));!P||G||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},h),S=Ah(E=>{const $=E.target;[...c.branches].some(H=>H.contains($))||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},h);return Ya(E=>{C===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Za=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),tl(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Za)}},[f,h,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),tl())},[f,c]),d.useEffect(()=>{const E=()=>p({});return document.addEventListener(Uo,E),()=>document.removeEventListener(Uo,E)},[]),l.jsx(ye.div,{...u,ref:v,style:{pointerEvents:N?P?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,b.onPointerDownCapture)})});Go.displayName=Sh;var Ph="DismissableLayerBranch",el=d.forwardRef((e,t)=>{const n=d.useContext(Qa),r=d.useRef(null),o=Ie(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ye.div,{...e,ref:o})});el.displayName=Ph;function Th(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){nl(Eh,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ah(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&nl(Nh,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tl(){const e=new CustomEvent(Uo);document.dispatchEvent(e)}function nl(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ja(o,s):o.dispatchEvent(s)}var _h=Go,Fh=el,jo="focusScope.autoFocusOnMount",Wo="focusScope.autoFocusOnUnmount",rl={bubbles:!1,cancelable:!0},Oh="FocusScope",ol=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Se(o),f=Se(s),g=d.useRef(null),h=Ie(t,m=>u(m)),p=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let m=function(N){if(p.paused||!a)return;const P=N.target;a.contains(P)?g.current=P:Pt(g.current,{select:!0})},y=function(N){if(p.paused||!a)return;const P=N.relatedTarget;P!==null&&(a.contains(P)||Pt(g.current,{select:!0}))},w=function(N){if(document.activeElement===document.body)for(const b of N)b.removedNodes.length>0&&Pt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const C=new MutationObserver(w);return a&&C.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),C.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){al.add(p);const m=document.activeElement;if(!a.contains(m)){const w=new CustomEvent(jo,rl);a.addEventListener(jo,c),a.dispatchEvent(w),w.defaultPrevented||(Dh($h(sl(a)),{select:!0}),document.activeElement===m&&Pt(a))}return()=>{a.removeEventListener(jo,c),setTimeout(()=>{const w=new CustomEvent(Wo,rl);a.addEventListener(Wo,f),a.dispatchEvent(w),w.defaultPrevented||Pt(m??document.body,{select:!0}),a.removeEventListener(Wo,f),al.remove(p)},0)}}},[a,c,f,p]);const v=d.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(y&&w){const C=m.currentTarget,[N,P]=Mh(C);N&&P?!m.shiftKey&&w===P?(m.preventDefault(),n&&Pt(N,{select:!0})):m.shiftKey&&w===N&&(m.preventDefault(),n&&Pt(P,{select:!0})):w===C&&m.preventDefault()}},[n,r,p.paused]);return l.jsx(ye.div,{tabIndex:-1,...i,ref:h,onKeyDown:v})});ol.displayName=Oh;function Dh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pt(r,{select:t}),document.activeElement!==n)return}function Mh(e){const t=sl(e),n=il(t,e),r=il(t.reverse(),e);return[n,r]}function sl(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function il(e,t){for(const n of e)if(!kh(n,{upTo:t}))return n}function kh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ih(e){return e instanceof HTMLInputElement&&"select"in e}function Pt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ih(e)&&t&&e.select()}}var al=Rh();function Rh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ll(e,t),e.unshift(t)},remove(t){var n;e=ll(e,t),(n=e[0])==null||n.resume()}}}function ll(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $h(e){return e.filter(t=>t.tagName!=="A")}var Lh="Portal",qo=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Ee(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Qr.createPortal(l.jsx(ye.div,{...r,ref:t}),i):null});qo.displayName=Lh;var Ko=0;function Vh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cl()),document.body.insertAdjacentElement("beforeend",e[1]??cl()),Ko++,()=>{Ko===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ko--}},[])}function cl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Xe=function(){return Xe=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Xe.apply(this,arguments)};function ul(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function dl(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function fl(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ar="right-scroll-bar-position",lr="width-before-scroll-bar",Bh="with-scroll-bars-hidden",zh="--removed-body-scroll-bar-size";function Xo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Hh(e,t){var n=F.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Uh=typeof window<"u"?d.useLayoutEffect:d.useEffect,pl=new WeakMap;function Gh(e,t){var n=Hh(null,function(r){return e.forEach(function(o){return Xo(o,r)})});return Uh(function(){var r=pl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Xo(a,null)}),s.forEach(function(a){o.has(a)||Xo(a,i)})}pl.set(n,e)},[e]),n}function jh(e){return e}function Wh(e,t){t===void 0&&(t=jh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){i.push(f),c()},filter:function(f){return i=i.filter(f),n}}}};return o}function qh(e){e===void 0&&(e={});var t=Wh(null);return t.options=Xe({async:!0,ssr:!1},e),t}var gl=function(e){var t=e.sideCar,n=ul(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Xe({},n))};gl.isSideCarExport=!0;function Kh(e,t){return e.useMedium(t),gl}var hl=qh(),Jo=function(){},cr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Jo,onWheelCapture:Jo,onTouchMoveCapture:Jo}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,g=e.shards,h=e.sideCar,p=e.noIsolation,v=e.inert,m=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,C=e.gapMode,N=ul(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,b=Gh([n,t]),S=Xe(Xe({},N),o);return d.createElement(d.Fragment,null,f&&d.createElement(P,{sideCar:hl,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:C}),i?d.cloneElement(d.Children.only(a),Xe(Xe({},S),{ref:b})):d.createElement(w,Xe({},S,{className:u,ref:b}),a))});cr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cr.classNames={fullWidth:lr,zeroRight:ar};var Xh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xh();return t&&e.setAttribute("nonce",t),e}function Yh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Zh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Qh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Jh())&&(Yh(t,n),Zh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},em=function(){var e=Qh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ml=function(){var e=em(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},tm={left:0,top:0,right:0,gap:0},Yo=function(e){return parseInt(e||"",10)||0},nm=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Yo(n),Yo(r),Yo(o)]},rm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return tm;var t=nm(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},om=ml(),Qt="data-scroll-locked",sm=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
93
|
-
.`.concat(Bh,` {
|
|
87
|
+
*/const ma=wt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function va(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kp(...e){return t=>{let n=!1;const r=e.map(o=>{const s=va(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():va(e[o],null)}}}}var Gt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Xp);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Fo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Fo,{...r,ref:t,children:n})});Gt.displayName="Slot";var Fo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Yp(n);return d.cloneElement(n,{...Jp(r,n.props),ref:t?Kp(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Fo.displayName="SlotClone";var ya=({children:e})=>l.jsx(l.Fragment,{children:e});function Xp(e){return d.isValidElement(e)&&e.type===ya}function Jp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Yp(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wa(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=wa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ba(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=wa(e))&&(r&&(r+=" "),r+=t);return r}const Oo="-",Zp=e=>{const t=eg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Oo);return a[0]===""&&a.length!==1&&a.shift(),xa(a,t)||Qp(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},xa=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?xa(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Oo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Ca=/^\[(.+)\]$/,Qp=e=>{if(Ca.test(e)){const t=Ca.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ng(Object.entries(e.classGroups),n).forEach(([s,i])=>{Do(i,r,s,t)}),r},Do=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Sa(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(tg(o)){Do(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Do(i,Sa(t,s),n,r)})})},Sa=(e,t)=>{let n=e;return t.split(Oo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},tg=e=>e.isThemeGetter,ng=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,rg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Ea="!",og=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let c=0,f=0,g;for(let y=0;y<a.length;y++){let w=a[y];if(c===0){if(w===o&&(r||a.slice(y,y+s)===t)){u.push(a.slice(f,y)),f=y+s;continue}if(w==="/"){g=y;continue}}w==="["?c++:w==="]"&&c--}const m=u.length===0?a:a.substring(f),p=m.startsWith(Ea),v=p?m.substring(1):m,h=g&&g>f?g-f:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:i}):i},sg=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ig=e=>({cache:rg(e.cacheSize),parseClassName:og(e),...Zp(e)}),ag=/\s+/,lg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(ag);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:p}=n(c);let v=!!p,h=r(v?m.substring(0,p):m);if(!h){if(!v){a=c+(a.length>0?" "+a:a);continue}if(h=r(m),!h){a=c+(a.length>0?" "+a:a);continue}v=!1}const y=sg(f).join(":"),w=g?y+Ea:y,x=w+h;if(s.includes(x))continue;s.push(x);const E=o(h,v);for(let T=0;T<E.length;++T){const C=E[T];s.push(w+C)}a=c+(a.length>0?" "+a:a)}return a};function cg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Na(t))&&(r&&(r+=" "),r+=n);return r}const Na=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Na(e[r]))&&(n&&(n+=" "),n+=t);return n};function ug(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=ig(c),r=n.cache.get,o=n.cache.set,s=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=lg(u,n);return o(u,f),f}return function(){return s(cg.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ta=/^\[(?:([a-z-]+):)?(.+)\]$/i,dg=/^\d+\/\d+$/,fg=new Set(["px","full","screen"]),pg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,hg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,st=e=>qt(e)||fg.has(e)||dg.test(e),bt=e=>Kt(e,"length",Ng),qt=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>Kt(e,"number",qt),Cn=e=>!!e&&Number.isInteger(Number(e)),yg=e=>e.endsWith("%")&&qt(e.slice(0,-1)),ee=e=>Ta.test(e),xt=e=>pg.test(e),wg=new Set(["length","size","percentage"]),bg=e=>Kt(e,wg,Pa),xg=e=>Kt(e,"position",Pa),Cg=new Set(["image","url"]),Sg=e=>Kt(e,Cg,Pg),Eg=e=>Kt(e,"",Tg),Sn=()=>!0,Kt=(e,t,n)=>{const r=Ta.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ng=e=>gg.test(e)&&!hg.test(e),Pa=()=>!1,Tg=e=>mg.test(e),Pg=e=>vg.test(e),Ag=ug(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),s=ue("borderRadius"),i=ue("borderSpacing"),a=ue("borderWidth"),u=ue("contrast"),c=ue("grayscale"),f=ue("hueRotate"),g=ue("invert"),m=ue("gap"),p=ue("gradientColorStops"),v=ue("gradientColorStopPositions"),h=ue("inset"),y=ue("margin"),w=ue("opacity"),x=ue("padding"),E=ue("saturate"),T=ue("scale"),C=ue("sepia"),N=ue("skew"),S=ue("space"),A=ue("translate"),B=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",ee,t],$=()=>[ee,t],R=()=>["",st,bt],D=()=>["auto",qt,ee],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",ee],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>[qt,ee];return{cacheSize:500,separator:":",theme:{colors:[Sn],spacing:[st,bt],blur:["none","",xt,ee],brightness:se(),borderColor:[e],borderRadius:["none","","full",xt,ee],borderSpacing:$(),borderWidth:R(),contrast:se(),grayscale:ne(),hueRotate:se(),invert:ne(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[yg,bt],inset:K(),margin:K(),opacity:se(),padding:$(),saturate:se(),scale:se(),sepia:ne(),skew:se(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[xt]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),ee]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Cn,ee]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",Cn,ee]}],"grid-cols":[{"grid-cols":[Sn]}],"col-start-end":[{col:["auto",{span:["full",Cn,ee]},ee]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Sn]}],"row-start-end":[{row:["auto",{span:[Cn,ee]},ee]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[xt]},xt]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xt,bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mo]}],"font-family":[{font:[Sn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ee]}],"line-clamp":[{"line-clamp":["none",qt,Mo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",st,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",st,bt]}],"underline-offset":[{"underline-offset":["auto",st,ee]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),xg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Sg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[st,ee]}],"outline-w":[{outline:[st,bt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[st,bt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xt,Eg]}],"shadow-color":[{shadow:[Sn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",xt,ee]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[E]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:se()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:se()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Cn,ee]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[st,bt,Mo]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Z(...e){return Ag(ba(e))}const _g=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(2))} ${n[r]}`},Aa=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Z("s3-explr-ui-breadcrumb",e),...t}));Aa.displayName="Breadcrumb";const _a=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:Z("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",e),...t}));_a.displayName="BreadcrumbList";const $o=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));$o.displayName="BreadcrumbItem";const ko=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Gt:"a";return l.jsx(o,{ref:r,className:Z("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});ko.displayName="BreadcrumbLink";const Fg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Z("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Fg.displayName="BreadcrumbPage";const Fa=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:Z("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(ha,{})});Fa.displayName="BreadcrumbSeparator";const Oa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Da=ba,Io=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Da(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const f=n==null?void 0:n[c],g=s==null?void 0:s[c];if(f===null)return null;const m=Oa(f)||Oa(g);return o[c][m]}),a=n&&Object.entries(n).reduce((c,f)=>{let[g,m]=f;return m===void 0||(c[g]=m),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:g,className:m,...p}=f;return Object.entries(p).every(v=>{let[h,y]=v;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...c,g,m]:c},[]);return Da(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Ma=Io("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),le=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Gt:"button";return l.jsx(i,{className:Z(Ma({variant:t,size:n,className:e})),ref:s,...o})});le.displayName="Button";function Og(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function or(...e){return t=>e.forEach(n=>Og(n,t))}function ke(...e){return d.useCallback(or(...e),e)}function Dg(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,u=d.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ct(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];const c=g=>{var w;const{scope:m,children:p,...v}=g,h=((w=m==null?void 0:m[e])==null?void 0:w[u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})};c.displayName=s+"Provider";function f(g,m){var h;const p=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,Mg(o,...t)]}function Mg(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Se(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Xt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=$g({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Se(n),u=d.useCallback(c=>{if(s){const g=typeof c=="function"?c(e):c;g!==e&&a(g)}else o(c)},[s,e,o,a]);return[i,u]}function $g({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Se(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function kg(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var De=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function $a(e){const[t,n]=d.useState(void 0);return De(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Ig(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Jt=e=>{const{present:t,children:n}=e,r=Rg(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ke(r.ref,Lg(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Jt.displayName="Presence";function Rg(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Ig(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=sr(r.current);s.current=a==="mounted"?c:"none"},[a]),De(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=sr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),De(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=sr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=sr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function sr(e){return(e==null?void 0:e.animationName)||"none"}function Lg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ka=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Bg);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Ro,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ro,{...r,ref:t,children:n})});ka.displayName="Slot";var Ro=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=zg(n);return d.cloneElement(n,{...Hg(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ro.displayName="SlotClone";var Vg=({children:e})=>l.jsx(l.Fragment,{children:e});function Bg(e){return d.isValidElement(e)&&e.type===Vg}function Hg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function zg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ug=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=Ug.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?ka:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Ia(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var Lo="Checkbox",[jg,Rx]=Ct(Lo),[Wg,Gg]=jg(Lo),Ra=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...g}=e,[m,p]=d.useState(null),v=ke(t,T=>p(T)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,x]=Xt({prop:o,defaultProp:s,onChange:c}),E=d.useRef(w);return d.useEffect(()=>{const T=m==null?void 0:m.form;if(T){const C=()=>x(E.current);return T.addEventListener("reset",C),()=>T.removeEventListener("reset",C)}},[m,x]),l.jsxs(Wg,{scope:n,state:w,disabled:a,children:[l.jsx(ve.button,{type:"button",role:"checkbox","aria-checked":St(w)?"mixed":w,"aria-required":i,"data-state":Ba(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:me(e.onKeyDown,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:me(e.onClick,T=>{x(C=>St(C)?!0:!C),y&&(h.current=T.isPropagationStopped(),h.current||T.stopPropagation())})}),y&&l.jsx(qg,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:St(s)?!1:s})]})});Ra.displayName=Lo;var La="CheckboxIndicator",Va=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Gg(La,n);return l.jsx(Jt,{present:r||St(s.state)||s.state===!0,children:l.jsx(ve.span,{"data-state":Ba(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Va.displayName=La;var qg=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=kg(n),u=$a(t);d.useEffect(()=>{const f=i.current,g=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(g,"checked").set;if(a!==n&&p){const v=new Event("click",{bubbles:r});f.indeterminate=St(n),p.call(f,St(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(St(n)?!1:n);return l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...s,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function St(e){return e==="indeterminate"}function Ba(e){return St(e)?"indeterminate":e?"checked":"unchecked"}var Ha=Ra,Kg=Va;const Vo=d.forwardRef(({className:e,...t},n)=>l.jsx(Ha,{ref:n,className:Z("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx(Kg,{className:Z("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(jp,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));Vo.displayName=Ha.displayName;var Xg=d.useId||(()=>{}),Jg=0;function Yt(e){const[t,n]=d.useState(Xg());return De(()=>{e||n(r=>r??String(Jg++))},[e]),e||(t?`radix-${t}`:"")}function za(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Yg="DismissableLayer",Bo="dismissableLayer.update",Zg="dismissableLayer.pointerDownOutside",Qg="dismissableLayer.focusOutside",Ua,ja=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ho=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(ja),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=ke(t,S=>g(S)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),x=f?h.indexOf(f):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,T=x>=w,C=th(S=>{const A=S.target,B=[...c.branches].some(H=>H.contains(A));!T||B||(o==null||o(S),i==null||i(S),S.defaultPrevented||a==null||a())},m),N=nh(S=>{const A=S.target;[...c.branches].some(H=>H.contains(A))||(s==null||s(S),i==null||i(S),S.defaultPrevented||a==null||a())},m);return za(S=>{x===c.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ua=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Ga(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ua)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Ga())},[f,c]),d.useEffect(()=>{const S=()=>p({});return document.addEventListener(Bo,S),()=>document.removeEventListener(Bo,S)},[]),l.jsx(ve.div,{...u,ref:v,style:{pointerEvents:E?T?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,N.onFocusCapture),onBlurCapture:me(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,C.onPointerDownCapture)})});Ho.displayName=Yg;var eh="DismissableLayerBranch",Wa=d.forwardRef((e,t)=>{const n=d.useContext(ja),r=d.useRef(null),o=ke(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ve.div,{...e,ref:o})});Wa.displayName=eh;function th(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){qa(Zg,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function nh(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&qa(Qg,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ga(){const e=new CustomEvent(Bo);document.dispatchEvent(e)}function qa(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ia(o,s):o.dispatchEvent(s)}var rh=Ho,oh=Wa,zo="focusScope.autoFocusOnMount",Uo="focusScope.autoFocusOnUnmount",Ka={bubbles:!1,cancelable:!0},sh="FocusScope",Xa=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Se(o),f=Se(s),g=d.useRef(null),m=ke(t,h=>u(h)),p=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(E){if(p.paused||!a)return;const T=E.target;a.contains(T)?g.current=T:Et(g.current,{select:!0})},y=function(E){if(p.paused||!a)return;const T=E.relatedTarget;T!==null&&(a.contains(T)||Et(g.current,{select:!0}))},w=function(E){if(document.activeElement===document.body)for(const C of E)C.removedNodes.length>0&&Et(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const x=new MutationObserver(w);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){Za.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(zo,Ka);a.addEventListener(zo,c),a.dispatchEvent(w),w.defaultPrevented||(ih(dh(Ja(a)),{select:!0}),document.activeElement===h&&Et(a))}return()=>{a.removeEventListener(zo,c),setTimeout(()=>{const w=new CustomEvent(Uo,Ka);a.addEventListener(Uo,f),a.dispatchEvent(w),w.defaultPrevented||Et(h??document.body,{select:!0}),a.removeEventListener(Uo,f),Za.remove(p)},0)}}},[a,c,f,p]);const v=d.useCallback(h=>{if(!n&&!r||p.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(y&&w){const x=h.currentTarget,[E,T]=ah(x);E&&T?!h.shiftKey&&w===T?(h.preventDefault(),n&&Et(E,{select:!0})):h.shiftKey&&w===E&&(h.preventDefault(),n&&Et(T,{select:!0})):w===x&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(ve.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Xa.displayName=sh;function ih(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Et(r,{select:t}),document.activeElement!==n)return}function ah(e){const t=Ja(e),n=Ya(t,e),r=Ya(t.reverse(),e);return[n,r]}function Ja(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ya(e,t){for(const n of e)if(!lh(n,{upTo:t}))return n}function lh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ch(e){return e instanceof HTMLInputElement&&"select"in e}function Et(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ch(e)&&t&&e.select()}}var Za=uh();function uh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Qa(e,t),e.unshift(t)},remove(t){var n;e=Qa(e,t),(n=e[0])==null||n.resume()}}}function Qa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dh(e){return e.filter(t=>t.tagName!=="A")}var fh="Portal",jo=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);De(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Yr.createPortal(l.jsx(ve.div,{...r,ref:t}),i):null});jo.displayName=fh;var Wo=0;function ph(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??el()),document.body.insertAdjacentElement("beforeend",e[1]??el()),Wo++,()=>{Wo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wo--}},[])}function el(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ke=function(){return Ke=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ke.apply(this,arguments)};function tl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function nl(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function rl(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ir="right-scroll-bar-position",ar="width-before-scroll-bar",gh="with-scroll-bars-hidden",hh="--removed-body-scroll-bar-size";function Go(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mh(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var vh=typeof window<"u"?d.useLayoutEffect:d.useEffect,ol=new WeakMap;function yh(e,t){var n=mh(null,function(r){return e.forEach(function(o){return Go(o,r)})});return vh(function(){var r=ol.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Go(a,null)}),s.forEach(function(a){o.has(a)||Go(a,i)})}ol.set(n,e)},[e]),n}function wh(e){return e}function bh(e,t){t===void 0&&(t=wh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){i.push(f),c()},filter:function(f){return i=i.filter(f),n}}}};return o}function xh(e){e===void 0&&(e={});var t=bh(null);return t.options=Ke({async:!0,ssr:!1},e),t}var sl=function(e){var t=e.sideCar,n=tl(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Ke({},n))};sl.isSideCarExport=!0;function Ch(e,t){return e.useMedium(t),sl}var il=xh(),qo=function(){},lr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:qo,onWheelCapture:qo,onTouchMoveCapture:qo}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,g=e.shards,m=e.sideCar,p=e.noIsolation,v=e.inert,h=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,x=e.gapMode,E=tl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=m,C=yh([n,t]),N=Ke(Ke({},E),o);return d.createElement(d.Fragment,null,f&&d.createElement(T,{sideCar:il,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:x}),i?d.cloneElement(d.Children.only(a),Ke(Ke({},N),{ref:C})):d.createElement(w,Ke({},N,{className:u,ref:C}),a))});lr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lr.classNames={fullWidth:ar,zeroRight:ir};var Sh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Eh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Sh();return t&&e.setAttribute("nonce",t),e}function Nh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Th(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ph=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Eh())&&(Nh(t,n),Th(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ah=function(){var e=Ph();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},al=function(){var e=Ah(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},_h={left:0,top:0,right:0,gap:0},Ko=function(e){return parseInt(e||"",10)||0},Fh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ko(n),Ko(r),Ko(o)]},Oh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _h;var t=Fh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Dh=al(),Zt="data-scroll-locked",Mh=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
88
|
+
.`.concat(gh,` {
|
|
94
89
|
overflow: hidden `).concat(r,`;
|
|
95
90
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
96
91
|
}
|
|
97
|
-
body[`).concat(
|
|
92
|
+
body[`).concat(Zt,`] {
|
|
98
93
|
overflow: hidden `).concat(r,`;
|
|
99
94
|
overscroll-behavior: contain;
|
|
100
95
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
@@ -107,32 +102,32 @@
|
|
|
107
102
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
108
103
|
}
|
|
109
104
|
|
|
110
|
-
.`).concat(
|
|
105
|
+
.`).concat(ir,` {
|
|
111
106
|
right: `).concat(a,"px ").concat(r,`;
|
|
112
107
|
}
|
|
113
108
|
|
|
114
|
-
.`).concat(
|
|
109
|
+
.`).concat(ar,` {
|
|
115
110
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
116
111
|
}
|
|
117
112
|
|
|
118
|
-
.`).concat(
|
|
113
|
+
.`).concat(ir," .").concat(ir,` {
|
|
119
114
|
right: 0 `).concat(r,`;
|
|
120
115
|
}
|
|
121
116
|
|
|
122
|
-
.`).concat(
|
|
117
|
+
.`).concat(ar," .").concat(ar,` {
|
|
123
118
|
margin-right: 0 `).concat(r,`;
|
|
124
119
|
}
|
|
125
120
|
|
|
126
|
-
body[`).concat(
|
|
127
|
-
`).concat(
|
|
121
|
+
body[`).concat(Zt,`] {
|
|
122
|
+
`).concat(hh,": ").concat(a,`px;
|
|
128
123
|
}
|
|
129
|
-
`)},
|
|
124
|
+
`)},ll=function(){var e=parseInt(document.body.getAttribute(Zt)||"0",10);return isFinite(e)?e:0},$h=function(){d.useEffect(function(){return document.body.setAttribute(Zt,(ll()+1).toString()),function(){var e=ll()-1;e<=0?document.body.removeAttribute(Zt):document.body.setAttribute(Zt,e.toString())}},[])},kh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;$h();var s=d.useMemo(function(){return Oh(o)},[o]);return d.createElement(Dh,{styles:Mh(s,!t,o,n?"":"!important")})},Xo=!1;if(typeof window<"u")try{var cr=Object.defineProperty({},"passive",{get:function(){return Xo=!0,!0}});window.addEventListener("test",cr,cr),window.removeEventListener("test",cr,cr)}catch{Xo=!1}var Qt=Xo?{passive:!1}:!1,Ih=function(e){return e.tagName==="TEXTAREA"},cl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ih(e)&&n[t]==="visible")},Rh=function(e){return cl(e,"overflowY")},Lh=function(e){return cl(e,"overflowX")},ul=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=dl(e,r);if(o){var s=fl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vh=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Bh=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dl=function(e,t){return e==="v"?Rh(t):Lh(t)},fl=function(e,t){return e==="v"?Vh(t):Bh(t)},Hh=function(e,t){return e==="h"&&t==="rtl"?-1:1},zh=function(e,t,n,r,o){var s=Hh(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,u=t.contains(a),c=!1,f=i>0,g=0,m=0;do{var p=fl(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&dl(e,a)&&(g+=w,m+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(Math.abs(g)<1||!o)||!f&&(Math.abs(m)<1||!o))&&(c=!0),c},ur=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pl=function(e){return[e.deltaX,e.deltaY]},gl=function(e){return e&&"current"in e?e.current:e},Uh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jh=function(e){return`
|
|
130
125
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
131
126
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
132
|
-
`)},vm=0,tn=[];function ym(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(vm++)[0],s=d.useState(ml)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=fl([e.lockRef.current],(e.shards||[]).map(Sl),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var w=dr(m),C=n.current,N="deltaX"in m?m.deltaX:C[0]-w[0],P="deltaY"in m?m.deltaY:C[1]-w[1],b,S=m.target,E=Math.abs(N)>Math.abs(P)?"h":"v";if("touches"in m&&E==="h"&&S.type==="range")return!1;var $=wl(E,S);if(!$)return!0;if($?b=E:(b=E==="v"?"h":"v",$=wl(E,S)),!$)return!1;if(!r.current&&"changedTouches"in m&&(N||P)&&(r.current=b),!b)return!0;var G=r.current||b;return gm(G,y,m,G==="h"?N:P,!0)},[]),u=d.useCallback(function(m){var y=m;if(!(!tn.length||tn[tn.length-1]!==s)){var w="deltaY"in y?Cl(y):dr(y),C=t.current.filter(function(b){return b.name===y.type&&(b.target===y.target||y.target===b.shadowParent)&&hm(b.delta,w)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var N=(i.current.shards||[]).map(Sl).filter(Boolean).filter(function(b){return b.contains(y.target)}),P=N.length>0?a(y,N[0]):!i.current.noIsolation;P&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(m,y,w,C){var N={name:m,delta:y,target:w,should:C,shadowParent:wm(w)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(P){return P!==N})},1)},[]),f=d.useCallback(function(m){n.current=dr(m),r.current=void 0},[]),g=d.useCallback(function(m){c(m.type,Cl(m),m.target,a(m,e.lockRef.current))},[]),h=d.useCallback(function(m){c(m.type,dr(m),m.target,a(m,e.lockRef.current))},[]);d.useEffect(function(){return tn.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:h}),document.addEventListener("wheel",u,en),document.addEventListener("touchmove",u,en),document.addEventListener("touchstart",f,en),function(){tn=tn.filter(function(m){return m!==s}),document.removeEventListener("wheel",u,en),document.removeEventListener("touchmove",u,en),document.removeEventListener("touchstart",f,en)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:mm(o)}):null,p?d.createElement(am,{gapMode:e.gapMode}):null)}function wm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const bm=Kh(hl,ym);var El=d.forwardRef(function(e,t){return d.createElement(cr,Xe({},e,{ref:t,sideCar:bm}))});El.classNames=cr.classNames;var xm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nn=new WeakMap,fr=new WeakMap,pr={},Qo=0,Nl=function(e){return e&&(e.host||Nl(e.parentNode))},Cm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Nl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Sm=function(e,t,n,r){var o=Cm(t,Array.isArray(e)?e:[e]);pr[n]||(pr[n]=new WeakMap);var s=pr[n],i=[],a=new Set,u=new Set(o),c=function(g){!g||a.has(g)||(a.add(g),c(g.parentNode))};o.forEach(c);var f=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(h){if(a.has(h))f(h);else try{var p=h.getAttribute(r),v=p!==null&&p!=="false",m=(nn.get(h)||0)+1,y=(s.get(h)||0)+1;nn.set(h,m),s.set(h,y),i.push(h),m===1&&v&&fr.set(h,!0),y===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return f(t),a.clear(),Qo++,function(){i.forEach(function(g){var h=nn.get(g)-1,p=s.get(g)-1;nn.set(g,h),s.set(g,p),h||(fr.has(g)||g.removeAttribute(r),fr.delete(g)),p||g.removeAttribute(n)}),Qo--,Qo||(nn=new WeakMap,nn=new WeakMap,fr=new WeakMap,pr={})}},Em=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=xm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Sm(r,o,n,"aria-hidden")):function(){return null}},Pl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Pm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(es,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(es,{...r,ref:t,children:n})});Pl.displayName="Slot";var es=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Am(n);return d.cloneElement(n,{...Tm(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});es.displayName="SlotClone";var Nm=({children:e})=>l.jsx(l.Fragment,{children:e});function Pm(e){return d.isValidElement(e)&&e.type===Nm}function Tm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Am(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ts="Dialog",[Tl,SC]=Ke(ts),[_m,ze]=Tl(ts),Al=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=d.useRef(null),u=d.useRef(null),[c=!1,f]=zt({prop:r,defaultProp:o,onChange:s});return l.jsx(_m,{scope:t,triggerRef:a,contentRef:u,contentId:Zt(),titleId:Zt(),descriptionId:Zt(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};Al.displayName=ts;var _l="DialogTrigger",Fl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ze(_l,n),s=Ie(t,o.triggerRef);return l.jsx(ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":os(o.open),...r,ref:s,onClick:ve(e.onClick,o.onOpenToggle)})});Fl.displayName=_l;var ns="DialogPortal",[Fm,Ol]=Tl(ns,{forceMount:void 0}),Dl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=ze(ns,t);return l.jsx(Fm,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(Yt,{present:n||s.open,children:l.jsx(qo,{asChild:!0,container:o,children:i})}))})};Dl.displayName=ns;var gr="DialogOverlay",Ml=d.forwardRef((e,t)=>{const n=Ol(gr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=ze(gr,e.__scopeDialog);return s.modal?l.jsx(Yt,{present:r||s.open,children:l.jsx(Om,{...o,ref:t})}):null});Ml.displayName=gr;var Om=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ze(gr,n);return l.jsx(El,{as:Pl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(ye.div,{"data-state":os(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ht="DialogContent",kl=d.forwardRef((e,t)=>{const n=Ol(Ht,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=ze(Ht,e.__scopeDialog);return l.jsx(Yt,{present:r||s.open,children:s.modal?l.jsx(Dm,{...o,ref:t}):l.jsx(Mm,{...o,ref:t})})});kl.displayName=Ht;var Dm=d.forwardRef((e,t)=>{const n=ze(Ht,e.__scopeDialog),r=d.useRef(null),o=Ie(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return Em(s)},[]),l.jsx(Il,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,s=>s.preventDefault())})}),Mm=d.forwardRef((e,t)=>{const n=ze(Ht,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Il,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Il=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=ze(Ht,n),u=d.useRef(null),c=Ie(t,u);return Vh(),l.jsxs(l.Fragment,{children:[l.jsx(ol,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Go,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":os(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(km,{titleId:a.titleId}),l.jsx(Rm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),rs="DialogTitle",Rl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ze(rs,n);return l.jsx(ye.h2,{id:o.titleId,...r,ref:t})});Rl.displayName=rs;var $l="DialogDescription",Ll=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ze($l,n);return l.jsx(ye.p,{id:o.descriptionId,...r,ref:t})});Ll.displayName=$l;var Vl="DialogClose",Bl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ze(Vl,n);return l.jsx(ye.button,{type:"button",...r,ref:t,onClick:ve(e.onClick,()=>o.onOpenChange(!1))})});Bl.displayName=Vl;function os(e){return e?"open":"closed"}var zl="DialogTitleWarning",[EC,Hl]=sh(zl,{contentName:Ht,titleName:rs,docsSlug:"dialog"}),km=({titleId:e})=>{const t=Hl(zl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
127
|
+
`)},Wh=0,en=[];function Gh(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(Wh++)[0],s=d.useState(al)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=rl([e.lockRef.current],(e.shards||[]).map(gl),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var w=ur(h),x=n.current,E="deltaX"in h?h.deltaX:x[0]-w[0],T="deltaY"in h?h.deltaY:x[1]-w[1],C,N=h.target,S=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in h&&S==="h"&&N.type==="range")return!1;var A=ul(S,N);if(!A)return!0;if(A?C=S:(C=S==="v"?"h":"v",A=ul(S,N)),!A)return!1;if(!r.current&&"changedTouches"in h&&(E||T)&&(r.current=C),!C)return!0;var B=r.current||C;return zh(B,y,h,B==="h"?E:T,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!en.length||en[en.length-1]!==s)){var w="deltaY"in y?pl(y):ur(y),x=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&Uh(C.delta,w)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var E=(i.current.shards||[]).map(gl).filter(Boolean).filter(function(C){return C.contains(y.target)}),T=E.length>0?a(y,E[0]):!i.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(h,y,w,x){var E={name:h,delta:y,target:w,should:x,shadowParent:qh(w)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),f=d.useCallback(function(h){n.current=ur(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,pl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,ur(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return en.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Qt),document.addEventListener("touchmove",u,Qt),document.addEventListener("touchstart",f,Qt),function(){en=en.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,Qt),document.removeEventListener("touchmove",u,Qt),document.removeEventListener("touchstart",f,Qt)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:jh(o)}):null,p?d.createElement(kh,{gapMode:e.gapMode}):null)}function qh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Kh=Ch(il,Gh);var hl=d.forwardRef(function(e,t){return d.createElement(lr,Ke({},e,{ref:t,sideCar:Kh}))});hl.classNames=lr.classNames;var Xh=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},tn=new WeakMap,dr=new WeakMap,fr={},Jo=0,ml=function(e){return e&&(e.host||ml(e.parentNode))},Jh=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ml(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Yh=function(e,t,n,r){var o=Jh(t,Array.isArray(e)?e:[e]);fr[n]||(fr[n]=new WeakMap);var s=fr[n],i=[],a=new Set,u=new Set(o),c=function(g){!g||a.has(g)||(a.add(g),c(g.parentNode))};o.forEach(c);var f=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(m){if(a.has(m))f(m);else try{var p=m.getAttribute(r),v=p!==null&&p!=="false",h=(tn.get(m)||0)+1,y=(s.get(m)||0)+1;tn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&dr.set(m,!0),y===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return f(t),a.clear(),Jo++,function(){i.forEach(function(g){var m=tn.get(g)-1,p=s.get(g)-1;tn.set(g,m),s.set(g,p),m||(dr.has(g)||g.removeAttribute(r),dr.delete(g)),p||g.removeAttribute(n)}),Jo--,Jo||(tn=new WeakMap,tn=new WeakMap,dr=new WeakMap,fr={})}},Zh=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Xh(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Yh(r,o,n,"aria-hidden")):function(){return null}},vl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(em);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Yo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Yo,{...r,ref:t,children:n})});vl.displayName="Slot";var Yo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=nm(n);return d.cloneElement(n,{...tm(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Yo.displayName="SlotClone";var Qh=({children:e})=>l.jsx(l.Fragment,{children:e});function em(e){return d.isValidElement(e)&&e.type===Qh}function tm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function nm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zo="Dialog",[yl,Lx]=Ct(Zo),[rm,He]=yl(Zo),wl=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=d.useRef(null),u=d.useRef(null),[c=!1,f]=Xt({prop:r,defaultProp:o,onChange:s});return l.jsx(rm,{scope:t,triggerRef:a,contentRef:u,contentId:Yt(),titleId:Yt(),descriptionId:Yt(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};wl.displayName=Zo;var bl="DialogTrigger",xl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(bl,n),s=ke(t,o.triggerRef);return l.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ts(o.open),...r,ref:s,onClick:me(e.onClick,o.onOpenToggle)})});xl.displayName=bl;var Qo="DialogPortal",[om,Cl]=yl(Qo,{forceMount:void 0}),Sl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=He(Qo,t);return l.jsx(om,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(Jt,{present:n||s.open,children:l.jsx(jo,{asChild:!0,container:o,children:i})}))})};Sl.displayName=Qo;var pr="DialogOverlay",El=d.forwardRef((e,t)=>{const n=Cl(pr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=He(pr,e.__scopeDialog);return s.modal?l.jsx(Jt,{present:r||s.open,children:l.jsx(sm,{...o,ref:t})}):null});El.displayName=pr;var sm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(pr,n);return l.jsx(hl,{as:vl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(ve.div,{"data-state":ts(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),It="DialogContent",Nl=d.forwardRef((e,t)=>{const n=Cl(It,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=He(It,e.__scopeDialog);return l.jsx(Jt,{present:r||s.open,children:s.modal?l.jsx(im,{...o,ref:t}):l.jsx(am,{...o,ref:t})})});Nl.displayName=It;var im=d.forwardRef((e,t)=>{const n=He(It,e.__scopeDialog),r=d.useRef(null),o=ke(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return Zh(s)},[]),l.jsx(Tl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:me(e.onFocusOutside,s=>s.preventDefault())})}),am=d.forwardRef((e,t)=>{const n=He(It,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Tl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Tl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=He(It,n),u=d.useRef(null),c=ke(t,u);return ph(),l.jsxs(l.Fragment,{children:[l.jsx(Xa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Ho,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ts(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(lm,{titleId:a.titleId}),l.jsx(um,{contentRef:u,descriptionId:a.descriptionId})]})]})}),es="DialogTitle",Pl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(es,n);return l.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Pl.displayName=es;var Al="DialogDescription",_l=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(Al,n);return l.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});_l.displayName=Al;var Fl="DialogClose",Ol=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(Fl,n);return l.jsx(ve.button,{type:"button",...r,ref:t,onClick:me(e.onClick,()=>o.onOpenChange(!1))})});Ol.displayName=Fl;function ts(e){return e?"open":"closed"}var Dl="DialogTitleWarning",[Vx,Ml]=Dg(Dl,{contentName:It,titleName:es,docsSlug:"dialog"}),lm=({titleId:e})=>{const t=Ml(Dl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
133
128
|
|
|
134
129
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
135
130
|
|
|
136
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Im="DialogDescriptionWarning",Rm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hl(Im).contentName}}.`;return d.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},$m=Al,Lm=Fl,Vm=Dl,Ul=Ml,Gl=kl,jl=Rl,Wl=Ll,Bm=Bl;const Ut=$m,En=Lm,zm=Vm,ql=d.forwardRef(({className:e,...t},n)=>l.jsx(Ul,{ref:n,className:Y("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ql.displayName=Ul.displayName;const Tt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(zm,{children:[l.jsx(ql,{}),l.jsxs(Gl,{ref:r,className:Y("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(Bm,{className:Y("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[l.jsx(Na,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),l.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Tt.displayName=Gl.displayName;const At=({className:e,...t})=>l.jsx("div",{className:Y("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});At.displayName="DialogHeader";const Nn=({className:e,...t})=>l.jsx("div",{className:Y("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Nn.displayName="DialogFooter";const _t=d.forwardRef(({className:e,...t},n)=>l.jsx(jl,{ref:n,className:Y("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));_t.displayName=jl.displayName;const hr=d.forwardRef(({className:e,...t},n)=>l.jsx(Wl,{ref:n,className:Y("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));hr.displayName=Wl.displayName;const Je=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Y("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Je.displayName="Input";var Hm="Label",Kl=d.forwardRef((e,t)=>l.jsx(ye.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Kl.displayName=Hm;var Xl=Kl;const Um=Lo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),ct=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Xl,{ref:o,className:Y(Um({variant:t,size:n}),e),...r}));ct.displayName=Xl.displayName;const mr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:Y("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:Y("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));mr.displayName="Table";const vr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:Y("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));vr.displayName="TableHeader";const yr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:Y("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));yr.displayName="TableBody";const Gm=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:Y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Gm.displayName="TableFooter";const He=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:Y("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));He.displayName="TableRow";const Ye=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:Y("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",e),...t}));Ye.displayName="TableHead";const Te=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:Y("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Te.displayName="TableCell";const jm=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:Y("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));jm.displayName="TableCaption";function ss(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function rn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function is(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Jl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Jl(e[o],null)}}}}function as(...e){return d.useCallback(is(...e),e)}var ls=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(qm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(cs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(cs,{...r,ref:t,children:n})});ls.displayName="Slot";var cs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Xm(n);return d.cloneElement(n,{...Km(r,n.props),ref:t?is(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});cs.displayName="SlotClone";var Wm=({children:e})=>l.jsx(l.Fragment,{children:e});function qm(e){return d.isValidElement(e)&&e.type===Wm}function Km(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Xm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Jm(e){const t=e+"CollectionProvider",[n,r]=Ke(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:m}=p,y=F.useRef(null),w=F.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:m})};i.displayName=t;const a=e+"CollectionSlot",u=F.forwardRef((p,v)=>{const{scope:m,children:y}=p,w=s(a,m),C=as(v,w.collectionRef);return l.jsx(ls,{ref:C,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=F.forwardRef((p,v)=>{const{scope:m,children:y,...w}=p,C=F.useRef(null),N=as(v,C),P=s(c,m);return F.useEffect(()=>(P.itemMap.set(C,{ref:C,...w}),()=>void P.itemMap.delete(C))),l.jsx(ls,{[f]:"",ref:N,children:y})});g.displayName=c;function h(p){const v=s(e+"CollectionConsumer",p);return F.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((P,b)=>w.indexOf(P.ref.current)-w.indexOf(b.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},h,r]}var Yl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Zm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(us,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(us,{...r,ref:t,children:n})});Yl.displayName="Slot";var us=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=ev(n);return d.cloneElement(n,{...Qm(r,n.props),ref:t?is(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});us.displayName="SlotClone";var Ym=({children:e})=>l.jsx(l.Fragment,{children:e});function Zm(e){return d.isValidElement(e)&&e.type===Ym}function Qm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ev(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Zl=tv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),nv=d.createContext(void 0);function ds(e){const t=d.useContext(nv);return e||t||"ltr"}var fs="rovingFocusGroup.onEntryFocus",rv={bubbles:!1,cancelable:!0},wr="RovingFocusGroup",[ps,Ql,ov]=Jm(wr),[sv,br]=Ke(wr,[ov]),[iv,av]=sv(wr),ec=d.forwardRef((e,t)=>l.jsx(ps.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(ps.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(lv,{...e,ref:t})})}));ec.displayName=wr;var lv=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...g}=e,h=d.useRef(null),p=as(t,h),v=ds(s),[m=null,y]=zt({prop:i,defaultProp:a,onChange:u}),[w,C]=d.useState(!1),N=Se(c),P=Ql(n),b=d.useRef(!1),[S,E]=d.useState(0);return d.useEffect(()=>{const $=h.current;if($)return $.addEventListener(fs,N),()=>$.removeEventListener(fs,N)},[N]),l.jsx(iv,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:m,onItemFocus:d.useCallback($=>y($),[y]),onItemShiftTab:d.useCallback(()=>C(!0),[]),onFocusableItemAdd:d.useCallback(()=>E($=>$+1),[]),onFocusableItemRemove:d.useCallback(()=>E($=>$-1),[]),children:l.jsx(Zl.div,{tabIndex:w||S===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:rn(e.onMouseDown,()=>{b.current=!0}),onFocus:rn(e.onFocus,$=>{const G=!b.current;if($.target===$.currentTarget&&G&&!w){const H=new CustomEvent(fs,rv);if($.currentTarget.dispatchEvent(H),!H.defaultPrevented){const Z=P().filter(B=>B.focusable),D=Z.find(B=>B.active),k=Z.find(B=>B.id===m),W=[D,k,...Z].filter(Boolean).map(B=>B.ref.current);rc(W,f)}}b.current=!1}),onBlur:rn(e.onBlur,()=>C(!1))})})}),tc="RovingFocusGroupItem",nc=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Zt(),u=s||a,c=av(tc,n),f=c.currentTabStopId===u,g=Ql(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),l.jsx(ps.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Zl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:rn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:rn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:rn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const m=dv(v,c.orientation,c.dir);if(m!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(C=>C.focusable).map(C=>C.ref.current);if(m==="last")w.reverse();else if(m==="prev"||m==="next"){m==="prev"&&w.reverse();const C=w.indexOf(v.currentTarget);w=c.loop?fv(w,C+1):w.slice(C+1)}setTimeout(()=>rc(w))}})})})});nc.displayName=tc;var cv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dv(e,t,n){const r=uv(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cv[r]}function rc(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var oc=ec,sc=nc;function ic(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ic(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ic(e[o],null)}}}}function gv(...e){return d.useCallback(pv(...e),e)}function hv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var ac=e=>{const{present:t,children:n}=e,r=mv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=gv(r.ref,vv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};ac.displayName="Presence";function mv(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=hv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=xr(r.current);s.current=a==="mounted"?c:"none"},[a]),Ee(()=>{const c=r.current,f=o.current;if(f!==e){const h=s.current,p=xr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Ee(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const m=xr(r.current).includes(p.animationName);if(p.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(s.current=xr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function xr(e){return(e==null?void 0:e.animationName)||"none"}function vv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function lc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=lc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():lc(e[o],null)}}}}var cc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(bv);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(gs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(gs,{...r,ref:t,children:n})});cc.displayName="Slot";var gs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Cv(n);return d.cloneElement(n,{...xv(r,n.props),ref:t?yv(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});gs.displayName="SlotClone";var wv=({children:e})=>l.jsx(l.Fragment,{children:e});function bv(e){return d.isValidElement(e)&&e.type===wv}function xv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Cv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Sv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Cr=Sv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?cc:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),hs="Tabs",[Ev,NC]=Ke(hs,[br]),uc=br(),[Nv,ms]=Ev(hs),dc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=ds(a),[g,h]=zt({prop:r,onChange:o,defaultProp:s});return l.jsx(Nv,{scope:n,baseId:Zt(),value:g,onValueChange:h,orientation:i,dir:f,activationMode:u,children:l.jsx(Cr.div,{dir:f,"data-orientation":i,...c,ref:t})})});dc.displayName=hs;var fc="TabsList",pc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=ms(fc,n),i=uc(n);return l.jsx(oc,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Cr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});pc.displayName=fc;var gc="TabsTrigger",hc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=ms(gc,n),a=uc(n),u=yc(i.baseId,r),c=wc(i.baseId,r),f=r===i.value;return l.jsx(sc,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(Cr.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:ss(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:ss(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:ss(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});hc.displayName=gc;var mc="TabsContent",vc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=ms(mc,n),u=yc(a.baseId,r),c=wc(a.baseId,r),f=r===a.value,g=d.useRef(f);return d.useEffect(()=>{const h=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(ac,{present:o||f,children:({present:h})=>l.jsx(Cr.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:h&&s})})});vc.displayName=mc;function yc(e,t){return`${e}-trigger-${t}`}function wc(e,t){return`${e}-content-${t}`}var Pv=dc,bc=pc,xc=hc,Cc=vc;const Tv=Pv,Sc=d.forwardRef(({className:e,...t},n)=>l.jsx(bc,{ref:n,className:Y("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Sc.displayName=bc.displayName;const vs=d.forwardRef(({className:e,...t},n)=>l.jsx(xc,{ref:n,className:Y("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));vs.displayName=xc.displayName;const ys=d.forwardRef(({className:e,...t},n)=>l.jsx(Cc,{ref:n,className:Y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ys.displayName=Cc.displayName;const Sr=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Y("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Sr.displayName="Textarea";function Av(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(g){const{scope:h,children:p,...v}=g,m=(h==null?void 0:h[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(m.Provider,{value:y,children:p})}function f(g,h){const p=(h==null?void 0:h[e][u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,_v(o,...t)]}function _v(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var ws=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Ov);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(bs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(bs,{...r,ref:t,children:n})});ws.displayName="Slot";var bs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Mv(n);return d.cloneElement(n,{...Dv(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});bs.displayName="SlotClone";var Fv=({children:e})=>l.jsx(l.Fragment,{children:e});function Ov(e){return d.isValidElement(e)&&e.type===Fv}function Dv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Mv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function kv(e){const t=e+"CollectionProvider",[n,r]=Av(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:m}=p,y=F.useRef(null),w=F.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:m})};i.displayName=t;const a=e+"CollectionSlot",u=F.forwardRef((p,v)=>{const{scope:m,children:y}=p,w=s(a,m),C=Ie(v,w.collectionRef);return l.jsx(ws,{ref:C,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=F.forwardRef((p,v)=>{const{scope:m,children:y,...w}=p,C=F.useRef(null),N=Ie(v,C),P=s(c,m);return F.useEffect(()=>(P.itemMap.set(C,{ref:C,...w}),()=>void P.itemMap.delete(C))),l.jsx(ws,{[f]:"",ref:N,children:y})});g.displayName=c;function h(p){const v=s(e+"CollectionConsumer",p);return F.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((P,b)=>w.indexOf(P.ref.current)-w.indexOf(b.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},h,r]}var Iv="VisuallyHidden",xs=d.forwardRef((e,t)=>l.jsx(ye.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));xs.displayName=Iv;var Cs="ToastProvider",[Ss,Rv,$v]=kv("Toast"),[Ec,PC]=Ke("Toast",[$v]),[Lv,Er]=Ec(Cs),Nc=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,u]=d.useState(null),[c,f]=d.useState(0),g=d.useRef(!1),h=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Cs}\`. Expected non-empty \`string\`.`),l.jsx(Ss.Provider,{scope:t,children:l.jsx(Lv,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:u,onToastAdd:d.useCallback(()=>f(p=>p+1),[]),onToastRemove:d.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:h,children:i})})};Nc.displayName=Cs;var Pc="ToastViewport",Vv=["F8"],Es="toast.viewportPause",Ns="toast.viewportResume",Tc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Vv,label:o="Notifications ({hotkey})",...s}=e,i=Er(Pc,n),a=Rv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),h=Ie(t,g,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;d.useEffect(()=>{const y=w=>{var N;r.length!==0&&r.every(P=>w[P]||w.code===P)&&((N=g.current)==null||N.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),d.useEffect(()=>{const y=u.current,w=g.current;if(v&&y&&w){const C=()=>{if(!i.isClosePausedRef.current){const S=new CustomEvent(Es);w.dispatchEvent(S),i.isClosePausedRef.current=!0}},N=()=>{if(i.isClosePausedRef.current){const S=new CustomEvent(Ns);w.dispatchEvent(S),i.isClosePausedRef.current=!1}},P=S=>{!y.contains(S.relatedTarget)&&N()},b=()=>{y.contains(document.activeElement)||N()};return y.addEventListener("focusin",C),y.addEventListener("focusout",P),y.addEventListener("pointermove",C),y.addEventListener("pointerleave",b),window.addEventListener("blur",C),window.addEventListener("focus",N),()=>{y.removeEventListener("focusin",C),y.removeEventListener("focusout",P),y.removeEventListener("pointermove",C),y.removeEventListener("pointerleave",b),window.removeEventListener("blur",C),window.removeEventListener("focus",N)}}},[v,i.isClosePausedRef]);const m=d.useCallback(({tabbingDirection:y})=>{const C=a().map(N=>{const P=N.ref.current,b=[P,...Zv(P)];return y==="forwards"?b:b.reverse()});return(y==="forwards"?C.reverse():C).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=C=>{var b,S,E;const N=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!N){const $=document.activeElement,G=C.shiftKey;if(C.target===y&&G){(b=c.current)==null||b.focus();return}const D=m({tabbingDirection:G?"backwards":"forwards"}),k=D.findIndex(O=>O===$);As(D.slice(k+1))?C.preventDefault():G?(S=c.current)==null||S.focus():(E=f.current)==null||E.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,m]),l.jsxs(Fh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Ps,{ref:c,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});As(y)}}),l.jsx(Ss.Slot,{scope:n,children:l.jsx(ye.ol,{tabIndex:-1,...s,ref:h})}),v&&l.jsx(Ps,{ref:f,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});As(y)}})]})});Tc.displayName=Pc;var Ac="ToastFocusProxy",Ps=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Er(Ac,n);return l.jsx(xs,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});Ps.displayName=Ac;var Nr="Toast",Bv="toast.swipeStart",zv="toast.swipeMove",Hv="toast.swipeCancel",Uv="toast.swipeEnd",_c=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=zt({prop:r,defaultProp:o,onChange:s});return l.jsx(Yt,{present:n||a,children:l.jsx(Wv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Se(e.onPause),onResume:Se(e.onResume),onSwipeStart:ve(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ve(e.onSwipeMove,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:ve(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ve(e.onSwipeEnd,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});_c.displayName=Nr;var[Gv,jv]=Ec(Nr,{onClose(){}}),Wv=d.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:u,onResume:c,onSwipeStart:f,onSwipeMove:g,onSwipeCancel:h,onSwipeEnd:p,...v}=e,m=Er(Nr,n),[y,w]=d.useState(null),C=Ie(t,O=>w(O)),N=d.useRef(null),P=d.useRef(null),b=o||m.duration,S=d.useRef(0),E=d.useRef(b),$=d.useRef(0),{onToastAdd:G,onToastRemove:H}=m,Z=Se(()=>{var W;(y==null?void 0:y.contains(document.activeElement))&&((W=m.viewport)==null||W.focus()),i()}),D=d.useCallback(O=>{!O||O===1/0||(window.clearTimeout($.current),S.current=new Date().getTime(),$.current=window.setTimeout(Z,O))},[Z]);d.useEffect(()=>{const O=m.viewport;if(O){const W=()=>{D(E.current),c==null||c()},B=()=>{const K=new Date().getTime()-S.current;E.current=E.current-K,window.clearTimeout($.current),u==null||u()};return O.addEventListener(Es,B),O.addEventListener(Ns,W),()=>{O.removeEventListener(Es,B),O.removeEventListener(Ns,W)}}},[m.viewport,b,u,c,D]),d.useEffect(()=>{s&&!m.isClosePausedRef.current&&D(b)},[s,b,m.isClosePausedRef,D]),d.useEffect(()=>(G(),()=>H()),[G,H]);const k=d.useMemo(()=>y?Rc(y):null,[y]);return m.viewport?l.jsxs(l.Fragment,{children:[k&&l.jsx(qv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:k}),l.jsx(Gv,{scope:n,onClose:Z,children:Hn.createPortal(l.jsx(Ss.ItemSlot,{scope:n,children:l.jsx(_h,{asChild:!0,onEscapeKeyDown:ve(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||Z(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(ye.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...v,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ve(e.onKeyDown,O=>{O.key==="Escape"&&(a==null||a(O.nativeEvent),O.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,Z()))}),onPointerDown:ve(e.onPointerDown,O=>{O.button===0&&(N.current={x:O.clientX,y:O.clientY})}),onPointerMove:ve(e.onPointerMove,O=>{if(!N.current)return;const W=O.clientX-N.current.x,B=O.clientY-N.current.y,K=!!P.current,q=["left","right"].includes(m.swipeDirection),ne=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,ie=q?ne(0,W):0,fe=q?0:ne(0,B),ke=O.pointerType==="touch"?10:2,ae={x:ie,y:fe},ot={originalEvent:O,delta:ae};K?(P.current=ae,Pr(zv,g,ot,{discrete:!1})):$c(ae,m.swipeDirection,ke)?(P.current=ae,Pr(Bv,f,ot,{discrete:!1}),O.target.setPointerCapture(O.pointerId)):(Math.abs(W)>ke||Math.abs(B)>ke)&&(N.current=null)}),onPointerUp:ve(e.onPointerUp,O=>{const W=P.current,B=O.target;if(B.hasPointerCapture(O.pointerId)&&B.releasePointerCapture(O.pointerId),P.current=null,N.current=null,W){const K=O.currentTarget,q={originalEvent:O,delta:W};$c(W,m.swipeDirection,m.swipeThreshold)?Pr(Uv,p,q,{discrete:!0}):Pr(Hv,h,q,{discrete:!0}),K.addEventListener("click",ne=>ne.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),qv=e=>{const{__scopeToast:t,children:n,...r}=e,o=Er(Nr,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Jv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(qo,{asChild:!0,children:l.jsx(xs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Kv="ToastTitle",Fc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ye.div,{...r,ref:t})});Fc.displayName=Kv;var Xv="ToastDescription",Oc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ye.div,{...r,ref:t})});Oc.displayName=Xv;var Dc="ToastAction",Mc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Ic,{altText:n,asChild:!0,children:l.jsx(Ts,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Dc}\`. Expected non-empty \`string\`.`),null)});Mc.displayName=Dc;var kc="ToastClose",Ts=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=jv(kc,n);return l.jsx(Ic,{asChild:!0,children:l.jsx(ye.button,{type:"button",...r,ref:t,onClick:ve(e.onClick,o.onClose)})})});Ts.displayName=kc;var Ic=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(ye.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Rc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Yv(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Rc(r))}}),t}function Pr(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ja(o,s):o.dispatchEvent(s)}var $c=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function Jv(e=()=>{}){const t=Se(e);Ee(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Yv(e){return e.nodeType===e.ELEMENT_NODE}function Zv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function As(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Qv=Nc,Lc=Tc,Vc=_c,Bc=Fc,zc=Oc,Hc=Mc,Uc=Ts;const ey=Qv,Gc=d.forwardRef(({className:e,...t},n)=>l.jsx(Lc,{ref:n,className:Y("s3-explr-ui-toast-viewport fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Gc.displayName=Lc.displayName;const ty=Lo("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),jc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Vc,{ref:r,className:Y(ty({variant:t}),e),...n}));jc.displayName=Vc.displayName;const ny=d.forwardRef(({className:e,...t},n)=>l.jsx(Hc,{ref:n,className:Y("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));ny.displayName=Hc.displayName;const Wc=d.forwardRef(({className:e,...t},n)=>l.jsx(Uc,{ref:n,className:Y("s3-explr-ui-toast-close absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(Na,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Wc.displayName=Uc.displayName;const qc=d.forwardRef(({className:e,...t},n)=>l.jsx(Bc,{ref:n,className:Y("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));qc.displayName=Bc.displayName;const Kc=d.forwardRef(({className:e,...t},n)=>l.jsx(zc,{ref:n,className:Y("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Kc.displayName=zc.displayName;const ry=1,oy=1e6;let _s=0;function sy(){return _s=(_s+1)%Number.MAX_SAFE_INTEGER,_s.toString()}const Fs=new Map,Xc=e=>{if(Fs.has(e))return;const t=setTimeout(()=>{Fs.delete(e),Pn({type:"REMOVE_TOAST",toastId:e})},oy);Fs.set(e,t)},iy=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ry)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Xc(n):e.toasts.forEach(r=>{Xc(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Tr=[];let Ar={toasts:[]};function Pn(e){Ar=iy(Ar,e),Tr.forEach(t=>{t(Ar)})}function ay({...e}){const t=sy(),n=o=>Pn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Pn({type:"DISMISS_TOAST",toastId:t});return Pn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Os(){const[e,t]=d.useState(Ar);return d.useEffect(()=>(Tr.push(t),()=>{const n=Tr.indexOf(t);n>-1&&Tr.splice(n,1)}),[e]),{...e,toast:ay,dismiss:n=>Pn({type:"DISMISS_TOAST",toastId:n})}}function Jc(){const{toasts:e}=Os();return l.jsxs(ey,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(jc,{...s,className:`s3-explr-ui-toast ${s.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(qc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Kc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Wc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(Gc,{className:"s3-explr-ui-toast-viewport"})]})}function ut(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Yc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ly(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Yc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Yc(e[o],null)}}}}function Tn(...e){return d.useCallback(ly(...e),e)}var cy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],An=cy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Bt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function uy(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var dy="DismissableLayer",Ds="dismissableLayer.update",fy="dismissableLayer.pointerDownOutside",py="dismissableLayer.focusOutside",Zc,Qc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eu=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Qc),[f,g]=d.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Tn(t,E=>g(E)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(y),C=f?m.indexOf(f):-1,N=c.layersWithOutsidePointerEventsDisabled.size>0,P=C>=w,b=my(E=>{const $=E.target,G=[...c.branches].some(H=>H.contains($));!P||G||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},h),S=vy(E=>{const $=E.target;[...c.branches].some(H=>H.contains($))||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},h);return Ya(E=>{C===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Zc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),tu(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Zc)}},[f,h,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),tu())},[f,c]),d.useEffect(()=>{const E=()=>p({});return document.addEventListener(Ds,E),()=>document.removeEventListener(Ds,E)},[]),l.jsx(An.div,{...u,ref:v,style:{pointerEvents:N?P?"auto":"none":void 0,...e.style},onFocusCapture:ut(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ut(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ut(e.onPointerDownCapture,b.onPointerDownCapture)})});eu.displayName=dy;var gy="DismissableLayerBranch",hy=d.forwardRef((e,t)=>{const n=d.useContext(Qc),r=d.useRef(null),o=Tn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(An.div,{...e,ref:o})});hy.displayName=gy;function my(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){nu(fy,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vy(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&nu(py,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tu(){const e=new CustomEvent(Ds);document.dispatchEvent(e)}function nu(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?uy(o,s):o.dispatchEvent(s)}const yy=["top","right","bottom","left"],Ft=Math.min,De=Math.max,_r=Math.round,Fr=Math.floor,Ze=e=>({x:e,y:e}),wy={left:"right",right:"left",bottom:"top",top:"bottom"},by={start:"end",end:"start"};function Ms(e,t,n){return De(e,Ft(t,n))}function dt(e,t){return typeof e=="function"?e(t):e}function ft(e){return e.split("-")[0]}function on(e){return e.split("-")[1]}function ks(e){return e==="x"?"y":"x"}function Is(e){return e==="y"?"height":"width"}function Ot(e){return["top","bottom"].includes(ft(e))?"y":"x"}function Rs(e){return ks(Ot(e))}function xy(e,t,n){n===void 0&&(n=!1);const r=on(e),o=Rs(e),s=Is(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Or(i)),[i,Or(i)]}function Cy(e){const t=Or(e);return[$s(e),t,$s(t)]}function $s(e){return e.replace(/start|end/g,t=>by[t])}function Sy(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function Ey(e,t,n,r){const o=on(e);let s=Sy(ft(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map($s)))),s}function Or(e){return e.replace(/left|right|bottom|top/g,t=>wy[t])}function Ny(e){return{top:0,right:0,bottom:0,left:0,...e}}function ru(e){return typeof e!="number"?Ny(e):{top:e,right:e,bottom:e,left:e}}function Dr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ou(e,t,n){let{reference:r,floating:o}=e;const s=Ot(t),i=Rs(t),a=Is(i),u=ft(t),c=s==="y",f=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(u){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(on(t)){case"start":p[i]-=h*(n&&c?-1:1);break;case"end":p[i]+=h*(n&&c?-1:1);break}return p}const Py=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:g}=ou(c,r,u),h=r,p={},v=0;for(let m=0;m<a.length;m++){const{name:y,fn:w}=a[m],{x:C,y:N,data:P,reset:b}=await w({x:f,y:g,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=C??f,g=N??g,p={...p,[y]:{...p[y],...P}},b&&v<=50&&(v++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(c=b.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:f,y:g}=ou(c,h,u)),m=-1)}return{x:f,y:g,placement:h,strategy:o,middlewareData:p}};async function _n(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:h=!1,padding:p=0}=dt(t,e),v=ru(p),y=a[h?g==="floating"?"reference":"floating":g],w=Dr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),C=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),P=await(s.isElement==null?void 0:s.isElement(N))?await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1}:{x:1,y:1},b=Dr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:N,strategy:u}):C);return{top:(w.top-b.top+v.top)/P.y,bottom:(b.bottom-w.bottom+v.bottom)/P.y,left:(w.left-b.left+v.left)/P.x,right:(b.right-w.right+v.right)/P.x}}const Ty=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=dt(e,t)||{};if(c==null)return{};const g=ru(f),h={x:n,y:r},p=Rs(o),v=Is(p),m=await i.getDimensions(c),y=p==="y",w=y?"top":"left",C=y?"bottom":"right",N=y?"clientHeight":"clientWidth",P=s.reference[v]+s.reference[p]-h[p]-s.floating[v],b=h[p]-s.reference[p],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=S?S[N]:0;(!E||!await(i.isElement==null?void 0:i.isElement(S)))&&(E=a.floating[N]||s.floating[v]);const $=P/2-b/2,G=E/2-m[v]/2-1,H=Ft(g[w],G),Z=Ft(g[C],G),D=H,k=E-m[v]-Z,O=E/2-m[v]/2+$,W=Ms(D,O,k),B=!u.arrow&&on(o)!=null&&O!==W&&s.reference[v]/2-(O<D?H:Z)-m[v]/2<0,K=B?O<D?O-D:O-k:0;return{[p]:h[p]+K,data:{[p]:W,centerOffset:O-W-K,...B&&{alignmentOffset:K}},reset:B}}}),Ay=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...y}=dt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=ft(o),C=Ot(a),N=ft(a)===a,P=await(u.isRTL==null?void 0:u.isRTL(c.floating)),b=h||(N||!m?[Or(a)]:Cy(a)),S=v!=="none";!h&&S&&b.push(...Ey(a,m,v,P));const E=[a,...b],$=await _n(t,y),G=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&G.push($[w]),g){const O=xy(o,i,P);G.push($[O[0]],$[O[1]])}if(H=[...H,{placement:o,overflows:G}],!G.every(O=>O<=0)){var Z,D;const O=(((Z=s.flip)==null?void 0:Z.index)||0)+1,W=E[O];if(W)return{data:{index:O,overflows:H},reset:{placement:W}};let B=(D=H.filter(K=>K.overflows[0]<=0).sort((K,q)=>K.overflows[1]-q.overflows[1])[0])==null?void 0:D.placement;if(!B)switch(p){case"bestFit":{var k;const K=(k=H.filter(q=>{if(S){const ne=Ot(q.placement);return ne===C||ne==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ne=>ne>0).reduce((ne,ie)=>ne+ie,0)]).sort((q,ne)=>q[1]-ne[1])[0])==null?void 0:k[0];K&&(B=K);break}case"initialPlacement":B=a;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function su(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iu(e){return yy.some(t=>e[t]>=0)}const _y=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=dt(e,t);switch(r){case"referenceHidden":{const s=await _n(t,{...o,elementContext:"reference"}),i=su(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:iu(i)}}}case"escaped":{const s=await _n(t,{...o,altBoundary:!0}),i=su(s,n.floating);return{data:{escapedOffsets:i,escaped:iu(i)}}}default:return{}}}}};async function Fy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ft(n),a=on(n),u=Ot(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=dt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),u?{x:p*f,y:h*c}:{x:h*c,y:p*f}}const Oy=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await Fy(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},Dy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:w,y:C}=y;return{x:w,y:C}}},...u}=dt(e,t),c={x:n,y:r},f=await _n(t,u),g=Ot(ft(o)),h=ks(g);let p=c[h],v=c[g];if(s){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",C=p+f[y],N=p-f[w];p=Ms(C,p,N)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",C=v+f[y],N=v-f[w];v=Ms(C,v,N)}const m=a.fn({...t,[h]:p,[g]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[g]:i}}}}}},My=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=dt(e,t),f={x:n,y:r},g=Ot(o),h=ks(g);let p=f[h],v=f[g];const m=dt(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const N=h==="y"?"height":"width",P=s.reference[h]-s.floating[N]+y.mainAxis,b=s.reference[h]+s.reference[N]-y.mainAxis;p<P?p=P:p>b&&(p=b)}if(c){var w,C;const N=h==="y"?"width":"height",P=["top","left"].includes(ft(o)),b=s.reference[g]-s.floating[N]+(P&&((w=i.offset)==null?void 0:w[g])||0)+(P?0:y.crossAxis),S=s.reference[g]+s.reference[N]+(P?0:((C=i.offset)==null?void 0:C[g])||0)-(P?y.crossAxis:0);v<b?v=b:v>S&&(v=S)}return{[h]:p,[g]:v}}}},ky=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=dt(e,t),f=await _n(t,c),g=ft(o),h=on(o),p=Ot(o)==="y",{width:v,height:m}=s.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=g,y=h==="end"?"top":"bottom");const C=m-f.top-f.bottom,N=v-f.left-f.right,P=Ft(m-f[y],C),b=Ft(v-f[w],N),S=!t.middlewareData.shift;let E=P,$=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=C),S&&!h){const H=De(f.left,0),Z=De(f.right,0),D=De(f.top,0),k=De(f.bottom,0);p?$=v-2*(H!==0||Z!==0?H+Z:De(f.left,f.right)):E=m-2*(D!==0||k!==0?D+k:De(f.top,f.bottom))}await u({...t,availableWidth:$,availableHeight:E});const G=await i.getDimensions(a.floating);return v!==G.width||m!==G.height?{reset:{rects:!0}}:{}}}};function Mr(){return typeof window<"u"}function sn(e){return au(e)?(e.nodeName||"").toLowerCase():"#document"}function Me(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qe(e){var t;return(t=(au(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function au(e){return Mr()?e instanceof Node||e instanceof Me(e).Node:!1}function Ue(e){return Mr()?e instanceof Element||e instanceof Me(e).Element:!1}function et(e){return Mr()?e instanceof HTMLElement||e instanceof Me(e).HTMLElement:!1}function lu(e){return!Mr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Me(e).ShadowRoot}function Fn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ge(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Iy(e){return["table","td","th"].includes(sn(e))}function kr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ls(e){const t=Vs(),n=Ue(e)?Ge(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ry(e){let t=Dt(e);for(;et(t)&&!an(t);){if(Ls(t))return t;if(kr(t))return null;t=Dt(t)}return null}function Vs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function an(e){return["html","body","#document"].includes(sn(e))}function Ge(e){return Me(e).getComputedStyle(e)}function Ir(e){return Ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Dt(e){if(sn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lu(e)&&e.host||Qe(e);return lu(t)?t.host:t}function cu(e){const t=Dt(e);return an(t)?e.ownerDocument?e.ownerDocument.body:e.body:et(t)&&Fn(t)?t:cu(t)}function On(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=cu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Me(o);if(s){const a=Bs(i);return t.concat(i,i.visualViewport||[],Fn(o)?o:[],a&&n?On(a):[])}return t.concat(o,On(o,[],n))}function Bs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uu(e){const t=Ge(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=_r(n)!==s||_r(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function zs(e){return Ue(e)?e:e.contextElement}function ln(e){const t=zs(e);if(!et(t))return Ze(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=uu(t);let i=(s?_r(n.width):n.width)/r,a=(s?_r(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const $y=Ze(0);function du(e){const t=Me(e);return!Vs()||!t.visualViewport?$y:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ly(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Me(e)?!1:t}function Gt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=zs(e);let i=Ze(1);t&&(r?Ue(r)&&(i=ln(r)):i=ln(e));const a=Ly(s,n,r)?du(s):Ze(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,g=o.height/i.y;if(s){const h=Me(s),p=r&&Ue(r)?Me(r):r;let v=h,m=Bs(v);for(;m&&r&&p!==v;){const y=ln(m),w=m.getBoundingClientRect(),C=Ge(m),N=w.left+(m.clientLeft+parseFloat(C.paddingLeft))*y.x,P=w.top+(m.clientTop+parseFloat(C.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=N,c+=P,v=Me(m),m=Bs(v)}}return Dr({width:f,height:g,x:u,y:c})}function Hs(e,t){const n=Ir(e).scrollLeft;return t?t.left+n:Gt(Qe(e)).left+n}function fu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Hs(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Vy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Qe(r),a=t?kr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=Ze(1);const f=Ze(0),g=et(r);if((g||!g&&!s)&&((sn(r)!=="body"||Fn(i))&&(u=Ir(r)),et(r))){const p=Gt(r);c=ln(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const h=i&&!g&&!s?fu(i,u,!0):Ze(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+h.x,y:n.y*c.y-u.scrollTop*c.y+f.y+h.y}}function By(e){return Array.from(e.getClientRects())}function zy(e){const t=Qe(e),n=Ir(e),r=e.ownerDocument.body,o=De(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=De(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Hs(e);const a=-n.scrollTop;return Ge(r).direction==="rtl"&&(i+=De(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Hy(e,t){const n=Me(e),r=Qe(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const c=Vs();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function Uy(e,t){const n=Gt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=et(e)?ln(e):Ze(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function pu(e,t,n){let r;if(t==="viewport")r=Hy(e,n);else if(t==="document")r=zy(Qe(e));else if(Ue(t))r=Uy(t,n);else{const o=du(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dr(r)}function gu(e,t){const n=Dt(e);return n===t||!Ue(n)||an(n)?!1:Ge(n).position==="fixed"||gu(n,t)}function Gy(e,t){const n=t.get(e);if(n)return n;let r=On(e,[],!1).filter(a=>Ue(a)&&sn(a)!=="body"),o=null;const s=Ge(e).position==="fixed";let i=s?Dt(e):e;for(;Ue(i)&&!an(i);){const a=Ge(i),u=Ls(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Fn(i)&&!u&&gu(e,i))?r=r.filter(f=>f!==i):o=a,i=Dt(i)}return t.set(e,r),r}function jy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?kr(t)?[]:Gy(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=pu(t,f,o);return c.top=De(g.top,c.top),c.right=Ft(g.right,c.right),c.bottom=Ft(g.bottom,c.bottom),c.left=De(g.left,c.left),c},pu(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Wy(e){const{width:t,height:n}=uu(e);return{width:t,height:n}}function qy(e,t,n){const r=et(t),o=Qe(t),s=n==="fixed",i=Gt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=Ze(0);if(r||!r&&!s)if((sn(t)!=="body"||Fn(o))&&(a=Ir(t)),r){const h=Gt(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&(u.x=Hs(o));const c=o&&!r&&!s?fu(o,a):Ze(0),f=i.left+a.scrollLeft-u.x-c.x,g=i.top+a.scrollTop-u.y-c.y;return{x:f,y:g,width:i.width,height:i.height}}function Us(e){return Ge(e).position==="static"}function hu(e,t){if(!et(e)||Ge(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qe(e)===n&&(n=n.ownerDocument.body),n}function mu(e,t){const n=Me(e);if(kr(e))return n;if(!et(e)){let o=Dt(e);for(;o&&!an(o);){if(Ue(o)&&!Us(o))return o;o=Dt(o)}return n}let r=hu(e,t);for(;r&&Iy(r)&&Us(r);)r=hu(r,t);return r&&an(r)&&Us(r)&&!Ls(r)?n:r||Ry(e)||n}const Ky=async function(e){const t=this.getOffsetParent||mu,n=this.getDimensions,r=await n(e.floating);return{reference:qy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xy(e){return Ge(e).direction==="rtl"}const Jy={convertOffsetParentRelativeRectToViewportRelativeRect:Vy,getDocumentElement:Qe,getClippingRect:jy,getOffsetParent:mu,getElementRects:Ky,getClientRects:By,getDimensions:Wy,getScale:ln,isElement:Ue,isRTL:Xy};function Yy(e,t){let n=null,r;const o=Qe(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const{left:c,top:f,width:g,height:h}=e.getBoundingClientRect();if(a||t(),!g||!h)return;const p=Fr(f),v=Fr(o.clientWidth-(c+g)),m=Fr(o.clientHeight-(f+h)),y=Fr(c),C={rootMargin:-p+"px "+-v+"px "+-m+"px "+-y+"px",threshold:De(0,Ft(1,u))||1};let N=!0;function P(b){const S=b[0].intersectionRatio;if(S!==u){if(!N)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N=!1}try{n=new IntersectionObserver(P,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,C)}n.observe(e)}return i(!0),s}function Zy(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=zs(e),f=o||s?[...c?On(c):[],...On(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?Yy(c,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(w=>{let[C]=w;C&&C.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var N;(N=p)==null||N.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,m=u?Gt(e):null;u&&y();function y(){const w=Gt(e);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&n(),m=w,v=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Qy=Oy,ew=Dy,tw=Ay,nw=ky,rw=_y,vu=Ty,ow=My,sw=(e,t,n)=>{const r=new Map,o={platform:Jy,...n},s={...o.platform,_c:r};return Py(e,t,{...o,platform:s})};var Rr=typeof document<"u"?F.useLayoutEffect:F.useEffect;function $r(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$r(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!$r(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function yu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wu(e,t){const n=yu(e);return Math.round(t*n)/n}function Gs(e){const t=d.useRef(e);return Rr(()=>{t.current=e}),t}function iw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,g]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=d.useState(r);$r(h,r)||p(r);const[v,m]=d.useState(null),[y,w]=d.useState(null),C=d.useCallback(q=>{q!==S.current&&(S.current=q,m(q))},[]),N=d.useCallback(q=>{q!==E.current&&(E.current=q,w(q))},[]),P=s||v,b=i||y,S=d.useRef(null),E=d.useRef(null),$=d.useRef(f),G=u!=null,H=Gs(u),Z=Gs(o),D=Gs(c),k=d.useCallback(()=>{if(!S.current||!E.current)return;const q={placement:t,strategy:n,middleware:h};Z.current&&(q.platform=Z.current),sw(S.current,E.current,q).then(ne=>{const ie={...ne,isPositioned:D.current!==!1};O.current&&!$r($.current,ie)&&($.current=ie,Hn.flushSync(()=>{g(ie)}))})},[h,t,n,Z,D]);Rr(()=>{c===!1&&$.current.isPositioned&&($.current.isPositioned=!1,g(q=>({...q,isPositioned:!1})))},[c]);const O=d.useRef(!1);Rr(()=>(O.current=!0,()=>{O.current=!1}),[]),Rr(()=>{if(P&&(S.current=P),b&&(E.current=b),P&&b){if(H.current)return H.current(P,b,k);k()}},[P,b,k,H,G]);const W=d.useMemo(()=>({reference:S,floating:E,setReference:C,setFloating:N}),[C,N]),B=d.useMemo(()=>({reference:P,floating:b}),[P,b]),K=d.useMemo(()=>{const q={position:n,left:0,top:0};if(!B.floating)return q;const ne=wu(B.floating,f.x),ie=wu(B.floating,f.y);return a?{...q,transform:"translate("+ne+"px, "+ie+"px)",...yu(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:ie}},[n,a,B.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:k,refs:W,elements:B,floatingStyles:K}),[f,k,W,B,K])}const aw=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vu({element:r.current,padding:o}).fn(n):{}:r?vu({element:r,padding:o}).fn(n):{}}}},lw=(e,t)=>({...Qy(e),options:[e,t]}),cw=(e,t)=>({...ew(e),options:[e,t]}),uw=(e,t)=>({...ow(e),options:[e,t]}),dw=(e,t)=>({...tw(e),options:[e,t]}),fw=(e,t)=>({...nw(e),options:[e,t]}),pw=(e,t)=>({...rw(e),options:[e,t]}),gw=(e,t)=>({...aw(e),options:[e,t]});var hw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],mw=hw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Bt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),vw="Arrow",bu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(mw.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});bu.displayName=vw;var yw=bu;function xu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ww(...e){return t=>{let n=!1;const r=e.map(o=>{const s=xu(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():xu(e[o],null)}}}}function Cu(...e){return d.useCallback(ww(...e),e)}var bw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Su=bw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Bt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),js="Popper",[Eu,Nu]=Ke(js),[xw,Pu]=Eu(js),Tu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(xw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Tu.displayName=js;var Au="PopperAnchor",_u=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Pu(Au,n),i=d.useRef(null),a=Cu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(Su.div,{...o,ref:a})});_u.displayName=Au;var Ws="PopperContent",[Cw,Sw]=Eu(Ws),Fu=d.forwardRef((e,t)=>{var kt,mt,st,fn,vt,yt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=e,y=Pu(Ws,n),[w,C]=d.useState(null),N=Cu(t,$e=>C($e)),[P,b]=d.useState(null),S=Vo(P),E=(S==null?void 0:S.width)??0,$=(S==null?void 0:S.height)??0,G=r+(s!=="center"?"-"+s:""),H=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},Z=Array.isArray(c)?c:[c],D=Z.length>0,k={padding:H,boundary:Z.filter(Nw),altBoundary:D},{refs:O,floatingStyles:W,placement:B,isPositioned:K,middlewareData:q}=iw({strategy:"fixed",placement:G,whileElementsMounted:(...$e)=>Zy(...$e,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[lw({mainAxis:o+$,alignmentAxis:i}),u&&cw({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?uw():void 0,...k}),u&&dw({...k}),fw({...k,apply:({elements:$e,rects:It,availableWidth:pn,availableHeight:Rt})=>{const{width:Bn,height:x}=It.reference,T=$e.floating.style;T.setProperty("--radix-popper-available-width",`${pn}px`),T.setProperty("--radix-popper-available-height",`${Rt}px`),T.setProperty("--radix-popper-anchor-width",`${Bn}px`),T.setProperty("--radix-popper-anchor-height",`${x}px`)}}),P&&gw({element:P,padding:a}),Pw({arrowWidth:E,arrowHeight:$}),h&&pw({strategy:"referenceHidden",...k})]}),[ne,ie]=Mu(B),fe=Se(v);Ee(()=>{K&&(fe==null||fe())},[K,fe]);const ke=(kt=q.arrow)==null?void 0:kt.x,ae=(mt=q.arrow)==null?void 0:mt.y,ot=((st=q.arrow)==null?void 0:st.centerOffset)!==0,[dn,ht]=d.useState();return Ee(()=>{w&&ht(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:K?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:dn,"--radix-popper-transform-origin":[(fn=q.transformOrigin)==null?void 0:fn.x,(vt=q.transformOrigin)==null?void 0:vt.y].join(" "),...((yt=q.hide)==null?void 0:yt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Cw,{scope:n,placedSide:ne,onArrowChange:b,arrowX:ke,arrowY:ae,shouldHideArrow:ot,children:l.jsx(Su.div,{"data-side":ne,"data-align":ie,...m,ref:N,style:{...m.style,animation:K?void 0:"none"}})})})});Fu.displayName=Ws;var Ou="PopperArrow",Ew={top:"bottom",right:"left",bottom:"top",left:"right"},Du=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Sw(Ou,r),i=Ew[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(yw,{...o,ref:n,style:{...o.style,display:"block"}})})});Du.displayName=Ou;function Nw(e){return e!==null}var Pw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,C;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[c,f]=Mu(n),g={start:"0%",center:"50%",end:"100%"}[f],h=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((C=o.arrow)==null?void 0:C.y)??0)+u/2;let v="",m="";return c==="bottom"?(v=i?g:`${h}px`,m=`${-u}px`):c==="top"?(v=i?g:`${h}px`,m=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,m=i?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,m=i?g:`${p}px`),{data:{x:v,y:m}}}});function Mu(e){const[t,n="center"]=e.split("-");return[t,n]}var Tw=Tu,Aw=_u,_w=Fu,Fw=Du,Ow="Portal",ku=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Ee(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Qr.createPortal(l.jsx(An.div,{...r,ref:t}),i):null});ku.displayName=Ow;function Dw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var qs=e=>{const{present:t,children:n}=e,r=Mw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Tn(r.ref,kw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};qs.displayName="Presence";function Mw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Dw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Lr(r.current);s.current=a==="mounted"?c:"none"},[a]),Ee(()=>{const c=r.current,f=o.current;if(f!==e){const h=s.current,p=Lr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Ee(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const m=Lr(r.current).includes(p.animationName);if(p.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(s.current=Lr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Lr(e){return(e==null?void 0:e.animationName)||"none"}function kw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Iw="VisuallyHidden",Iu=d.forwardRef((e,t)=>l.jsx(An.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Iu.displayName=Iw;var Rw=Iu,[Vr,TC]=Ke("Tooltip",[Nu]),Br=Nu(),Ru="TooltipProvider",$w=700,Ks="tooltip.open",[Lw,Xs]=Vr(Ru),$u=e=>{const{__scopeTooltip:t,delayDuration:n=$w,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[i,a]=d.useState(!0),u=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),l.jsx(Lw,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:d.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:s})};$u.displayName=Ru;var zr="Tooltip",[Vw,Dn]=Vr(zr),Lu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Xs(zr,e.__scopeTooltip),c=Br(t),[f,g]=d.useState(null),h=Zt(),p=d.useRef(0),v=i??u.disableHoverableContent,m=a??u.delayDuration,y=d.useRef(!1),[w=!1,C]=zt({prop:r,defaultProp:o,onChange:E=>{E?(u.onOpen(),document.dispatchEvent(new CustomEvent(Ks))):u.onClose(),s==null||s(E)}}),N=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),P=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,C(!0)},[C]),b=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,C(!1)},[C]),S=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,C(!0),p.current=0},m)},[m,C]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(Tw,{...c,children:l.jsx(Vw,{scope:t,contentId:h,open:w,stateAttribute:N,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?S():P()},[u.isOpenDelayed,S,P]),onTriggerLeave:d.useCallback(()=>{v?b():(window.clearTimeout(p.current),p.current=0)},[b,v]),onOpen:P,onClose:b,disableHoverableContent:v,children:n})})};Lu.displayName=zr;var Js="TooltipTrigger",Vu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Dn(Js,n),s=Xs(Js,n),i=Br(n),a=d.useRef(null),u=Tn(t,a,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),g=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),l.jsx(Aw,{asChild:!0,...i,children:l.jsx(An.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:ut(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:ut(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:ut(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:ut(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ut(e.onBlur,o.onClose),onClick:ut(e.onClick,o.onClose)})})});Vu.displayName=Js;var Ys="TooltipPortal",[Bw,zw]=Vr(Ys,{forceMount:void 0}),Bu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Dn(Ys,t);return l.jsx(Bw,{scope:t,forceMount:n,children:l.jsx(qs,{present:n||s.open,children:l.jsx(ku,{asChild:!0,container:o,children:r})})})};Bu.displayName=Ys;var cn="TooltipContent",zu=d.forwardRef((e,t)=>{const n=zw(cn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Dn(cn,e.__scopeTooltip);return l.jsx(qs,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Hu,{side:o,...s,ref:t}):l.jsx(Hw,{side:o,...s,ref:t})})}),Hw=d.forwardRef((e,t)=>{const n=Dn(cn,e.__scopeTooltip),r=Xs(cn,e.__scopeTooltip),o=d.useRef(null),s=Tn(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:g}=r,h=d.useCallback(()=>{a(null),g(!1)},[g]),p=d.useCallback((v,m)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},C=Ww(w,y.getBoundingClientRect()),N=qw(w,C),P=Kw(m.getBoundingClientRect()),b=Jw([...N,...P]);a(b),g(!0)},[g]);return d.useEffect(()=>()=>h(),[h]),d.useEffect(()=>{if(u&&f){const v=y=>p(y,f),m=y=>p(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",m),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",m)}}},[u,f,p,h]),d.useEffect(()=>{if(i){const v=m=>{const y=m.target,w={x:m.clientX,y:m.clientY},C=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),N=!Xw(w,i);C?h():N&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,h]),l.jsx(Hu,{...e,ref:s})}),[Uw,Gw]=Vr(zr,{isInside:!1}),Hu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Dn(cn,n),c=Br(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(Ks,f),()=>document.removeEventListener(Ks,f)),[f]),d.useEffect(()=>{if(u.trigger){const g=h=>{const p=h.target;p!=null&&p.contains(u.trigger)&&f()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,f]),l.jsx(eu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(_w,{"data-state":u.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Ta,{children:r}),l.jsx(Uw,{scope:n,isInside:!0,children:l.jsx(Rw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});zu.displayName=cn;var Uu="TooltipArrow",jw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Br(n);return Gw(Uu,n).isInside?null:l.jsx(Fw,{...o,...r,ref:t})});jw.displayName=Uu;function Ww(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function qw(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Kw(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Xw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,u=t[s].y,c=t[i].x,f=t[i].y;u>r!=f>r&&n<(c-a)*(r-u)/(f-u)+a&&(o=!o)}return o}function Jw(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Yw(t)}function Yw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Zw=$u,Qw=Lu,eb=Vu,tb=Bu,Gu=zu;const ju=Zw,Wu=Qw,qu=eb,Zs=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(tb,{children:l.jsx(Gu,{ref:r,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Zs.displayName=Gu.displayName;function nb({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const rb=d.forwardRef(nb);var ob=function(e){return function(t,n){var r=F.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Ku=function(e){return typeof e=="function"},Xu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const sb=ob(F.useEffect);function Ju(e){var t=F.useRef(e);return t.current=e,t}var ib=function(e){Xu&&(Ku(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Ju(e);F.useEffect(function(){return function(){t.current()}},[])},Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ab(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Yu=lb,cb=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,ub=cb,db=ub,fb=typeof self=="object"&&self&&self.Object===Object&&self,pb=db||fb||Function("return this")(),Zu=pb,gb=Zu,hb=function(){return gb.Date.now()},mb=hb,vb=/\s/;function yb(e){for(var t=e.length;t--&&vb.test(e.charAt(t)););return t}var wb=yb,bb=wb,xb=/^\s+/;function Cb(e){return e&&e.slice(0,bb(e)+1).replace(xb,"")}var Sb=Cb,Eb=Zu,Nb=Eb.Symbol,Qu=Nb,ed=Qu,td=Object.prototype,Pb=td.hasOwnProperty,Tb=td.toString,Mn=ed?ed.toStringTag:void 0;function Ab(e){var t=Pb.call(e,Mn),n=e[Mn];try{e[Mn]=void 0;var r=!0}catch{}var o=Tb.call(e);return r&&(t?e[Mn]=n:delete e[Mn]),o}var _b=Ab,Fb=Object.prototype,Ob=Fb.toString;function Db(e){return Ob.call(e)}var Mb=Db,nd=Qu,kb=_b,Ib=Mb,Rb="[object Null]",$b="[object Undefined]",rd=nd?nd.toStringTag:void 0;function Lb(e){return e==null?e===void 0?$b:Rb:rd&&rd in Object(e)?kb(e):Ib(e)}var Vb=Lb;function Bb(e){return e!=null&&typeof e=="object"}var zb=Bb,Hb=Vb,Ub=zb,Gb="[object Symbol]";function jb(e){return typeof e=="symbol"||Ub(e)&&Hb(e)==Gb}var Wb=jb,qb=Sb,od=Yu,Kb=Wb,sd=NaN,Xb=/^[-+]0x[0-9a-f]+$/i,Jb=/^0b[01]+$/i,Yb=/^0o[0-7]+$/i,Zb=parseInt;function Qb(e){if(typeof e=="number")return e;if(Kb(e))return sd;if(od(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=od(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=qb(e);var n=Jb.test(e);return n||Yb.test(e)?Zb(e.slice(2),n?2:8):Xb.test(e)?sd:+e}var ex=Qb,tx=Yu,Qs=mb,id=ex,nx="Expected a function",rx=Math.max,ox=Math.min;function sx(e,t,n){var r,o,s,i,a,u,c=0,f=!1,g=!1,h=!0;if(typeof e!="function")throw new TypeError(nx);t=id(t)||0,tx(n)&&(f=!!n.leading,g="maxWait"in n,s=g?rx(id(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(S){var E=r,$=o;return r=o=void 0,c=S,i=e.apply($,E),i}function v(S){return c=S,a=setTimeout(w,t),f?p(S):i}function m(S){var E=S-u,$=S-c,G=t-E;return g?ox(G,s-$):G}function y(S){var E=S-u,$=S-c;return u===void 0||E>=t||E<0||g&&$>=s}function w(){var S=Qs();if(y(S))return C(S);a=setTimeout(w,m(S))}function C(S){return a=void 0,h&&r?p(S):(r=o=void 0,i)}function N(){a!==void 0&&clearTimeout(a),c=0,r=u=o=a=void 0}function P(){return a===void 0?i:C(Qs())}function b(){var S=Qs(),E=y(S);if(r=arguments,o=this,u=S,E){if(a===void 0)return v(u);if(g)return clearTimeout(a),a=setTimeout(w,t),p(u)}return a===void 0&&(a=setTimeout(w,t)),i}return b.cancel=N,b.flush=P,b}var ix=sx;const ax=ab(ix);function lx(){var e=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,t=typeof self=="object"&&self&&self.Object===Object&&self;return e||t}lx()||(global.Date=Date);function cx(e,t){var n;Xu&&(Ku(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Ju(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=F.useMemo(function(){return ax(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,fl([],dl(i),!1))},o,t)},[]);return ib(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function ux(e,t,n){var r=dl(F.useState({}),2),o=r[0],s=r[1],i=cx(function(){s({})},n).run;F.useEffect(function(){return i()},t),sb(e,[o])}const dx=F.forwardRef(({onChange:e},t)=>{const n=F.useRef(null),[r,o]=F.useState("");return F.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),ux(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(Je,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:s=>o(s.target.value),className:"pr-8"}),r&&l.jsx("button",{onClick:()=>{var s;o(""),(s=n.current)==null||s.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:l.jsx(rb,{className:"h-5 w-5"})})]})}),je={current:!1},ad="crawl:jobs",kn="crawl:current_job",fx=e=>{const[t,n]=F.useState(null),[r,o]=F.useState(0);return F.useEffect(()=>{const s=localStorage.getItem(kn);if(s){const i=JSON.parse(s);n(i),i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),F.useEffect(()=>{if(!(t!=null&&t.startTime))return;const s=setInterval(()=>{o(Math.floor((Date.now()-t.startTime)/1e3))},1e3);return()=>clearInterval(s)},[t==null?void 0:t.startTime]),F.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await oe.get(`${e}/api/crawl/${t.id}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(kn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(kn)},100),f})}catch(a){console.error("Error polling job status:",a)}},i=setInterval(s,3e3);return s(),()=>clearInterval(i)},[t==null?void 0:t.id,e]),{currentJob:t,elapsedTime:r,setCurrentJob:s=>{s&&!s.startTime&&(s.startTime=Date.now()),n(s),s?localStorage.setItem(kn,JSON.stringify(s)):localStorage.removeItem(kn)}}},px=(e,t,n)=>{const r=[],o=s=>{(e[s]||[]).forEach(a=>{a.name.toLowerCase().includes(t.toLowerCase())&&r.push(a),a.isFolder&&a.key.startsWith(n)&&o(a.key)})};return o(n),r},Ur=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},gx=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Ur(e,o.key))}),n},hx=(e,t,n=[])=>{const[r,o]=F.useState({}),[s,i]=F.useState(!1),[a,u]=F.useState(null),c=async()=>{i(!0);try{const f=!je.current;je.current&&(je.current=!1);const g=await oe.get(`${e}/api/files`,{params:{cache:f,displayPrefixes:JSON.stringify(n),prefix:t},timeout:3e5});o(g.data),u(null)}catch(f){u(f instanceof Error?f:new Error("Failed to fetch files"))}finally{i(!1)}};return F.useEffect(()=>{c()},[]),{data:r,isLoading:s,error:a,refetch:c}},Gr=e=>{var r,o,s;const t=((s=(o=(r=e==null?void 0:e.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:s.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(t||"")},mx=F.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3000",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var qd;const[i,a]=F.useState(""),[u,c]=F.useState(new Set),[f,g]=F.useState(n),[h,p]=F.useState(!1),[v,m]=F.useState(""),[y,w]=F.useState(!1),[C,N]=F.useState(null),[P,b]=F.useState(!1),[S,E]=F.useState(!1),[$,G]=F.useState(!1),[H,Z]=F.useState(null),D=F.useRef(null),{toast:k}=Os(),[O,W]=F.useState(null),[B,K]=F.useState(""),[q,ne]=F.useState(!1),[ie,fe]=F.useState(new Set),[ke,ae]=F.useState(""),[ot,dn]=F.useState(!1),[ht,kt]=F.useState(!1),[mt,st]=F.useState("rename"),[fn,vt]=F.useState(!1),[yt,$e]=F.useState(""),[It,pn]=F.useState("1"),[Rt,Bn]=F.useState(!1),{currentJob:x,elapsedTime:T,setCurrentJob:_}=fx(t),{data:L={},isLoading:V,error:I,refetch:j}=hx(t,n,s);F.useEffect(()=>{x!=null&&x.status&&(x.status.status==="completed"?(k({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${x.url} với ${x.status.completed} trang`}),je.current=!0,j()):x.status.status==="failed"&&k({title:"Thu thập website thất bại",description:`Không thể thu thập ${x.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(qd=x==null?void 0:x.status)==null?void 0:qd.status]);const te=F.useMemo(()=>L[f]||[],[L,f]),ce=F.useMemo(()=>i?px(L,i,f):te,[te,i,f,L]),pe=F.useMemo(()=>{const M={};return ce.forEach((R,U)=>{u.has(R.key)&&(M[U]=!0)}),M},[u,ce]),wt=M=>{const R=Ur(L,M);if(R.length===0)return u.has(M)?"all":"none";const U=R.filter(re=>u.has(re)).length;return U===0?"none":U===R.length?"all":"partial"},gn=M=>{g(M)},zn=async(M,R)=>{w(!0);try{const U=`${R}${M}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:U})).status!==200){k({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}je.current=!0,await j(),k({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${M}"`}),m(""),p(!1)}catch(U){console.error("Error creating folder:",U),k({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{w(!1)}},hn=async(M,R,U)=>{Z(U);try{const re=new FormData;re.append("prefix",R),Array.from(M).forEach(ge=>{ge instanceof File&&re.append("files",ge)}),(await oe.post(`${t}/api/upload`,re,{headers:{"Content-Type":"multipart/form-data"}})).status===200&&(je.current=!0,await j(),k({title:"Đã tải lên tập tin",description:`Đã tải lên thành công ${M.length} tập tin`}))}catch(re){console.error("Error uploading files:",re),k({title:"Lỗi",description:"Không thể tải lên tập tin",variant:"destructive"})}finally{Z(null)}},wi=async M=>{b(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[M.key]}}),je.current=!0,await j(),k({title:"Đã xóa tập tin",description:`Đã xóa thành công "${M.name}"`}),N(null)}catch(R){console.error("Error deleting file:",R),k({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{b(!1)}},Wt=M=>{const R=new Set(u),U=typeof M=="function"?M(pe):M;new Set(Object.keys(pe).map(Number)).forEach(se=>{const ge=ce[se];ge&&(U[se]||(R.delete(ge.key),ge.isFolder&&Ur(L,ge.key).forEach(_e=>R.delete(_e))))}),Object.entries(U).forEach(([se,ge])=>{const _e=parseInt(se),bt=ce[_e];bt&&ge&&(R.add(bt.key),bt.isFolder&&Ur(L,bt.key).forEach(Ci=>R.add(Ci)))}),c(R)},bi=async()=>{E(!0);try{const M=Array.from(u).map(R=>{var U;for(const re in L){const se=(U=L[re])==null?void 0:U.find(ge=>ge.key===R);if(se)return se}return null}).filter(R=>R!==null);await oe.delete(`${t}/api/files`,{data:{paths:Array.from(u)}}),je.current=!0,await j(),k({title:"Đã xóa tập tin",description:`Đã xóa thành công ${M.length} mục`}),G(!1),c(new Set)}catch(M){console.error("Error deleting files:",M),k({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{E(!1)}},Zr=async(M,R)=>{ne(!0);try{const U=M.key;let re;M.isFolder?re=U.split("/").slice(0,-2).join("/")+"/":re=U.substring(0,U.lastIndexOf("/")+1);const se=re+R+(M.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:U,newPath:se}),je.current=!0,await j(),k({title:"Đã đổi tên",description:`Đã đổi tên thành công "${M.name}" thành "${R}"`}),W(null),K("")}catch(U){console.error("Error renaming item:",U),k({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{ne(!1)}},Gd=async M=>{fe(R=>new Set([...R,...M]));try{const R=await oe.post(`${t}/api/download`,{paths:M},{responseType:"blob"}),U=window.URL.createObjectURL(R.data),re=document.createElement("a");re.href=U;const se=R.headers["Content-Disposition"]||R.headers["content-disposition"],ge=se==null?void 0:se.match(/filename="(.+)"/),_e=ge?decodeURIComponent(ge[1]):"download.zip";re.setAttribute("download",_e),document.body.appendChild(re),re.click(),document.body.removeChild(re),window.URL.revokeObjectURL(U),k({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${M.length} mục${M.length>1,""}`})}catch(R){console.error("Error downloading files:",R),k({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{fe(R=>{const U=new Set(R);return M.forEach(re=>U.delete(re)),U})}},jd=f?f.replace(n,"").split("/").filter(Boolean):[],tC=()=>Array.from(u).map(M=>{var R;for(const U in L){const re=(R=L[U])==null?void 0:R.find(se=>se.key===M);if(re)return re}return null}).filter(M=>M!==null),Wd=F.useMemo(()=>{const M=[{id:"select",header:()=>{const R=gx(L,f),U=R.length>0&&R.every(se=>u.has(se)),re=R.some(se=>u.has(se));return l.jsx(Ho,{checked:U?!0:re?"indeterminate":!1,onCheckedChange:se=>{if(se){const ge=ce.reduce((_e,bt,Ci)=>(_e[Ci]=!0,_e),{});Wt(ge)}else Wt({})},"aria-label":"Chọn tất cả"})},cell:({row:R})=>{const U=R.original,se=U.isFolder?wt(U.key):u.has(U.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(Ho,{checked:se==="partial"?"indeterminate":se==="all",onCheckedChange:ge=>{const _e={...pe};ge?_e[R.index]=!0:delete _e[R.index],Wt(_e)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:R})=>{const U=R.original,re=U.key.substring(0,U.key.lastIndexOf("/"))||"/",se=i.trim()!==""&&re!==f,ge=re.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${U.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{U.isFolder&&gn(U.key)},children:[U.isFolder?l.jsx(eo,{className:"h-5 w-5 text-blue-500"}):null,U.name]}),se&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(eo,{className:"h-4 w-4 text-gray-500 my-auto"}),l.jsxs("span",{className:"flex items-center ml-1",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{gn("")},children:"/"}),ge.map((_e,bt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{gn(ge.slice(0,bt+1).join("/")+"/")},children:_e}),bt<ge.length-1&&l.jsx("span",{children:"/"})]},bt))]})]})]})}}];return r||M.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:R,row:U})=>{const re=R();return l.jsx("span",{children:U.original.isFolder?"-":nh(re)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:R})=>{const U=R.original.lastModified;return l.jsx("span",{children:U.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:R})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>Gd([R.original.key]),className:"h-8 w-8 p-0",disabled:ie.has(R.original.key),children:ie.has(R.original.key)?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):l.jsx(Ei,{className:"h-4 w-4"})}),l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>{W(R.original),K(R.original.name)},className:"h-8 w-8 p-0",children:l.jsx(sf,{className:"h-4 w-4"})}),l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>N(R.original),className:"h-8 w-8 p-0",children:l.jsx(Ni,{className:"h-4 w-4"})})]})}),M},[u,ce,pe,ie,r]),xi=Li({data:ce,columns:Wd,state:{rowSelection:pe},enableRowSelection:!0,onRowSelectionChange:Wt,getCoreRowModel:$i()}),nC=async M=>{if(Gr(M)){dn(!0);try{const R=await oe.get(`${t}/api/read-text`,{params:{path:M.key}});ae(R.data.content)}catch(R){console.error("Error loading file content:",R),k({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{dn(!1)}}},rC=async(M,R)=>{kt(!0);try{await oe.post(`${t}/api/modify-text`,{path:M.key,content:R}),k({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),je.current=!0,await j(),W(null),ae(""),st("rename")}catch(U){console.error("Error saving file content:",U),k({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{kt(!1)}};F.useEffect(()=>{O&&Gr(O)&&(nC(O),st("rename"))},[O]);const oC=async(M,R)=>{if(x){k({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}Bn(!0);try{const{data:U}=await oe.post(`${t}/api/crawl`,{url:M,limit:R,prefix:f});if(U.id){_({id:U.id,url:M,limit:R,prefix:f});const re=localStorage.getItem(ad),se=re?JSON.parse(re):[];se.some(ge=>ge.id===U.id)||(se.unshift({url:M,id:U.id,limit:R,prefix:f,timestamp:Date.now()}),se.length>20&&(se.length=20),localStorage.setItem(ad,JSON.stringify(se))),k({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${M} với giới hạn ${R}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),vt(!1),$e(""),pn("1")}}catch(U){console.error("Error crawling website:",U),k({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Bn(!1)}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx($a,{className:"s3-explr-breadcrumb",children:l.jsxs(La,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Ro,{className:"s3-explr-breadcrumb-item",children:l.jsx($o,{onClick:()=>g(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),jd.map((M,R)=>l.jsxs(l.Fragment,{children:[l.jsx(Va,{className:"s3-explr-breadcrumb-separator"},`sep-${R}`),l.jsx(Ro,{className:"s3-explr-breadcrumb-item",children:l.jsx($o,{onClick:()=>gn(n+jd.slice(0,R+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:M})},`item-${M}`)]}))]})}),l.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[l.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:l.jsx(dx,{ref:D,onChange:M=>a(M)})}),l.jsxs(le,{variant:"outline",size:"sm",onClick:()=>{je.current=!0,j()},disabled:V,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Jd,{className:`h-4 w-4 s3-explr-refresh-icon ${V?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[u.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(le,{variant:"outline",size:"sm",onClick:()=>Gd(Array.from(u)),disabled:Array.from(u).some(M=>ie.has(M)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(M=>ie.has(M))?l.jsx(Ce,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(Ei,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(Ut,{open:$,onOpenChange:G,children:[l.jsx(En,{asChild:!0,children:l.jsxs(le,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(Ni,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(At,{className:"s3-explr-dialog-header",children:[l.jsx(_t,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",u.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>G(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{variant:"destructive",onClick:bi,disabled:S,className:"s3-explr-confirm-delete-btn",children:S?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(Ut,{open:h,onOpenChange:p,children:[l.jsx(En,{asChild:!0,children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!f,children:[l.jsx(ef,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsx(At,{className:"s3-explr-dialog-header",children:l.jsx(_t,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(ct,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(Je,{disabled:y,id:"name",value:v,onChange:M=>m(M.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(le,{onClick:()=>{v.trim()&&zn(v,f)},disabled:y,className:"s3-explr-create-btn",children:[y&&l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),y?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const M=document.createElement("input");M.type="file",M.multiple=!0,M.onchange=R=>{const U=R.target.files;U&&hn(U,f,"files")},M.click()},disabled:H!==null||!!s&&!f,children:H==="files"?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Zd,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const M=document.createElement("input");M.type="file",M.multiple=!0,M.webkitdirectory=!0,M.onchange=R=>{const U=R.target.files;U&&hn(U,f,"folder")},M.click()},disabled:H!==null||!!s&&!f,children:H==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(eo,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),x?l.jsx(ju,{delayDuration:0,children:l.jsxs(Wu,{children:[l.jsx(qu,{asChild:!0,children:l.jsx("div",{children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(Ce,{className:"h-4 w-4 animate-spin s3-explr-loader"}),x.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",x.status.completed,"/",x.status.total,") - ",Math.floor(T/60),":",String(T%60).padStart(2,"0")]}):"Đang thu thập..."]})})}),x.status&&l.jsx(Zs,{side:"right",sideOffset:5,children:l.jsxs("div",{className:"space-y-1 p-2",children:[l.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",x.url]}),l.jsxs("p",{children:["Tiến độ: ",x.status.completed,"/",x.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(T/60),":",String(T%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",x.status.status==="scraping"?"Đang thu thập":x.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Ut,{open:fn,onOpenChange:vt,children:[l.jsx(En,{asChild:!0,children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!f,children:[l.jsx(rf,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(At,{className:"s3-explr-dialog-header",children:[l.jsx(_t,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(hr,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(ct,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(Je,{id:"websiteUrl",value:yt,onChange:M=>$e(M.target.value),placeholder:"https://example.com",type:"url",disabled:Rt,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(ct,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(Je,{id:"crawlLimit",value:It,onChange:M=>{const R=M.target.value;/^\d*$/.test(R)&&pn(R)},placeholder:"1",type:"text",disabled:Rt,className:"s3-explr-input"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>{vt(!1),$e(""),pn("1")},disabled:Rt,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{onClick:()=>{yt.trim()&&oC(yt.trim(),parseInt(It)||1)},disabled:Rt||!yt.trim(),className:"s3-explr-crawl-btn",children:Rt?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(Ut,{open:!!C,onOpenChange:M=>!M&&N(null),children:l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(At,{className:"s3-explr-dialog-header",children:[l.jsx(_t,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",C==null?void 0:C.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>N(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{variant:"destructive",onClick:()=>wi(C),disabled:P,className:"s3-explr-confirm-delete-btn",children:P?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(Ut,{open:!!O,onOpenChange:M=>{M||(W(null),K(""),ae(""),st("rename"))},children:l.jsxs(Tt,{className:"s3-explr-dialog-content max-w-2xl",children:[l.jsx(At,{className:"s3-explr-dialog-header",children:l.jsx(_t,{className:"s3-explr-dialog-title",children:O!=null&&O.isFolder?"Đổi tên thư mục":Gr(O)?"Quản lý tập tin":"Đổi tên tập tin"})}),O&&!O.isFolder&&Gr(O)?l.jsxs(Tv,{value:mt,onValueChange:M=>st(M),children:[l.jsxs(Sc,{className:"grid w-full grid-cols-2",children:[l.jsx(vs,{value:"rename",children:"Đổi tên"}),l.jsx(vs,{value:"edit",children:"Sửa nội dung"})]}),l.jsx(ys,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(ct,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Je,{id:"newName",value:B,onChange:M=>K(M.target.value),placeholder:"Nhập tên mới",disabled:q,className:"s3-explr-input"})]})})}),l.jsx(ys,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:ot?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(Ce,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Sr,{id:"content",value:ke,onChange:M=>ae(M.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:ht})]})})})]}):l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(ct,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Je,{id:"newName",value:B,onChange:M=>K(M.target.value),placeholder:"Nhập tên mới",disabled:q,className:"s3-explr-input"})]})}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>{W(null),K(""),ae("")},className:"s3-explr-cancel-btn",children:"Hủy"}),mt==="edit"?l.jsx(le,{onClick:()=>O&&rC(O,ke),disabled:ht||ot,className:"s3-explr-save-btn",children:ht?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(le,{onClick:()=>{B.trim()&&O&&Zr(O,B.trim())},disabled:q||!B.trim()||B.trim()===(O==null?void 0:O.name),className:"s3-explr-rename-btn",children:q?l.jsxs(l.Fragment,{children:[l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})})]})]}),I&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:xi.getHeaderGroups().map(M=>l.jsx(He,{className:"hover:bg-transparent s3-explr-header-row",children:M.headers.map(R=>l.jsx(Ye,{className:"s3-explr-header-cell",children:R.isPlaceholder?null:qn(R.column.columnDef.header,R.getContext())},R.id))},M.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:xi.getRowModel().rows.length===0?l.jsx(He,{className:"s3-explr-empty-row",children:l.jsx(Te,{colSpan:Wd.length,className:"h-24 text-center s3-explr-empty-cell",children:i?l.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',i,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:V?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):xi.getRowModel().rows.map(M=>l.jsx(He,{className:"h-12 s3-explr-row",children:M.getVisibleCells().map(R=>l.jsx(Te,{className:"align-middle s3-explr-cell",children:qn(R.column.columnDef.cell,R.getContext())},R.id))},M.id))})]})}),r&&o&&l.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[l.jsxs("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:[u.size," ",(u.size===1,"tập tin")," đã chọn"]}),l.jsx(le,{variant:"default",onClick:()=>o(tC()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Jc,{})]})});var In=e=>e.type==="checkbox",jt=e=>e instanceof Date,Ne=e=>e==null;const ld=e=>typeof e=="object";var me=e=>!Ne(e)&&!Array.isArray(e)&&ld(e)&&!jt(e),vx=e=>me(e)&&e.target?In(e.target)?e.target.checked:e.target.value:e,yx=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,wx=(e,t)=>e.has(yx(t)),bx=e=>{const t=e.constructor&&e.constructor.prototype;return me(t)&&t.hasOwnProperty("isPrototypeOf")},ei=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Re(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ei&&(e instanceof Blob||r))&&(n||me(e)))if(t=n?[]:{},!n&&!bx(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Re(e[o]));else return e;return t}var jr=e=>Array.isArray(e)?e.filter(Boolean):[],he=e=>e===void 0,z=(e,t,n)=>{if(!t||!me(e))return n;const r=jr(t.split(/[,[\].]+?/)).reduce((o,s)=>Ne(o)?o:o[s],e);return he(r)||r===e?he(e[t])?n:e[t]:r},tt=e=>typeof e=="boolean",ti=e=>/^\w*$/.test(e),cd=e=>jr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),de=(e,t,n)=>{let r=-1;const o=ti(t)?[t]:cd(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let u=n;if(r!==i){const c=e[a];u=me(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const ud={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},We={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},pt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};F.createContext(null);var xx=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==We.all&&(t._proxyFormState[i]=!r||We.all),e[i]}});return o},Ae=e=>me(e)&&!Object.keys(e).length,Cx=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Ae(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===We.all)},Wr=e=>Array.isArray(e)?e:[e];function Sx(e){const t=F.useRef(e);t.current=e,F.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var nt=e=>typeof e=="string",Ex=(e,t,n,r,o)=>nt(e)?(r&&t.watch.add(e),z(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),z(n,s))):(r&&(t.watchAll=!0),n),Nx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},dd=e=>({isOnSubmit:!e||e===We.onSubmit,isOnBlur:e===We.onBlur,isOnChange:e===We.onChange,isOnAll:e===We.all,isOnTouch:e===We.onTouched}),fd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Rn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=z(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(Rn(a,t))break}else if(me(a)&&Rn(a,t))break}}};var Px=(e,t,n)=>{const r=Wr(z(e,n));return de(r,"root",t[n]),de(e,n,r),e},ni=e=>e.type==="file",rt=e=>typeof e=="function",qr=e=>{if(!ei)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Kr=e=>nt(e),ri=e=>e.type==="radio",Xr=e=>e instanceof RegExp;const pd={value:!1,isValid:!1},gd={value:!0,isValid:!0};var hd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!he(e[0].attributes.value)?he(e[0].value)||e[0].value===""?gd:{value:e[0].value,isValid:!0}:gd:pd}return pd};const md={isValid:!1,value:null};var vd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,md):md;function yd(e,t,n="validate"){if(Kr(e)||Array.isArray(e)&&e.every(Kr)||tt(e)&&!e)return{type:n,message:Kr(e)?e:"",ref:t}}var un=e=>me(e)&&!Xr(e)?e:{value:e,message:""},wd=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:g,pattern:h,validate:p,name:v,valueAsNumber:m,mount:y,disabled:w}=e._f,C=z(t,v);if(!y||w)return{};const N=i?i[0]:s,P=D=>{r&&N.reportValidity&&(N.setCustomValidity(tt(D)?"":D||""),N.reportValidity())},b={},S=ri(s),E=In(s),$=S||E,G=(m||ni(s))&&he(s.value)&&he(C)||qr(s)&&s.value===""||C===""||Array.isArray(C)&&!C.length,H=Nx.bind(null,v,n,b),Z=(D,k,O,W=pt.maxLength,B=pt.minLength)=>{const K=D?k:O;b[v]={type:D?W:B,message:K,ref:s,...H(D?W:B,K)}};if(o?!Array.isArray(C)||!C.length:a&&(!$&&(G||Ne(C))||tt(C)&&!C||E&&!hd(i).isValid||S&&!vd(i).isValid)){const{value:D,message:k}=Kr(a)?{value:!!a,message:a}:un(a);if(D&&(b[v]={type:pt.required,message:k,ref:N,...H(pt.required,k)},!n))return P(k),b}if(!G&&(!Ne(f)||!Ne(g))){let D,k;const O=un(g),W=un(f);if(!Ne(C)&&!isNaN(C)){const B=s.valueAsNumber||C&&+C;Ne(O.value)||(D=B>O.value),Ne(W.value)||(k=B<W.value)}else{const B=s.valueAsDate||new Date(C),K=ie=>new Date(new Date().toDateString()+" "+ie),q=s.type=="time",ne=s.type=="week";nt(O.value)&&C&&(D=q?K(C)>K(O.value):ne?C>O.value:B>new Date(O.value)),nt(W.value)&&C&&(k=q?K(C)<K(W.value):ne?C<W.value:B<new Date(W.value))}if((D||k)&&(Z(!!D,O.message,W.message,pt.max,pt.min),!n))return P(b[v].message),b}if((u||c)&&!G&&(nt(C)||o&&Array.isArray(C))){const D=un(u),k=un(c),O=!Ne(D.value)&&C.length>+D.value,W=!Ne(k.value)&&C.length<+k.value;if((O||W)&&(Z(O,D.message,k.message),!n))return P(b[v].message),b}if(h&&!G&&nt(C)){const{value:D,message:k}=un(h);if(Xr(D)&&!C.match(D)&&(b[v]={type:pt.pattern,message:k,ref:s,...H(pt.pattern,k)},!n))return P(k),b}if(p){if(rt(p)){const D=await p(C,t),k=yd(D,N);if(k&&(b[v]={...k,...H(pt.validate,k.message)},!n))return P(k.message),b}else if(me(p)){let D={};for(const k in p){if(!Ae(D)&&!n)break;const O=yd(await p[k](C,t),N,k);O&&(D={...O,...H(k,O.message)},P(O.message),n&&(b[v]=D))}if(!Ae(D)&&(b[v]={ref:N,...D},!n))return b}}return P(!0),b};function Tx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=he(e)?r++:e[t[r++]];return e}function Ax(e){for(const t in e)if(e.hasOwnProperty(t)&&!he(e[t]))return!1;return!0}function we(e,t){const n=Array.isArray(t)?t:ti(t)?[t]:cd(t),r=n.length===1?e:Tx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(me(r)&&Ae(r)||Array.isArray(r)&&Ax(r))&&we(e,n.slice(0,-1)),e}var oi=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},si=e=>Ne(e)||!ld(e);function Mt(e,t){if(si(e)||si(t))return e===t;if(jt(e)&&jt(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(jt(s)&&jt(i)||me(s)&&me(i)||Array.isArray(s)&&Array.isArray(i)?!Mt(s,i):s!==i)return!1}}return!0}var bd=e=>e.type==="select-multiple",_x=e=>ri(e)||In(e),ii=e=>qr(e)&&e.isConnected,xd=e=>{for(const t in e)if(rt(e[t]))return!0;return!1};function Jr(e,t={}){const n=Array.isArray(e);if(me(e)||n)for(const r in e)Array.isArray(e[r])||me(e[r])&&!xd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Jr(e[r],t[r])):Ne(e[r])||(t[r]=!0);return t}function Cd(e,t,n){const r=Array.isArray(e);if(me(e)||r)for(const o in e)Array.isArray(e[o])||me(e[o])&&!xd(e[o])?he(t)||si(n[o])?n[o]=Array.isArray(e[o])?Jr(e[o],[]):{...Jr(e[o])}:Cd(e[o],Ne(t)?{}:t[o],n[o]):n[o]=!Mt(e[o],t[o]);return n}var $n=(e,t)=>Cd(e,t,Jr(t)),Sd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>he(e)?e:t?e===""?NaN:e&&+e:n&&nt(e)?new Date(e):r?r(e):e;function ai(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ni(t)?t.files:ri(t)?vd(e.refs).value:bd(t)?[...t.selectedOptions].map(({value:n})=>n):In(t)?hd(e.refs).value:Sd(he(t.value)?e.ref.value:t.value,e)}var Fx=(e,t,n,r)=>{const o={};for(const s of e){const i=z(t,s);i&&de(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Ln=e=>he(e)?e:Xr(e)?e.source:me(e)?Xr(e.value)?e.value.source:e.value:e;const Ed="AsyncFunction";var Ox=e=>!!e&&!!e.validate&&!!(rt(e.validate)&&e.validate.constructor.name===Ed||me(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Ed)),Dx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Nd(e,t,n){const r=z(e,n);if(r||ti(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=z(t,s),a=z(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var Mx=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,kx=(e,t)=>!jr(z(e,t)).length&&we(e,t);const Ix={mode:We.onSubmit,reValidateMode:We.onChange,shouldFocusError:!0};function Rx(e={}){let t={...Ix,...e},n={submitCount:0,isDirty:!1,isLoading:rt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=me(t.defaultValues)||me(t.values)?Re(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Re(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:oi(),array:oi(),state:oi()},h=dd(t.mode),p=dd(t.reValidateMode),v=t.criteriaMode===We.all,m=x=>T=>{clearTimeout(c),c=setTimeout(x,T)},y=async x=>{if(!t.disabled&&(f.isValid||x)){const T=t.resolver?Ae((await $()).errors):await H(r,!0);T!==n.isValid&&g.state.next({isValid:T})}},w=(x,T)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((x||Array.from(a.mount)).forEach(_=>{_&&(T?de(n.validatingFields,_,T):we(n.validatingFields,_))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Ae(n.validatingFields)}))},C=(x,T=[],_,L,V=!0,I=!0)=>{if(L&&_&&!t.disabled){if(i.action=!0,I&&Array.isArray(z(r,x))){const j=_(z(r,x),L.argA,L.argB);V&&de(r,x,j)}if(I&&Array.isArray(z(n.errors,x))){const j=_(z(n.errors,x),L.argA,L.argB);V&&de(n.errors,x,j),kx(n.errors,x)}if(f.touchedFields&&I&&Array.isArray(z(n.touchedFields,x))){const j=_(z(n.touchedFields,x),L.argA,L.argB);V&&de(n.touchedFields,x,j)}f.dirtyFields&&(n.dirtyFields=$n(o,s)),g.state.next({name:x,isDirty:D(x,T),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else de(s,x,T)},N=(x,T)=>{de(n.errors,x,T),g.state.next({errors:n.errors})},P=x=>{n.errors=x,g.state.next({errors:n.errors,isValid:!1})},b=(x,T,_,L)=>{const V=z(r,x);if(V){const I=z(s,x,he(_)?z(o,x):_);he(I)||L&&L.defaultChecked||T?de(s,x,T?I:ai(V._f)):W(x,I),i.mount&&y()}},S=(x,T,_,L,V)=>{let I=!1,j=!1;const te={name:x};if(!t.disabled){const ce=!!(z(r,x)&&z(r,x)._f&&z(r,x)._f.disabled);if(!_||L){f.isDirty&&(j=n.isDirty,n.isDirty=te.isDirty=D(),I=j!==te.isDirty);const pe=ce||Mt(z(o,x),T);j=!!(!ce&&z(n.dirtyFields,x)),pe||ce?we(n.dirtyFields,x):de(n.dirtyFields,x,!0),te.dirtyFields=n.dirtyFields,I=I||f.dirtyFields&&j!==!pe}if(_){const pe=z(n.touchedFields,x);pe||(de(n.touchedFields,x,_),te.touchedFields=n.touchedFields,I=I||f.touchedFields&&pe!==_)}I&&V&&g.state.next(te)}return I?te:{}},E=(x,T,_,L)=>{const V=z(n.errors,x),I=f.isValid&&tt(T)&&n.isValid!==T;if(t.delayError&&_?(u=m(()=>N(x,_)),u(t.delayError)):(clearTimeout(c),u=null,_?de(n.errors,x,_):we(n.errors,x)),(_?!Mt(V,_):V)||!Ae(L)||I){const j={...L,...I&&tt(T)?{isValid:T}:{},errors:n.errors,name:x};n={...n,...j},g.state.next(j)}},$=async x=>{w(x,!0);const T=await t.resolver(s,t.context,Fx(x||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(x),T},G=async x=>{const{errors:T}=await $(x);if(x)for(const _ of x){const L=z(T,_);L?de(n.errors,_,L):we(n.errors,_)}else n.errors=T;return T},H=async(x,T,_={valid:!0})=>{for(const L in x){const V=x[L];if(V){const{_f:I,...j}=V;if(I){const te=a.array.has(I.name),ce=V._f&&Ox(V._f);ce&&f.validatingFields&&w([L],!0);const pe=await wd(V,s,v,t.shouldUseNativeValidation&&!T,te);if(ce&&f.validatingFields&&w([L]),pe[I.name]&&(_.valid=!1,T))break;!T&&(z(pe,I.name)?te?Px(n.errors,pe,I.name):de(n.errors,I.name,pe[I.name]):we(n.errors,I.name))}!Ae(j)&&await H(j,T,_)}}return _.valid},Z=()=>{for(const x of a.unMount){const T=z(r,x);T&&(T._f.refs?T._f.refs.every(_=>!ii(_)):!ii(T._f.ref))&&ht(x)}a.unMount=new Set},D=(x,T)=>!t.disabled&&(x&&T&&de(s,x,T),!Mt(fe(),o)),k=(x,T,_)=>Ex(x,a,{...i.mount?s:he(T)?o:nt(x)?{[x]:T}:T},_,T),O=x=>jr(z(i.mount?s:o,x,t.shouldUnregister?z(o,x,[]):[])),W=(x,T,_={})=>{const L=z(r,x);let V=T;if(L){const I=L._f;I&&(!I.disabled&&de(s,x,Sd(T,I)),V=qr(I.ref)&&Ne(T)?"":T,bd(I.ref)?[...I.ref.options].forEach(j=>j.selected=V.includes(j.value)):I.refs?In(I.ref)?I.refs.length>1?I.refs.forEach(j=>(!j.defaultChecked||!j.disabled)&&(j.checked=Array.isArray(V)?!!V.find(te=>te===j.value):V===j.value)):I.refs[0]&&(I.refs[0].checked=!!V):I.refs.forEach(j=>j.checked=j.value===V):ni(I.ref)?I.ref.value="":(I.ref.value=V,I.ref.type||g.values.next({name:x,values:{...s}})))}(_.shouldDirty||_.shouldTouch)&&S(x,V,_.shouldTouch,_.shouldDirty,!0),_.shouldValidate&&ie(x)},B=(x,T,_)=>{for(const L in T){const V=T[L],I=`${x}.${L}`,j=z(r,I);(a.array.has(x)||me(V)||j&&!j._f)&&!jt(V)?B(I,V,_):W(I,V,_)}},K=(x,T,_={})=>{const L=z(r,x),V=a.array.has(x),I=Re(T);de(s,x,I),V?(g.array.next({name:x,values:{...s}}),(f.isDirty||f.dirtyFields)&&_.shouldDirty&&g.state.next({name:x,dirtyFields:$n(o,s),isDirty:D(x,I)})):L&&!L._f&&!Ne(I)?B(x,I,_):W(x,I,_),fd(x,a)&&g.state.next({...n}),g.values.next({name:i.mount?x:void 0,values:{...s}})},q=async x=>{i.mount=!0;const T=x.target;let _=T.name,L=!0;const V=z(r,_),I=()=>T.type?ai(V._f):vx(x),j=te=>{L=Number.isNaN(te)||jt(te)&&isNaN(te.getTime())||Mt(te,z(s,_,te))};if(V){let te,ce;const pe=I(),wt=x.type===ud.BLUR||x.type===ud.FOCUS_OUT,gn=!Dx(V._f)&&!t.resolver&&!z(n.errors,_)&&!V._f.deps||Mx(wt,z(n.touchedFields,_),n.isSubmitted,p,h),zn=fd(_,a,wt);de(s,_,pe),wt?(V._f.onBlur&&V._f.onBlur(x),u&&u(0)):V._f.onChange&&V._f.onChange(x);const hn=S(_,pe,wt,!1),wi=!Ae(hn)||zn;if(!wt&&g.values.next({name:_,type:x.type,values:{...s}}),gn)return f.isValid&&(t.mode==="onBlur"?wt&&y():y()),wi&&g.state.next({name:_,...zn?{}:hn});if(!wt&&zn&&g.state.next({...n}),t.resolver){const{errors:Wt}=await $([_]);if(j(pe),L){const bi=Nd(n.errors,r,_),Zr=Nd(Wt,r,bi.name||_);te=Zr.error,_=Zr.name,ce=Ae(Wt)}}else w([_],!0),te=(await wd(V,s,v,t.shouldUseNativeValidation))[_],w([_]),j(pe),L&&(te?ce=!1:f.isValid&&(ce=await H(r,!0)));L&&(V._f.deps&&ie(V._f.deps),E(_,ce,te,hn))}},ne=(x,T)=>{if(z(n.errors,T)&&x.focus)return x.focus(),1},ie=async(x,T={})=>{let _,L;const V=Wr(x);if(t.resolver){const I=await G(he(x)?x:V);_=Ae(I),L=x?!V.some(j=>z(I,j)):_}else x?(L=(await Promise.all(V.map(async I=>{const j=z(r,I);return await H(j&&j._f?{[I]:j}:j)}))).every(Boolean),!(!L&&!n.isValid)&&y()):L=_=await H(r);return g.state.next({...!nt(x)||f.isValid&&_!==n.isValid?{}:{name:x},...t.resolver||!x?{isValid:_}:{},errors:n.errors}),T.shouldFocus&&!L&&Rn(r,ne,x?V:a.mount),L},fe=x=>{const T={...i.mount?s:o};return he(x)?T:nt(x)?z(T,x):x.map(_=>z(T,_))},ke=(x,T)=>({invalid:!!z((T||n).errors,x),isDirty:!!z((T||n).dirtyFields,x),error:z((T||n).errors,x),isValidating:!!z(n.validatingFields,x),isTouched:!!z((T||n).touchedFields,x)}),ae=x=>{x&&Wr(x).forEach(T=>we(n.errors,T)),g.state.next({errors:x?n.errors:{}})},ot=(x,T,_)=>{const L=(z(r,x,{_f:{}})._f||{}).ref,V=z(n.errors,x)||{},{ref:I,message:j,type:te,...ce}=V;de(n.errors,x,{...ce,...T,ref:L}),g.state.next({name:x,errors:n.errors,isValid:!1}),_&&_.shouldFocus&&L&&L.focus&&L.focus()},dn=(x,T)=>rt(x)?g.values.subscribe({next:_=>x(k(void 0,T),_)}):k(x,T,!0),ht=(x,T={})=>{for(const _ of x?Wr(x):a.mount)a.mount.delete(_),a.array.delete(_),T.keepValue||(we(r,_),we(s,_)),!T.keepError&&we(n.errors,_),!T.keepDirty&&we(n.dirtyFields,_),!T.keepTouched&&we(n.touchedFields,_),!T.keepIsValidating&&we(n.validatingFields,_),!t.shouldUnregister&&!T.keepDefaultValue&&we(o,_);g.values.next({values:{...s}}),g.state.next({...n,...T.keepDirty?{isDirty:D()}:{}}),!T.keepIsValid&&y()},kt=({disabled:x,name:T,field:_,fields:L,value:V})=>{if(tt(x)&&i.mount||x){const I=x?void 0:he(V)?ai(_?_._f:z(L,T)._f):V;(x||!x&&!he(I))&&de(s,T,I),S(T,I,!1,!1,!0)}},mt=(x,T={})=>{let _=z(r,x);const L=tt(T.disabled)||tt(t.disabled);return de(r,x,{..._||{},_f:{..._&&_._f?_._f:{ref:{name:x}},name:x,mount:!0,...T}}),a.mount.add(x),_?kt({field:_,disabled:tt(T.disabled)?T.disabled:t.disabled,name:x,value:T.value}):b(x,!0,T.value),{...L?{disabled:T.disabled||t.disabled}:{},...t.progressive?{required:!!T.required,min:Ln(T.min),max:Ln(T.max),minLength:Ln(T.minLength),maxLength:Ln(T.maxLength),pattern:Ln(T.pattern)}:{},name:x,onChange:q,onBlur:q,ref:V=>{if(V){mt(x,T),_=z(r,x);const I=he(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,j=_x(I),te=_._f.refs||[];if(j?te.find(ce=>ce===I):I===_._f.ref)return;de(r,x,{_f:{..._._f,...j?{refs:[...te.filter(ii),I,...Array.isArray(z(o,x))?[{}]:[]],ref:{type:I.type,name:x}}:{ref:I}}}),b(x,!1,void 0,I)}else _=z(r,x,{}),_._f&&(_._f.mount=!1),(t.shouldUnregister||T.shouldUnregister)&&!(wx(a.array,x)&&i.action)&&a.unMount.add(x)}}},st=()=>t.shouldFocusError&&Rn(r,ne,a.mount),fn=x=>{tt(x)&&(g.state.next({disabled:x}),Rn(r,(T,_)=>{const L=z(r,_);L&&(T.disabled=L._f.disabled||x,Array.isArray(L._f.refs)&&L._f.refs.forEach(V=>{V.disabled=L._f.disabled||x}))},0,!1))},vt=(x,T)=>async _=>{let L;if(_&&(_.preventDefault&&_.preventDefault(),_.persist&&_.persist()),t.disabled){T&&await T({...n.errors},_);return}let V=Re(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:I,values:j}=await $();n.errors=I,V=j}else await H(r);if(we(n.errors,"root"),Ae(n.errors)){g.state.next({errors:{}});try{await x(V,_)}catch(I){L=I}}else T&&await T({...n.errors},_),st(),setTimeout(st);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ae(n.errors)&&!L,submitCount:n.submitCount+1,errors:n.errors}),L)throw L},yt=(x,T={})=>{z(r,x)&&(he(T.defaultValue)?K(x,Re(z(o,x))):(K(x,T.defaultValue),de(o,x,Re(T.defaultValue))),T.keepTouched||we(n.touchedFields,x),T.keepDirty||(we(n.dirtyFields,x),n.isDirty=T.defaultValue?D(x,Re(z(o,x))):D()),T.keepError||(we(n.errors,x),f.isValid&&y()),g.state.next({...n}))},$e=(x,T={})=>{const _=x?Re(x):o,L=Re(_),V=Ae(x),I=V?o:L;if(T.keepDefaultValues||(o=_),!T.keepValues){if(T.keepDirtyValues){const j=new Set([...a.mount,...Object.keys($n(o,s))]);for(const te of Array.from(j))z(n.dirtyFields,te)?de(I,te,z(s,te)):K(te,z(I,te))}else{if(ei&&he(x))for(const j of a.mount){const te=z(r,j);if(te&&te._f){const ce=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(qr(ce)){const pe=ce.closest("form");if(pe){pe.reset();break}}}}r={}}s=t.shouldUnregister?T.keepDefaultValues?Re(o):{}:Re(I),g.array.next({values:{...I}}),g.values.next({values:{...I}})}a={mount:T.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!T.keepIsValid||!!T.keepDirtyValues,i.watch=!!t.shouldUnregister,g.state.next({submitCount:T.keepSubmitCount?n.submitCount:0,isDirty:V?!1:T.keepDirty?n.isDirty:!!(T.keepDefaultValues&&!Mt(x,o)),isSubmitted:T.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V?{}:T.keepDirtyValues?T.keepDefaultValues&&s?$n(o,s):n.dirtyFields:T.keepDefaultValues&&x?$n(o,x):T.keepDirty?n.dirtyFields:{},touchedFields:T.keepTouched?n.touchedFields:{},errors:T.keepErrors?n.errors:{},isSubmitSuccessful:T.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},It=(x,T)=>$e(rt(x)?x(s):x,T);return{control:{register:mt,unregister:ht,getFieldState:ke,handleSubmit:vt,setError:ot,_executeSchema:$,_getWatch:k,_getDirty:D,_updateValid:y,_removeUnmounted:Z,_updateFieldArray:C,_updateDisabledField:kt,_getFieldArray:O,_reset:$e,_resetDefaultValues:()=>rt(t.defaultValues)&&t.defaultValues().then(x=>{It(x,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:x=>{n={...n,...x}},_disableForm:fn,_subjects:g,_proxyFormState:f,_setErrors:P,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(x){i=x},get _defaultValues(){return o},get _names(){return a},set _names(x){a=x},get _formState(){return n},set _formState(x){n=x},get _options(){return t},set _options(x){t={...t,...x}}},trigger:ie,register:mt,handleSubmit:vt,watch:dn,setValue:K,getValues:fe,reset:It,resetField:yt,clearErrors:ae,unregister:ht,setError:ot,setFocus:(x,T={})=>{const _=z(r,x),L=_&&_._f;if(L){const V=L.refs?L.refs[0]:L.ref;V.focus&&(V.focus(),T.shouldSelect&&rt(V.select)&&V.select())}},getFieldState:ke}}function $x(e={}){const t=F.useRef(),n=F.useRef(),[r,o]=F.useState({isDirty:!1,isValidating:!1,isLoading:rt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:rt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Rx(e),formState:r});const s=t.current.control;return s._options=e,Sx({subject:s._subjects.state,next:i=>{Cx(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),F.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),F.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),F.useEffect(()=>{e.values&&!Mt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),F.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),F.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),F.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),F.useMemo(()=>({...t.current,formState:xx(r,s)}),[r,s])}const Pd=({className:e,children:t,content:n,side:r})=>{const[o,s]=F.useState(!1);return l.jsx(ju,{delayDuration:0,children:l.jsxs(Wu,{open:o,children:[l.jsx(qu,{asChild:!0,children:l.jsx("button",{type:"button",className:Y("cursor-pointer",e),onClick:()=>s(!o),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onTouchStart:()=>s(!o),onKeyDown:i=>{i.preventDefault(),i.key==="Enter"&&s(!o)},children:t})}),l.jsx(Zs,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},li=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:Y("mx-auto flex w-full justify-center",e),...t});li.displayName="Pagination";const ci=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:Y("flex flex-row items-center gap-1",e),...t}));ci.displayName="PaginationContent";const gt=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Y("",e),...t}));gt.displayName="PaginationItem";const Vn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:Y(Ha({variant:t?"outline":"ghost",size:n}),e),...r});Vn.displayName="PaginationLink";const ui=({className:e,...t})=>l.jsxs(Vn,{"aria-label":"Go to previous page",size:"default",className:Y("gap-1 pl-2.5",e),...t,children:[l.jsx(vg,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});ui.displayName="PaginationPrevious";const di=({className:e,...t})=>l.jsxs(Vn,{"aria-label":"Go to next page",size:"default",className:Y("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(Ea,{className:"h-4 w-4"})]});di.displayName="PaginationNext";const fi=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:Y("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(wg,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});fi.displayName="PaginationEllipsis";function pi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Td(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lx(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Td(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Td(e[o],null)}}}}function gi(...e){return d.useCallback(Lx(...e),e)}var Vx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],hi=Vx.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Bt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Bx(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Ad=e=>{const{present:t,children:n}=e,r=zx(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=gi(r.ref,Hx(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Ad.displayName="Presence";function zx(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Bx(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Yr(r.current);s.current=a==="mounted"?c:"none"},[a]),Ee(()=>{const c=r.current,f=o.current;if(f!==e){const h=s.current,p=Yr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Ee(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const m=Yr(r.current).includes(p.animationName);if(p.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(s.current=Yr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Yr(e){return(e==null?void 0:e.animationName)||"none"}function Hx(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mi="Radio",[Ux,_d]=Ke(mi),[Gx,jx]=Ux(mi),Fd=d.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:i,value:a="on",onCheck:u,form:c,...f}=e,[g,h]=d.useState(null),p=gi(t,y=>h(y)),v=d.useRef(!1),m=g?c||!!g.closest("form"):!0;return l.jsxs(Gx,{scope:n,checked:o,disabled:i,children:[l.jsx(hi.button,{type:"button",role:"radio","aria-checked":o,"data-state":Md(o),"data-disabled":i?"":void 0,disabled:i,value:a,...f,ref:p,onClick:pi(e.onClick,y=>{o||u==null||u(),m&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),m&&l.jsx(Wx,{control:g,bubbles:!v.current,name:r,value:a,checked:o,required:s,disabled:i,form:c,style:{transform:"translateX(-100%)"}})]})});Fd.displayName=mi;var Od="RadioIndicator",Dd=d.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=jx(Od,n);return l.jsx(Ad,{present:r||s.checked,children:l.jsx(hi.span,{"data-state":Md(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Dd.displayName=Od;var Wx=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,s=d.useRef(null),i=Ua(n),a=Vo(t);return d.useEffect(()=>{const u=s.current,c=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==n&&g){const h=new Event("click",{bubbles:r});g.call(u,n),u.dispatchEvent(h)}},[i,n,r]),l.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Md(e){return e?"checked":"unchecked"}var qx=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vi="RadioGroup",[Kx,AC]=Ke(vi,[br,_d]),kd=br(),Id=_d(),[Xx,Jx]=Kx(vi),Rd=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:i=!1,disabled:a=!1,orientation:u,dir:c,loop:f=!0,onValueChange:g,...h}=e,p=kd(n),v=ds(c),[m,y]=zt({prop:s,defaultProp:o,onChange:g});return l.jsx(Xx,{scope:n,name:r,required:i,disabled:a,value:m,onValueChange:y,children:l.jsx(oc,{asChild:!0,...p,orientation:u,dir:v,loop:f,children:l.jsx(hi.div,{role:"radiogroup","aria-required":i,"aria-orientation":u,"data-disabled":a?"":void 0,dir:v,...h,ref:t})})})});Rd.displayName=vi;var $d="RadioGroupItem",Ld=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=Jx($d,n),i=s.disabled||r,a=kd(n),u=Id(n),c=d.useRef(null),f=gi(t,c),g=s.value===o.value,h=d.useRef(!1);return d.useEffect(()=>{const p=m=>{qx.includes(m.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),l.jsx(sc,{asChild:!0,...a,focusable:!i,active:g,children:l.jsx(Fd,{disabled:i,required:s.required,checked:g,...u,...o,name:s.name,ref:f,onCheck:()=>s.onValueChange(o.value),onKeyDown:pi(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:pi(o.onFocus,()=>{var p;h.current&&((p=c.current)==null||p.click())})})})});Ld.displayName=$d;var Yx="RadioGroupIndicator",Vd=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Id(n);return l.jsx(Dd,{...o,...r,ref:t})});Vd.displayName=Yx;var Bd=Rd,zd=Ld,Zx=Vd;const Hd=d.forwardRef(({className:e,...t},n)=>l.jsx(Bd,{className:Y("grid gap-2",e),...t,ref:n}));Hd.displayName=Bd.displayName;const yi=d.forwardRef(({className:e,...t},n)=>l.jsx(zd,{ref:n,className:Y("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(Zx,{className:"flex items-center justify-center",children:l.jsx(yg,{className:"h-3.5 w-3.5 fill-primary"})})}));yi.displayName=zd.displayName;const Qx=({apiBaseUrl:e="http://localhost:3000"})=>{var C,N,P;const[t,n]=F.useState([]),[r,o]=F.useState(!1),[s,i]=F.useState([]),[a,u]=F.useState(1),[c,f]=F.useState(1),[g,h]=F.useState(null),p=b=>b.map(E=>({id:E==null?void 0:E.id,prefix:(E==null?void 0:E.prefix)||"",model:(E==null?void 0:E.model)||"",fileName:(E==null?void 0:E.file_name)||"",code:(E==null?void 0:E.stock_id)||"",content:(E==null?void 0:E.text_summary)||"",status:(E==null?void 0:E.status)||"",note:(E==null?void 0:E.note)||"",lastUpdate:E==null?void 0:E.updated_at,stock_id:E==null?void 0:E.stock_id})),v=b=>{if(!(b!=null&&b.data))return[];const S=p(b==null?void 0:b.data);n(S),f(b.pagination.totalPages)},m=async(b=1,S=15)=>{console.log("🚀 ~ fetchData ~ page:",b),h(b);try{const E=await oe.get(`${e}/api/latest-summaries`,{params:{page:b,limit:S}});console.log("🚀 ~ fetchData ~ result.data:",E.data),(E==null?void 0:E.status)===200?v(E.data):console.error(E)}catch(E){console.error("Error fetching data:",E)}finally{h(null),o(!1)}};F.useEffect(()=>{m(a)},[a]);const y=F.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:S})=>l.jsx("span",{className:"flex flex-col",children:S.original.code})},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:S})=>{const E=S.getValue("content");return l.jsx(Pd,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:E}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:E})})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:S})=>l.jsx("span",{className:"flex flex-col",children:S.original.status})},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:S})=>l.jsx(Pd,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:S.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:S.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:S})=>{const E=new Date(S.original.lastUpdate),$=E.getDate(),G=E.getMonth()+1,H=`ngày ${$} tháng ${G}`;return l.jsx("span",{className:"flex flex-col",children:H})}},{accessorKey:"edit",header:()=>l.jsx("div",{className:"font-medium text-center",children:"Sửa"}),cell:({row:S})=>{const[E,$]=F.useState(!1),[G,H]=F.useState(!1),{handleSubmit:Z,register:D,reset:k}=$x(),O=S.original.id,W=async B=>{$(!0);try{const K=await oe.patch(`${e}/api/update-summary`,{note:B.note,text_summary:B.content,id:O});K.status===200?(await m(a),H(!1)):console.error("Failed to update summary:",K)}catch(K){console.error("Error updating summary:",K)}return $(!1)};return l.jsxs(Ut,{open:G,onOpenChange:B=>{H(B),B?k({content:S.original.content,note:S.original.note}):k()},children:[l.jsx(En,{className:"w-full",children:l.jsx("div",{onClick:()=>H(B=>!B),className:"font-medium text-center text-orange-500 cursor-pointer",children:"sửa"})}),l.jsx(Tt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(At,{className:"flex flex-col gap-3",children:[l.jsx(_t,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:Z(W),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Nội dung:"}),l.jsx(Sr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:S.original.answer||"",rows:10,...D("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Lưu ý:"}),l.jsx(Sr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:S.original.note||"",rows:1,...D("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(le,{disabled:E,type:"submit",variant:"default",children:"Ok"})})]})]})})]})}},{id:"publish",header:"",accessorKey:"publish",cell:({row:S})=>{const[E,$]=F.useState(!1),[G,H]=F.useState("create"),[Z,D]=F.useState(!1),k=S.original.id,O=S.getValue("status"),W=S.getValue("code"),K=new Date(S.original.lastUpdate).getMonth()+1,[q,ne]=F.useState(""),[ie,fe]=F.useState(k),ke=async()=>{try{$(!0);try{const ae=await oe.patch(`${e}/api/toggle-publish/${k}`,{id:k,typeAction:G,status:O,idInput:ie,stock_id:S.original.stock_id,bucket:q,prefix:S.original.prefix,model:S.original.model,summary_result:S.original.content,note:S.original.note});ae.status===200?(m(a),D(!1)):console.error("Failed to toggle publish status:",ae)}catch(ae){console.error("Error toggling publish status:",ae)}finally{ne(""),$(!1)}}catch{}};return l.jsxs(Ut,{open:Z,onOpenChange:ae=>{D(ae)},children:[l.jsx(En,{className:"w-full",children:l.jsx("div",{onClick:()=>D(ae=>!ae),className:"font-medium text-start text-green-400 cursor-pointer",children:O==="unpublish"?"Publish":"Unpublish"})}),l.jsx(Tt,{className:"rounded-lg sm:px-3 sm:w-[calc(100%-30px)]",children:l.jsxs(At,{className:"flex flex-col gap-3",children:[l.jsxs(_t,{className:"text-center",children:[O==="unpublish"?"Publish":"Unpublish"," Summary?"]}),l.jsxs("span",{className:"text-start",children:["Bạn có muốn ",O==="unpublish"?"publish":"unpublish"," summary mã ",W," ","tháng ",K," không?"]}),l.jsxs(Hd,{onValueChange:ae=>H(ae),defaultValue:"create",className:"flex items-center",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(yi,{value:"create",id:"r1"}),l.jsx(ct,{htmlFor:"r1",children:"Create"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(yi,{value:"update",id:"r2"}),l.jsx(ct,{htmlFor:"r2",children:"Update"})]})]}),l.jsxs("div",{className:"text-start",children:[l.jsx("span",{className:"text-start",children:"id:"}),l.jsx(Je,{type:"number",value:ie,onChange:ae=>fe(ae.target.value)})]}),l.jsxs("div",{className:"text-start",children:[l.jsx("span",{className:"text-start",children:"bucket:"}),l.jsx(Je,{value:q,onChange:ae=>ne(ae.target.value)})]}),l.jsx("div",{className:"flex items-center justify-end",children:l.jsx(le,{onClick:ke,disabled:E,children:"ok"})})]})})]})}}],[]),w=Li({data:t,columns:y,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:Vf(),getCoreRowModel:$i()});return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:l.jsx(Je,{placeholder:"Tìm kiếm theo mã...",value:((C=w.getColumn("code"))==null?void 0:C.getFilterValue())??"",onChange:b=>{var S;return(S=w.getColumn("code"))==null?void 0:S.setFilterValue(b.target.value)},className:"max-w-sm"})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:w.getHeaderGroups().map(b=>l.jsx(He,{className:"hover:bg-transparent s3-explr-header-row",children:b.headers.map(S=>l.jsx(Ye,{className:"s3-explr-header-cell",children:S.isPlaceholder?null:qn(S.column.columnDef.header,S.getContext())},S.id))},b.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:(N=w.getRowModel().rows)!=null&&N.length?(P=w.getRowModel().rows)==null?void 0:P.map(b=>l.jsx(He,{className:"h-12 s3-explr-row",children:b.getVisibleCells().map(S=>l.jsx(Te,{className:"align-middle s3-explr-cell",children:qn(S.column.columnDef.cell,S.getContext())},S.id))},b.id)):r?l.jsx(He,{children:l.jsx(Te,{colSpan:y.length,className:"h-24 text-center",children:"loading..."})}):l.jsx(He,{children:l.jsx(Te,{colSpan:y.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(li,{children:l.jsxs(ci,{children:[l.jsx(gt,{children:l.jsx(ui,{onClick:()=>u(b=>Math.max(1,b-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(b,S)=>S+1).filter(b=>b===1||b===c||Math.abs(b-a)<=1).map((b,S,E)=>l.jsxs(l.Fragment,{children:[S>0&&E[S-1]!==b-1&&l.jsx(gt,{children:l.jsx(fi,{})},b+"..."),l.jsx(gt,{children:l.jsx(Vn,{onClick:()=>u(b),isActive:a===b,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===b?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):b})},b)]})),l.jsx(gt,{children:l.jsx(di,{onClick:()=>u(b=>Math.min(c,b+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},Ud=10,eC=F.memo(({apiBaseUrl:e="http://localhost:3000"})=>{const[t,n]=F.useState(1),[r,o]=F.useState([]),[s,i]=F.useState({total:0,page:1,limit:Ud,totalPages:1}),[a,u]=F.useState(!0),[c,f]=F.useState(null),[g,h]=F.useState(new Set),{toast:p}=Os(),[v,m]=F.useState(!1),y=async b=>{try{f(b);const S=await oe.get(`${e}/api/jobs`,{params:{page:b.toString(),limit:Ud.toString()}});o(S.data.data),i(S.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};F.useEffect(()=>{y(t)},[t,e]);const w=async b=>{h(S=>new Set(S).add(b.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:b}),p({title:"Job Restarted",description:`Job ${b} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${b}. Please try again.`})}finally{h(S=>{const E=new Set(S);return E.delete(b.toString()),E})}},C=async()=>{m(!0),n(1),await y(1),m(!1)},N=b=>new Date(b).toLocaleString(),P=b=>{if(b=parseFloat(b),b<60)return`${b.toFixed(2)}s`;const S=Math.floor(b/60),E=(b%60).toFixed(0);return`${S}m ${E}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(hg,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(le,{variant:"outline",size:"icon",onClick:C,disabled:v||a,className:"ml-2",children:l.jsx(bg,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(mr,{children:[l.jsx(vr,{children:l.jsxs(He,{children:[l.jsx(Ye,{children:"ID"}),l.jsx(Ye,{children:"Tên Công Việc"}),l.jsx(Ye,{children:"Thời Gian Bắt Đầu"}),l.jsx(Ye,{children:"Thời Gian Cập Nhật"}),l.jsx(Ye,{children:"Thời Gian Thực Thi"}),l.jsx(Ye,{children:"Trạng Thái"}),l.jsx(Ye,{children:"Thao Tác"})]})}),l.jsx(yr,{children:a&&r.length===0?l.jsx(He,{children:l.jsx(Te,{colSpan:7,className:"text-center py-4",children:l.jsx(Ce,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(b=>{var S,E;return l.jsxs(He,{children:[l.jsx(Te,{className:"!w-[100px]",children:b.id}),l.jsx(Te,{className:"font-medium",children:(S=b.job_name)==null?void 0:S.replace("Upload file","Summary")}),l.jsx(Te,{className:"!w-[200px]",children:N(b.created_at)}),l.jsx(Te,{className:"!w-[200px]",children:N(b.updated_at)}),l.jsx(Te,{className:"!w-[150px]",children:P(b.execution_time_seconds)}),l.jsx(Te,{className:"!w-[200px]",children:l.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium
|
|
137
|
-
|
|
131
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},cm="DialogDescriptionWarning",um=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ml(cm).contentName}}.`;return d.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},dm=wl,fm=xl,pm=Sl,$l=El,kl=Nl,Il=Pl,Rl=_l,gm=Ol;const nn=dm,gr=fm,hm=pm,Ll=d.forwardRef(({className:e,...t},n)=>l.jsx($l,{ref:n,className:Z("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ll.displayName=$l.displayName;const Rt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(hm,{children:[l.jsx(Ll,{}),l.jsxs(kl,{ref:r,className:Z("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(gm,{className:Z("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[l.jsx(ma,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),l.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Rt.displayName=kl.displayName;const Lt=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Lt.displayName="DialogHeader";const En=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});En.displayName="DialogFooter";const Vt=d.forwardRef(({className:e,...t},n)=>l.jsx(Il,{ref:n,className:Z("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));Vt.displayName=Il.displayName;const hr=d.forwardRef(({className:e,...t},n)=>l.jsx(Rl,{ref:n,className:Z("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));hr.displayName=Rl.displayName;const Nt=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Z("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Nt.displayName="Input";var mm="Label",Vl=d.forwardRef((e,t)=>l.jsx(ve.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Vl.displayName=mm;var Bl=Vl;const vm=Io("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),Bt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Bl,{ref:o,className:Z(vm({variant:t,size:n}),e),...r}));Bt.displayName=Bl.displayName;const mr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:Z("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:Z("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));mr.displayName="Table";const vr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:Z("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));vr.displayName="TableHeader";const yr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:Z("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));yr.displayName="TableBody";const ym=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:Z("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));ym.displayName="TableFooter";const ze=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:Z("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));ze.displayName="TableRow";const Xe=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:Z("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",e),...t}));Xe.displayName="TableHead";const Te=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:Z("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Te.displayName="TableCell";const wm=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:Z("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));wm.displayName="TableCaption";function ns(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function rn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Hl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rs(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Hl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Hl(e[o],null)}}}}function os(...e){return d.useCallback(rs(...e),e)}var ss=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(xm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(is,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(is,{...r,ref:t,children:n})});ss.displayName="Slot";var is=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Sm(n);return d.cloneElement(n,{...Cm(r,n.props),ref:t?rs(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});is.displayName="SlotClone";var bm=({children:e})=>l.jsx(l.Fragment,{children:e});function xm(e){return d.isValidElement(e)&&e.type===bm}function Cm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Sm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Em(e){const t=e+"CollectionProvider",[n,r]=Ct(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=O.useRef(null),w=O.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=O.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),x=os(v,w.collectionRef);return l.jsx(ss,{ref:x,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=O.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,x=O.useRef(null),E=os(v,x),T=s(c,h);return O.useEffect(()=>(T.itemMap.set(x,{ref:x,...w}),()=>void T.itemMap.delete(x))),l.jsx(ss,{[f]:"",ref:E,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return O.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((T,C)=>w.indexOf(T.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var zl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Tm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(as,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(as,{...r,ref:t,children:n})});zl.displayName="Slot";var as=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Am(n);return d.cloneElement(n,{...Pm(r,n.props),ref:t?rs(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});as.displayName="SlotClone";var Nm=({children:e})=>l.jsx(l.Fragment,{children:e});function Tm(e){return d.isValidElement(e)&&e.type===Nm}function Pm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Am(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _m=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ul=_m.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?zl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Fm=d.createContext(void 0);function jl(e){const t=d.useContext(Fm);return e||t||"ltr"}var ls="rovingFocusGroup.onEntryFocus",Om={bubbles:!1,cancelable:!0},wr="RovingFocusGroup",[cs,Wl,Dm]=Em(wr),[Mm,Gl]=Ct(wr,[Dm]),[$m,km]=Mm(wr),ql=d.forwardRef((e,t)=>l.jsx(cs.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(cs.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Im,{...e,ref:t})})}));ql.displayName=wr;var Im=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...g}=e,m=d.useRef(null),p=os(t,m),v=jl(s),[h=null,y]=Xt({prop:i,defaultProp:a,onChange:u}),[w,x]=d.useState(!1),E=Se(c),T=Wl(n),C=d.useRef(!1),[N,S]=d.useState(0);return d.useEffect(()=>{const A=m.current;if(A)return A.addEventListener(ls,E),()=>A.removeEventListener(ls,E)},[E]),l.jsx($m,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,onItemFocus:d.useCallback(A=>y(A),[y]),onItemShiftTab:d.useCallback(()=>x(!0),[]),onFocusableItemAdd:d.useCallback(()=>S(A=>A+1),[]),onFocusableItemRemove:d.useCallback(()=>S(A=>A-1),[]),children:l.jsx(Ul.div,{tabIndex:w||N===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:rn(e.onMouseDown,()=>{C.current=!0}),onFocus:rn(e.onFocus,A=>{const B=!C.current;if(A.target===A.currentTarget&&B&&!w){const H=new CustomEvent(ls,Om);if(A.currentTarget.dispatchEvent(H),!H.defaultPrevented){const K=T().filter(j=>j.focusable),$=K.find(j=>j.active),R=K.find(j=>j.id===h),G=[$,R,...K].filter(Boolean).map(j=>j.ref.current);Jl(G,f)}}C.current=!1}),onBlur:rn(e.onBlur,()=>x(!1))})})}),Kl="RovingFocusGroupItem",Xl=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Yt(),u=s||a,c=km(Kl,n),f=c.currentTabStopId===u,g=Wl(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(cs.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Ul.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:rn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:rn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:rn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=Vm(v,c.orientation,c.dir);if(h!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(x=>x.focusable).map(x=>x.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const x=w.indexOf(v.currentTarget);w=c.loop?Bm(w,x+1):w.slice(x+1)}setTimeout(()=>Jl(w))}})})})});Xl.displayName=Kl;var Rm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Lm(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vm(e,t,n){const r=Lm(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Rm[r]}function Jl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Bm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Hm=ql,zm=Xl;function Yl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Um(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Yl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Yl(e[o],null)}}}}function jm(...e){return d.useCallback(Um(...e),e)}function Wm(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Zl=e=>{const{present:t,children:n}=e,r=Gm(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=jm(r.ref,qm(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Zl.displayName="Presence";function Gm(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Wm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=br(r.current);s.current=a==="mounted"?c:"none"},[a]),De(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=br(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),De(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=br(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=br(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function br(e){return(e==null?void 0:e.animationName)||"none"}function qm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ql(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Km(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ql(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ql(e[o],null)}}}}var ec=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Jm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(us,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(us,{...r,ref:t,children:n})});ec.displayName="Slot";var us=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Zm(n);return d.cloneElement(n,{...Ym(r,n.props),ref:t?Km(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});us.displayName="SlotClone";var Xm=({children:e})=>l.jsx(l.Fragment,{children:e});function Jm(e){return d.isValidElement(e)&&e.type===Xm}function Ym(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Zm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xr=Qm.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?ec:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),ds="Tabs",[ev,Bx]=Ct(ds,[Gl]),tc=Gl(),[tv,fs]=ev(ds),nc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=jl(a),[g,m]=Xt({prop:r,onChange:o,defaultProp:s});return l.jsx(tv,{scope:n,baseId:Yt(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(xr.div,{dir:f,"data-orientation":i,...c,ref:t})})});nc.displayName=ds;var rc="TabsList",oc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=fs(rc,n),i=tc(n);return l.jsx(Hm,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(xr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});oc.displayName=rc;var sc="TabsTrigger",ic=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=fs(sc,n),a=tc(n),u=cc(i.baseId,r),c=uc(i.baseId,r),f=r===i.value;return l.jsx(zm,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(xr.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:ns(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:ns(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:ns(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});ic.displayName=sc;var ac="TabsContent",lc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=fs(ac,n),u=cc(a.baseId,r),c=uc(a.baseId,r),f=r===a.value,g=d.useRef(f);return d.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Zl,{present:o||f,children:({present:m})=>l.jsx(xr.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&s})})});lc.displayName=ac;function cc(e,t){return`${e}-trigger-${t}`}function uc(e,t){return`${e}-content-${t}`}var nv=nc,dc=oc,fc=ic,pc=lc;const rv=nv,gc=d.forwardRef(({className:e,...t},n)=>l.jsx(dc,{ref:n,className:Z("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));gc.displayName=dc.displayName;const ps=d.forwardRef(({className:e,...t},n)=>l.jsx(fc,{ref:n,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));ps.displayName=fc.displayName;const gs=d.forwardRef(({className:e,...t},n)=>l.jsx(pc,{ref:n,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));gs.displayName=pc.displayName;const Cr=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Z("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Cr.displayName="Textarea";function ov(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(g){const{scope:m,children:p,...v}=g,h=(m==null?void 0:m[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})}function f(g,m){const p=(m==null?void 0:m[e][u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,sv(o,...t)]}function sv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var hs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(av);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(ms,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ms,{...r,ref:t,children:n})});hs.displayName="Slot";var ms=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=cv(n);return d.cloneElement(n,{...lv(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ms.displayName="SlotClone";var iv=({children:e})=>l.jsx(l.Fragment,{children:e});function av(e){return d.isValidElement(e)&&e.type===iv}function lv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function cv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function uv(e){const t=e+"CollectionProvider",[n,r]=ov(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=O.useRef(null),w=O.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=O.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),x=ke(v,w.collectionRef);return l.jsx(hs,{ref:x,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=O.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,x=O.useRef(null),E=ke(v,x),T=s(c,h);return O.useEffect(()=>(T.itemMap.set(x,{ref:x,...w}),()=>void T.itemMap.delete(x))),l.jsx(hs,{[f]:"",ref:E,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return O.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((T,C)=>w.indexOf(T.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var dv="VisuallyHidden",vs=d.forwardRef((e,t)=>l.jsx(ve.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));vs.displayName=dv;var ys="ToastProvider",[ws,fv,pv]=uv("Toast"),[hc,Hx]=Ct("Toast",[pv]),[gv,Sr]=hc(ys),mc=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,u]=d.useState(null),[c,f]=d.useState(0),g=d.useRef(!1),m=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ys}\`. Expected non-empty \`string\`.`),l.jsx(ws.Provider,{scope:t,children:l.jsx(gv,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:u,onToastAdd:d.useCallback(()=>f(p=>p+1),[]),onToastRemove:d.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:m,children:i})})};mc.displayName=ys;var vc="ToastViewport",hv=["F8"],bs="toast.viewportPause",xs="toast.viewportResume",yc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=hv,label:o="Notifications ({hotkey})",...s}=e,i=Sr(vc,n),a=fv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=ke(t,g,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;d.useEffect(()=>{const y=w=>{var E;r.length!==0&&r.every(T=>w[T]||w.code===T)&&((E=g.current)==null||E.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),d.useEffect(()=>{const y=u.current,w=g.current;if(v&&y&&w){const x=()=>{if(!i.isClosePausedRef.current){const N=new CustomEvent(bs);w.dispatchEvent(N),i.isClosePausedRef.current=!0}},E=()=>{if(i.isClosePausedRef.current){const N=new CustomEvent(xs);w.dispatchEvent(N),i.isClosePausedRef.current=!1}},T=N=>{!y.contains(N.relatedTarget)&&E()},C=()=>{y.contains(document.activeElement)||E()};return y.addEventListener("focusin",x),y.addEventListener("focusout",T),y.addEventListener("pointermove",x),y.addEventListener("pointerleave",C),window.addEventListener("blur",x),window.addEventListener("focus",E),()=>{y.removeEventListener("focusin",x),y.removeEventListener("focusout",T),y.removeEventListener("pointermove",x),y.removeEventListener("pointerleave",C),window.removeEventListener("blur",x),window.removeEventListener("focus",E)}}},[v,i.isClosePausedRef]);const h=d.useCallback(({tabbingDirection:y})=>{const x=a().map(E=>{const T=E.ref.current,C=[T,...Av(T)];return y==="forwards"?C:C.reverse()});return(y==="forwards"?x.reverse():x).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=x=>{var C,N,S;const E=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!E){const A=document.activeElement,B=x.shiftKey;if(x.target===y&&B){(C=c.current)==null||C.focus();return}const $=h({tabbingDirection:B?"backwards":"forwards"}),R=$.findIndex(D=>D===A);Es($.slice(R+1))?x.preventDefault():B?(N=c.current)==null||N.focus():(S=f.current)==null||S.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(oh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Cs,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});Es(y)}}),l.jsx(ws.Slot,{scope:n,children:l.jsx(ve.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(Cs,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});Es(y)}})]})});yc.displayName=vc;var wc="ToastFocusProxy",Cs=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Sr(wc,n);return l.jsx(vs,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});Cs.displayName=wc;var Er="Toast",mv="toast.swipeStart",vv="toast.swipeMove",yv="toast.swipeCancel",wv="toast.swipeEnd",bc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=Xt({prop:r,defaultProp:o,onChange:s});return l.jsx(Jt,{present:n||a,children:l.jsx(Cv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Se(e.onPause),onResume:Se(e.onResume),onSwipeStart:me(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(e.onSwipeMove,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:me(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(e.onSwipeEnd,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});bc.displayName=Er;var[bv,xv]=hc(Er,{onClose(){}}),Cv=d.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:u,onResume:c,onSwipeStart:f,onSwipeMove:g,onSwipeCancel:m,onSwipeEnd:p,...v}=e,h=Sr(Er,n),[y,w]=d.useState(null),x=ke(t,D=>w(D)),E=d.useRef(null),T=d.useRef(null),C=o||h.duration,N=d.useRef(0),S=d.useRef(C),A=d.useRef(0),{onToastAdd:B,onToastRemove:H}=h,K=Se(()=>{var G;(y==null?void 0:y.contains(document.activeElement))&&((G=h.viewport)==null||G.focus()),i()}),$=d.useCallback(D=>{!D||D===1/0||(window.clearTimeout(A.current),N.current=new Date().getTime(),A.current=window.setTimeout(K,D))},[K]);d.useEffect(()=>{const D=h.viewport;if(D){const G=()=>{$(S.current),c==null||c()},j=()=>{const X=new Date().getTime()-N.current;S.current=S.current-X,window.clearTimeout(A.current),u==null||u()};return D.addEventListener(bs,j),D.addEventListener(xs,G),()=>{D.removeEventListener(bs,j),D.removeEventListener(xs,G)}}},[h.viewport,C,u,c,$]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&$(C)},[s,C,h.isClosePausedRef,$]),d.useEffect(()=>(B(),()=>H()),[B,H]);const R=d.useMemo(()=>y?Pc(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[R&&l.jsx(Sv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),l.jsx(bv,{scope:n,onClose:K,children:Hn.createPortal(l.jsx(ws.ItemSlot,{scope:n,children:l.jsx(rh,{asChild:!0,onEscapeKeyDown:me(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||K(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":h.swipeDirection,...v,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:me(e.onKeyDown,D=>{D.key==="Escape"&&(a==null||a(D.nativeEvent),D.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:me(e.onPointerDown,D=>{D.button===0&&(E.current={x:D.clientX,y:D.clientY})}),onPointerMove:me(e.onPointerMove,D=>{if(!E.current)return;const G=D.clientX-E.current.x,j=D.clientY-E.current.y,X=!!T.current,q=["left","right"].includes(h.swipeDirection),ne=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,ae=q?ne(0,G):0,se=q?0:ne(0,j),Ce=D.pointerType==="touch"?10:2,Ae={x:ae,y:se},nt={originalEvent:D,delta:Ae};X?(T.current=Ae,Nr(vv,g,nt,{discrete:!1})):Ac(Ae,h.swipeDirection,Ce)?(T.current=Ae,Nr(mv,f,nt,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(G)>Ce||Math.abs(j)>Ce)&&(E.current=null)}),onPointerUp:me(e.onPointerUp,D=>{const G=T.current,j=D.target;if(j.hasPointerCapture(D.pointerId)&&j.releasePointerCapture(D.pointerId),T.current=null,E.current=null,G){const X=D.currentTarget,q={originalEvent:D,delta:G};Ac(G,h.swipeDirection,h.swipeThreshold)?Nr(wv,p,q,{discrete:!0}):Nr(yv,m,q,{discrete:!0}),X.addEventListener("click",ne=>ne.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Sv=e=>{const{__scopeToast:t,children:n,...r}=e,o=Sr(Er,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Tv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(jo,{asChild:!0,children:l.jsx(vs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Ev="ToastTitle",xc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});xc.displayName=Ev;var Nv="ToastDescription",Cc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});Cc.displayName=Nv;var Sc="ToastAction",Ec=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Tc,{altText:n,asChild:!0,children:l.jsx(Ss,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Sc}\`. Expected non-empty \`string\`.`),null)});Ec.displayName=Sc;var Nc="ToastClose",Ss=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=xv(Nc,n);return l.jsx(Tc,{asChild:!0,children:l.jsx(ve.button,{type:"button",...r,ref:t,onClick:me(e.onClick,o.onClose)})})});Ss.displayName=Nc;var Tc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Pc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Pv(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Pc(r))}}),t}function Nr(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ia(o,s):o.dispatchEvent(s)}var Ac=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function Tv(e=()=>{}){const t=Se(e);De(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Pv(e){return e.nodeType===e.ELEMENT_NODE}function Av(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Es(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var _v=mc,_c=yc,Fc=bc,Oc=xc,Dc=Cc,Mc=Ec,$c=Ss;const Fv=_v,kc=d.forwardRef(({className:e,...t},n)=>l.jsx(_c,{ref:n,className:Z("s3-explr-ui-toast-viewport fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));kc.displayName=_c.displayName;const Ov=Io("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Ic=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Fc,{ref:r,className:Z(Ov({variant:t}),e),...n}));Ic.displayName=Fc.displayName;const Dv=d.forwardRef(({className:e,...t},n)=>l.jsx(Mc,{ref:n,className:Z("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Dv.displayName=Mc.displayName;const Rc=d.forwardRef(({className:e,...t},n)=>l.jsx($c,{ref:n,className:Z("s3-explr-ui-toast-close absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(ma,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Rc.displayName=$c.displayName;const Lc=d.forwardRef(({className:e,...t},n)=>l.jsx(Oc,{ref:n,className:Z("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Lc.displayName=Oc.displayName;const Vc=d.forwardRef(({className:e,...t},n)=>l.jsx(Dc,{ref:n,className:Z("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Vc.displayName=Dc.displayName;const Mv=1,$v=1e6;let Ns=0;function kv(){return Ns=(Ns+1)%Number.MAX_SAFE_INTEGER,Ns.toString()}const Ts=new Map,Bc=e=>{if(Ts.has(e))return;const t=setTimeout(()=>{Ts.delete(e),Nn({type:"REMOVE_TOAST",toastId:e})},$v);Ts.set(e,t)},Iv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Mv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Bc(n):e.toasts.forEach(r=>{Bc(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Tr=[];let Pr={toasts:[]};function Nn(e){Pr=Iv(Pr,e),Tr.forEach(t=>{t(Pr)})}function Rv({...e}){const t=kv(),n=o=>Nn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Nn({type:"DISMISS_TOAST",toastId:t});return Nn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Ps(){const[e,t]=d.useState(Pr);return d.useEffect(()=>(Tr.push(t),()=>{const n=Tr.indexOf(t);n>-1&&Tr.splice(n,1)}),[e]),{...e,toast:Rv,dismiss:n=>Nn({type:"DISMISS_TOAST",toastId:n})}}function Hc(){const{toasts:e}=Ps();return l.jsxs(Fv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(Ic,{...s,className:`s3-explr-ui-toast ${s.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(Lc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Vc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Rc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(kc,{className:"s3-explr-ui-toast-viewport"})]})}function it(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function zc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=zc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():zc(e[o],null)}}}}function Tn(...e){return d.useCallback(Lv(...e),e)}var Vv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Pn=Vv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Gt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Bv(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var Hv="DismissableLayer",As="dismissableLayer.update",zv="dismissableLayer.pointerDownOutside",Uv="dismissableLayer.focusOutside",Uc,jc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wc=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(jc),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Tn(t,S=>g(S)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),x=f?h.indexOf(f):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,T=x>=w,C=Gv(S=>{const A=S.target,B=[...c.branches].some(H=>H.contains(A));!T||B||(o==null||o(S),i==null||i(S),S.defaultPrevented||a==null||a())},m),N=qv(S=>{const A=S.target;[...c.branches].some(H=>H.contains(A))||(s==null||s(S),i==null||i(S),S.defaultPrevented||a==null||a())},m);return za(S=>{x===c.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Uc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Gc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Uc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Gc())},[f,c]),d.useEffect(()=>{const S=()=>p({});return document.addEventListener(As,S),()=>document.removeEventListener(As,S)},[]),l.jsx(Pn.div,{...u,ref:v,style:{pointerEvents:E?T?"auto":"none":void 0,...e.style},onFocusCapture:it(e.onFocusCapture,N.onFocusCapture),onBlurCapture:it(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:it(e.onPointerDownCapture,C.onPointerDownCapture)})});Wc.displayName=Hv;var jv="DismissableLayerBranch",Wv=d.forwardRef((e,t)=>{const n=d.useContext(jc),r=d.useRef(null),o=Tn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Pn.div,{...e,ref:o})});Wv.displayName=jv;function Gv(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){qc(zv,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qv(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&qc(Uv,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Gc(){const e=new CustomEvent(As);document.dispatchEvent(e)}function qc(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Bv(o,s):o.dispatchEvent(s)}const Kv=["top","right","bottom","left"],Tt=Math.min,Me=Math.max,Ar=Math.round,_r=Math.floor,Je=e=>({x:e,y:e}),Xv={left:"right",right:"left",bottom:"top",top:"bottom"},Jv={start:"end",end:"start"};function _s(e,t,n){return Me(e,Tt(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function lt(e){return e.split("-")[0]}function on(e){return e.split("-")[1]}function Fs(e){return e==="x"?"y":"x"}function Os(e){return e==="y"?"height":"width"}function Pt(e){return["top","bottom"].includes(lt(e))?"y":"x"}function Ds(e){return Fs(Pt(e))}function Yv(e,t,n){n===void 0&&(n=!1);const r=on(e),o=Ds(e),s=Os(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Fr(i)),[i,Fr(i)]}function Zv(e){const t=Fr(e);return[Ms(e),t,Ms(t)]}function Ms(e){return e.replace(/start|end/g,t=>Jv[t])}function Qv(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function ey(e,t,n,r){const o=on(e);let s=Qv(lt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ms)))),s}function Fr(e){return e.replace(/left|right|bottom|top/g,t=>Xv[t])}function ty(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kc(e){return typeof e!="number"?ty(e):{top:e,right:e,bottom:e,left:e}}function Or(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xc(e,t,n){let{reference:r,floating:o}=e;const s=Pt(t),i=Ds(t),a=Os(i),u=lt(t),c=s==="y",f=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(u){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(on(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const ny=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:g}=Xc(c,r,u),m=r,p={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:w}=a[h],{x,y:E,data:T,reset:C}=await w({x:f,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=x??f,g=E??g,p={...p,[y]:{...p[y],...T}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:g}=Xc(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function An(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:m=!1,padding:p=0}=at(t,e),v=Kc(p),y=a[m?g==="floating"?"reference":"floating":g],w=Or(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),x=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),T=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},C=Or(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:E,strategy:u}):x);return{top:(w.top-C.top+v.top)/T.y,bottom:(C.bottom-w.bottom+v.bottom)/T.y,left:(w.left-C.left+v.left)/T.x,right:(C.right-w.right+v.right)/T.x}}const ry=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=at(e,t)||{};if(c==null)return{};const g=Kc(f),m={x:n,y:r},p=Ds(o),v=Os(p),h=await i.getDimensions(c),y=p==="y",w=y?"top":"left",x=y?"bottom":"right",E=y?"clientHeight":"clientWidth",T=s.reference[v]+s.reference[p]-m[p]-s.floating[v],C=m[p]-s.reference[p],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let S=N?N[E]:0;(!S||!await(i.isElement==null?void 0:i.isElement(N)))&&(S=a.floating[E]||s.floating[v]);const A=T/2-C/2,B=S/2-h[v]/2-1,H=Tt(g[w],B),K=Tt(g[x],B),$=H,R=S-h[v]-K,D=S/2-h[v]/2+A,G=_s($,D,R),j=!u.arrow&&on(o)!=null&&D!==G&&s.reference[v]/2-(D<$?H:K)-h[v]/2<0,X=j?D<$?D-$:D-R:0;return{[p]:m[p]+X,data:{[p]:G,centerOffset:D-G-X,...j&&{alignmentOffset:X}},reset:j}}}),oy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...y}=at(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=lt(o),x=Pt(a),E=lt(a)===a,T=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=m||(E||!h?[Fr(a)]:Zv(a)),N=v!=="none";!m&&N&&C.push(...ey(a,h,v,T));const S=[a,...C],A=await An(t,y),B=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&B.push(A[w]),g){const D=Yv(o,i,T);B.push(A[D[0]],A[D[1]])}if(H=[...H,{placement:o,overflows:B}],!B.every(D=>D<=0)){var K,$;const D=(((K=s.flip)==null?void 0:K.index)||0)+1,G=S[D];if(G)return{data:{index:D,overflows:H},reset:{placement:G}};let j=($=H.filter(X=>X.overflows[0]<=0).sort((X,q)=>X.overflows[1]-q.overflows[1])[0])==null?void 0:$.placement;if(!j)switch(p){case"bestFit":{var R;const X=(R=H.filter(q=>{if(N){const ne=Pt(q.placement);return ne===x||ne==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ne=>ne>0).reduce((ne,ae)=>ne+ae,0)]).sort((q,ne)=>q[1]-ne[1])[0])==null?void 0:R[0];X&&(j=X);break}case"initialPlacement":j=a;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Jc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yc(e){return Kv.some(t=>e[t]>=0)}const sy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=at(e,t);switch(r){case"referenceHidden":{const s=await An(t,{...o,elementContext:"reference"}),i=Jc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Yc(i)}}}case"escaped":{const s=await An(t,{...o,altBoundary:!0}),i=Jc(s,n.floating);return{data:{escapedOffsets:i,escaped:Yc(i)}}}default:return{}}}}};async function iy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=lt(n),a=on(n),u=Pt(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=at(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),u?{x:p*f,y:m*c}:{x:m*c,y:p*f}}const ay=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await iy(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},ly=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...u}=at(e,t),c={x:n,y:r},f=await An(t,u),g=Pt(lt(o)),m=Fs(g);let p=c[m],v=c[g];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+f[y],E=p-f[w];p=_s(x,p,E)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",x=v+f[y],E=v-f[w];v=_s(x,v,E)}const h=a.fn({...t,[m]:p,[g]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[g]:i}}}}}},cy=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=at(e,t),f={x:n,y:r},g=Pt(o),m=Fs(g);let p=f[m],v=f[g];const h=at(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const E=m==="y"?"height":"width",T=s.reference[m]-s.floating[E]+y.mainAxis,C=s.reference[m]+s.reference[E]-y.mainAxis;p<T?p=T:p>C&&(p=C)}if(c){var w,x;const E=m==="y"?"width":"height",T=["top","left"].includes(lt(o)),C=s.reference[g]-s.floating[E]+(T&&((w=i.offset)==null?void 0:w[g])||0)+(T?0:y.crossAxis),N=s.reference[g]+s.reference[E]+(T?0:((x=i.offset)==null?void 0:x[g])||0)-(T?y.crossAxis:0);v<C?v=C:v>N&&(v=N)}return{[m]:p,[g]:v}}}},uy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=at(e,t),f=await An(t,c),g=lt(o),m=on(o),p=Pt(o)==="y",{width:v,height:h}=s.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=g,y=m==="end"?"top":"bottom");const x=h-f.top-f.bottom,E=v-f.left-f.right,T=Tt(h-f[y],x),C=Tt(v-f[w],E),N=!t.middlewareData.shift;let S=T,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=x),N&&!m){const H=Me(f.left,0),K=Me(f.right,0),$=Me(f.top,0),R=Me(f.bottom,0);p?A=v-2*(H!==0||K!==0?H+K:Me(f.left,f.right)):S=h-2*($!==0||R!==0?$+R:Me(f.top,f.bottom))}await u({...t,availableWidth:A,availableHeight:S});const B=await i.getDimensions(a.floating);return v!==B.width||h!==B.height?{reset:{rects:!0}}:{}}}};function Dr(){return typeof window<"u"}function sn(e){return Zc(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ye(e){var t;return(t=(Zc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zc(e){return Dr()?e instanceof Node||e instanceof $e(e).Node:!1}function Ue(e){return Dr()?e instanceof Element||e instanceof $e(e).Element:!1}function Ze(e){return Dr()?e instanceof HTMLElement||e instanceof $e(e).HTMLElement:!1}function Qc(e){return!Dr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}function _n(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function dy(e){return["table","td","th"].includes(sn(e))}function Mr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function $s(e){const t=ks(),n=Ue(e)?je(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function fy(e){let t=At(e);for(;Ze(t)&&!an(t);){if($s(t))return t;if(Mr(t))return null;t=At(t)}return null}function ks(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function an(e){return["html","body","#document"].includes(sn(e))}function je(e){return $e(e).getComputedStyle(e)}function $r(e){return Ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function At(e){if(sn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qc(e)&&e.host||Ye(e);return Qc(t)?t.host:t}function eu(e){const t=At(e);return an(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ze(t)&&_n(t)?t:eu(t)}function Fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=eu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=$e(o);if(s){const a=Is(i);return t.concat(i,i.visualViewport||[],_n(o)?o:[],a&&n?Fn(a):[])}return t.concat(o,Fn(o,[],n))}function Is(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tu(e){const t=je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ze(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ar(n)!==s||Ar(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Rs(e){return Ue(e)?e:e.contextElement}function ln(e){const t=Rs(e);if(!Ze(t))return Je(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=tu(t);let i=(s?Ar(n.width):n.width)/r,a=(s?Ar(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const py=Je(0);function nu(e){const t=$e(e);return!ks()||!t.visualViewport?py:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$e(e)?!1:t}function Ht(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Rs(e);let i=Je(1);t&&(r?Ue(r)&&(i=ln(r)):i=ln(e));const a=gy(s,n,r)?nu(s):Je(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,g=o.height/i.y;if(s){const m=$e(s),p=r&&Ue(r)?$e(r):r;let v=m,h=Is(v);for(;h&&r&&p!==v;){const y=ln(h),w=h.getBoundingClientRect(),x=je(h),E=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*y.x,T=w.top+(h.clientTop+parseFloat(x.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=E,c+=T,v=$e(h),h=Is(v)}}return Or({width:f,height:g,x:u,y:c})}function Ls(e,t){const n=$r(e).scrollLeft;return t?t.left+n:Ht(Ye(e)).left+n}function ru(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ls(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function hy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ye(r),a=t?Mr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=Je(1);const f=Je(0),g=Ze(r);if((g||!g&&!s)&&((sn(r)!=="body"||_n(i))&&(u=$r(r)),Ze(r))){const p=Ht(r);c=ln(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?ru(i,u,!0):Je(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-u.scrollTop*c.y+f.y+m.y}}function my(e){return Array.from(e.getClientRects())}function vy(e){const t=Ye(e),n=$r(e),r=e.ownerDocument.body,o=Me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ls(e);const a=-n.scrollTop;return je(r).direction==="rtl"&&(i+=Me(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function yy(e,t){const n=$e(e),r=Ye(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const c=ks();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function wy(e,t){const n=Ht(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ze(e)?ln(e):Je(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function ou(e,t,n){let r;if(t==="viewport")r=yy(e,n);else if(t==="document")r=vy(Ye(e));else if(Ue(t))r=wy(t,n);else{const o=nu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Or(r)}function su(e,t){const n=At(e);return n===t||!Ue(n)||an(n)?!1:je(n).position==="fixed"||su(n,t)}function by(e,t){const n=t.get(e);if(n)return n;let r=Fn(e,[],!1).filter(a=>Ue(a)&&sn(a)!=="body"),o=null;const s=je(e).position==="fixed";let i=s?At(e):e;for(;Ue(i)&&!an(i);){const a=je(i),u=$s(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||_n(i)&&!u&&su(e,i))?r=r.filter(f=>f!==i):o=a,i=At(i)}return t.set(e,r),r}function xy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Mr(t)?[]:by(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=ou(t,f,o);return c.top=Me(g.top,c.top),c.right=Tt(g.right,c.right),c.bottom=Tt(g.bottom,c.bottom),c.left=Me(g.left,c.left),c},ou(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Cy(e){const{width:t,height:n}=tu(e);return{width:t,height:n}}function Sy(e,t,n){const r=Ze(t),o=Ye(t),s=n==="fixed",i=Ht(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=Je(0);if(r||!r&&!s)if((sn(t)!=="body"||_n(o))&&(a=$r(t)),r){const m=Ht(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Ls(o));const c=o&&!r&&!s?ru(o,a):Je(0),f=i.left+a.scrollLeft-u.x-c.x,g=i.top+a.scrollTop-u.y-c.y;return{x:f,y:g,width:i.width,height:i.height}}function Vs(e){return je(e).position==="static"}function iu(e,t){if(!Ze(e)||je(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ye(e)===n&&(n=n.ownerDocument.body),n}function au(e,t){const n=$e(e);if(Mr(e))return n;if(!Ze(e)){let o=At(e);for(;o&&!an(o);){if(Ue(o)&&!Vs(o))return o;o=At(o)}return n}let r=iu(e,t);for(;r&&dy(r)&&Vs(r);)r=iu(r,t);return r&&an(r)&&Vs(r)&&!$s(r)?n:r||fy(e)||n}const Ey=async function(e){const t=this.getOffsetParent||au,n=this.getDimensions,r=await n(e.floating);return{reference:Sy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ny(e){return je(e).direction==="rtl"}const Ty={convertOffsetParentRelativeRectToViewportRelativeRect:hy,getDocumentElement:Ye,getClippingRect:xy,getOffsetParent:au,getElementRects:Ey,getClientRects:my,getDimensions:Cy,getScale:ln,isElement:Ue,isRTL:Ny};function Py(e,t){let n=null,r;const o=Ye(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const{left:c,top:f,width:g,height:m}=e.getBoundingClientRect();if(a||t(),!g||!m)return;const p=_r(f),v=_r(o.clientWidth-(c+g)),h=_r(o.clientHeight-(f+m)),y=_r(c),x={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Me(0,Tt(1,u))||1};let E=!0;function T(C){const N=C[0].intersectionRatio;if(N!==u){if(!E)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E=!1}try{n=new IntersectionObserver(T,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,x)}n.observe(e)}return i(!0),s}function Ay(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Rs(e),f=o||s?[...c?Fn(c):[],...Fn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?Py(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(w=>{let[x]=w;x&&x.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?Ht(e):null;u&&y();function y(){const w=Ht(e);h&&(w.x!==h.x||w.y!==h.y||w.width!==h.width||w.height!==h.height)&&n(),h=w,v=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const _y=ay,Fy=ly,Oy=oy,Dy=uy,My=sy,lu=ry,$y=cy,ky=(e,t,n)=>{const r=new Map,o={platform:Ty,...n},s={...o.platform,_c:r};return ny(e,t,{...o,platform:s})};var kr=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ir(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ir(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ir(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function cu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uu(e,t){const n=cu(e);return Math.round(t*n)/n}function Bs(e){const t=d.useRef(e);return kr(()=>{t.current=e}),t}function Iy(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,g]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=d.useState(r);Ir(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),x=d.useCallback(q=>{q!==N.current&&(N.current=q,h(q))},[]),E=d.useCallback(q=>{q!==S.current&&(S.current=q,w(q))},[]),T=s||v,C=i||y,N=d.useRef(null),S=d.useRef(null),A=d.useRef(f),B=u!=null,H=Bs(u),K=Bs(o),$=Bs(c),R=d.useCallback(()=>{if(!N.current||!S.current)return;const q={placement:t,strategy:n,middleware:m};K.current&&(q.platform=K.current),ky(N.current,S.current,q).then(ne=>{const ae={...ne,isPositioned:$.current!==!1};D.current&&!Ir(A.current,ae)&&(A.current=ae,Hn.flushSync(()=>{g(ae)}))})},[m,t,n,K,$]);kr(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,g(q=>({...q,isPositioned:!1})))},[c]);const D=d.useRef(!1);kr(()=>(D.current=!0,()=>{D.current=!1}),[]),kr(()=>{if(T&&(N.current=T),C&&(S.current=C),T&&C){if(H.current)return H.current(T,C,R);R()}},[T,C,R,H,B]);const G=d.useMemo(()=>({reference:N,floating:S,setReference:x,setFloating:E}),[x,E]),j=d.useMemo(()=>({reference:T,floating:C}),[T,C]),X=d.useMemo(()=>{const q={position:n,left:0,top:0};if(!j.floating)return q;const ne=uu(j.floating,f.x),ae=uu(j.floating,f.y);return a?{...q,transform:"translate("+ne+"px, "+ae+"px)",...cu(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:ae}},[n,a,j.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:R,refs:G,elements:j,floatingStyles:X}),[f,R,G,j,X])}const Ry=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?lu({element:r.current,padding:o}).fn(n):{}:r?lu({element:r,padding:o}).fn(n):{}}}},Ly=(e,t)=>({..._y(e),options:[e,t]}),Vy=(e,t)=>({...Fy(e),options:[e,t]}),By=(e,t)=>({...$y(e),options:[e,t]}),Hy=(e,t)=>({...Oy(e),options:[e,t]}),zy=(e,t)=>({...Dy(e),options:[e,t]}),Uy=(e,t)=>({...My(e),options:[e,t]}),jy=(e,t)=>({...Ry(e),options:[e,t]});var Wy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Gy=Wy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Gt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),qy="Arrow",du=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Gy.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});du.displayName=qy;var Ky=du;function fu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xy(...e){return t=>{let n=!1;const r=e.map(o=>{const s=fu(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():fu(e[o],null)}}}}function pu(...e){return d.useCallback(Xy(...e),e)}var Jy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],gu=Jy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Gt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Hs="Popper",[hu,mu]=Ct(Hs),[Yy,vu]=hu(Hs),yu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(Yy,{scope:t,anchor:r,onAnchorChange:o,children:n})};yu.displayName=Hs;var wu="PopperAnchor",bu=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=vu(wu,n),i=d.useRef(null),a=pu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(gu.div,{...o,ref:a})});bu.displayName=wu;var zs="PopperContent",[Zy,Qy]=hu(zs),xu=d.forwardRef((e,t)=>{var Ft,ft,rt,fn,pt,gt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:v,...h}=e,y=vu(zs,n),[w,x]=d.useState(null),E=pu(t,Re=>x(Re)),[T,C]=d.useState(null),N=$a(T),S=(N==null?void 0:N.width)??0,A=(N==null?void 0:N.height)??0,B=r+(s!=="center"?"-"+s:""),H=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(c)?c:[c],$=K.length>0,R={padding:H,boundary:K.filter(tw),altBoundary:$},{refs:D,floatingStyles:G,placement:j,isPositioned:X,middlewareData:q}=Iy({strategy:"fixed",placement:B,whileElementsMounted:(...Re)=>Ay(...Re,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[Ly({mainAxis:o+A,alignmentAxis:i}),u&&Vy({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?By():void 0,...R}),u&&Hy({...R}),zy({...R,apply:({elements:Re,rects:Ot,availableWidth:pn,availableHeight:Dt})=>{const{width:Vn,height:b}=Ot.reference,P=Re.floating.style;P.setProperty("--radix-popper-available-width",`${pn}px`),P.setProperty("--radix-popper-available-height",`${Dt}px`),P.setProperty("--radix-popper-anchor-width",`${Vn}px`),P.setProperty("--radix-popper-anchor-height",`${b}px`)}}),T&&jy({element:T,padding:a}),nw({arrowWidth:S,arrowHeight:A}),m&&Uy({strategy:"referenceHidden",...R})]}),[ne,ae]=Eu(j),se=Se(v);De(()=>{X&&(se==null||se())},[X,se]);const Ce=(Ft=q.arrow)==null?void 0:Ft.x,Ae=(ft=q.arrow)==null?void 0:ft.y,nt=((rt=q.arrow)==null?void 0:rt.centerOffset)!==0,[dn,dt]=d.useState();return De(()=>{w&&dt(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:X?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:dn,"--radix-popper-transform-origin":[(fn=q.transformOrigin)==null?void 0:fn.x,(pt=q.transformOrigin)==null?void 0:pt.y].join(" "),...((gt=q.hide)==null?void 0:gt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Zy,{scope:n,placedSide:ne,onArrowChange:C,arrowX:Ce,arrowY:Ae,shouldHideArrow:nt,children:l.jsx(gu.div,{"data-side":ne,"data-align":ae,...h,ref:E,style:{...h.style,animation:X?void 0:"none"}})})})});xu.displayName=zs;var Cu="PopperArrow",ew={top:"bottom",right:"left",bottom:"top",left:"right"},Su=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Qy(Cu,r),i=ew[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(Ky,{...o,ref:n,style:{...o.style,display:"block"}})})});Su.displayName=Cu;function tw(e){return e!==null}var nw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,x;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[c,f]=Eu(n),g={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+u/2;let v="",h="";return c==="bottom"?(v=i?g:`${m}px`,h=`${-u}px`):c==="top"?(v=i?g:`${m}px`,h=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,h=i?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,h=i?g:`${p}px`),{data:{x:v,y:h}}}});function Eu(e){const[t,n="center"]=e.split("-");return[t,n]}var rw=yu,ow=bu,sw=xu,iw=Su,aw="Portal",Nu=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);De(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Yr.createPortal(l.jsx(Pn.div,{...r,ref:t}),i):null});Nu.displayName=aw;function lw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Us=e=>{const{present:t,children:n}=e,r=cw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Tn(r.ref,uw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Us.displayName="Presence";function cw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=lw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Rr(r.current);s.current=a==="mounted"?c:"none"},[a]),De(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=Rr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),De(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=Rr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=Rr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Rr(e){return(e==null?void 0:e.animationName)||"none"}function uw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dw="VisuallyHidden",Tu=d.forwardRef((e,t)=>l.jsx(Pn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Tu.displayName=dw;var fw=Tu,[Lr,zx]=Ct("Tooltip",[mu]),Vr=mu(),Pu="TooltipProvider",pw=700,js="tooltip.open",[gw,Ws]=Lr(Pu),Au=e=>{const{__scopeTooltip:t,delayDuration:n=pw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[i,a]=d.useState(!0),u=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),l.jsx(gw,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:d.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:s})};Au.displayName=Pu;var Br="Tooltip",[hw,On]=Lr(Br),_u=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Ws(Br,e.__scopeTooltip),c=Vr(t),[f,g]=d.useState(null),m=Yt(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,x]=Xt({prop:r,defaultProp:o,onChange:S=>{S?(u.onOpen(),document.dispatchEvent(new CustomEvent(js))):u.onClose(),s==null||s(S)}}),E=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),T=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,x(!0)},[x]),C=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),N=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0),p.current=0},h)},[h,x]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(rw,{...c,children:l.jsx(hw,{scope:t,contentId:m,open:w,stateAttribute:E,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?N():T()},[u.isOpenDelayed,N,T]),onTriggerLeave:d.useCallback(()=>{v?C():(window.clearTimeout(p.current),p.current=0)},[C,v]),onOpen:T,onClose:C,disableHoverableContent:v,children:n})})};_u.displayName=Br;var Gs="TooltipTrigger",Fu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=On(Gs,n),s=Ws(Gs,n),i=Vr(n),a=d.useRef(null),u=Tn(t,a,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),g=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),l.jsx(ow,{asChild:!0,...i,children:l.jsx(Pn.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:it(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:it(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:it(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:it(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:it(e.onBlur,o.onClose),onClick:it(e.onClick,o.onClose)})})});Fu.displayName=Gs;var qs="TooltipPortal",[mw,vw]=Lr(qs,{forceMount:void 0}),Ou=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=On(qs,t);return l.jsx(mw,{scope:t,forceMount:n,children:l.jsx(Us,{present:n||s.open,children:l.jsx(Nu,{asChild:!0,container:o,children:r})})})};Ou.displayName=qs;var cn="TooltipContent",Du=d.forwardRef((e,t)=>{const n=vw(cn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=On(cn,e.__scopeTooltip);return l.jsx(Us,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Mu,{side:o,...s,ref:t}):l.jsx(yw,{side:o,...s,ref:t})})}),yw=d.forwardRef((e,t)=>{const n=On(cn,e.__scopeTooltip),r=Ws(cn,e.__scopeTooltip),o=d.useRef(null),s=Tn(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:g}=r,m=d.useCallback(()=>{a(null),g(!1)},[g]),p=d.useCallback((v,h)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},x=Cw(w,y.getBoundingClientRect()),E=Sw(w,x),T=Ew(h.getBoundingClientRect()),C=Tw([...E,...T]);a(C),g(!0)},[g]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(u&&f){const v=y=>p(y,f),h=y=>p(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",h)}}},[u,f,p,m]),d.useEffect(()=>{if(i){const v=h=>{const y=h.target,w={x:h.clientX,y:h.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),E=!Nw(w,i);x?m():E&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(Mu,{...e,ref:s})}),[ww,bw]=Lr(Br,{isInside:!1}),Mu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=On(cn,n),c=Vr(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(js,f),()=>document.removeEventListener(js,f)),[f]),d.useEffect(()=>{if(u.trigger){const g=m=>{const p=m.target;p!=null&&p.contains(u.trigger)&&f()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,f]),l.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(sw,{"data-state":u.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(ya,{children:r}),l.jsx(ww,{scope:n,isInside:!0,children:l.jsx(fw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Du.displayName=cn;var $u="TooltipArrow",xw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Vr(n);return bw($u,n).isInside?null:l.jsx(iw,{...o,...r,ref:t})});xw.displayName=$u;function Cw(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Sw(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ew(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Nw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,u=t[s].y,c=t[i].x,f=t[i].y;u>r!=f>r&&n<(c-a)*(r-u)/(f-u)+a&&(o=!o)}return o}function Tw(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Pw(t)}function Pw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Aw=Au,_w=_u,Fw=Fu,Ow=Ou,ku=Du;const Iu=Aw,Ru=_w,Lu=Fw,Ks=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Ow,{children:l.jsx(ku,{ref:r,sideOffset:t,className:Z("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ks.displayName=ku.displayName;function Dw({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Mw=d.forwardRef(Dw);var $w=function(e){return function(t,n){var r=O.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Vu=function(e){return typeof e=="function"},Bu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const kw=$w(O.useEffect);function Hu(e){var t=O.useRef(e);return t.current=e,t}var Iw=function(e){Bu&&(Vu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Hu(e);O.useEffect(function(){return function(){t.current()}},[])},Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zu=Lw,Vw=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,Bw=Vw,Hw=Bw,zw=typeof self=="object"&&self&&self.Object===Object&&self,Uw=Hw||zw||Function("return this")(),Uu=Uw,jw=Uu,Ww=function(){return jw.Date.now()},Gw=Ww,qw=/\s/;function Kw(e){for(var t=e.length;t--&&qw.test(e.charAt(t)););return t}var Xw=Kw,Jw=Xw,Yw=/^\s+/;function Zw(e){return e&&e.slice(0,Jw(e)+1).replace(Yw,"")}var Qw=Zw,eb=Uu,tb=eb.Symbol,ju=tb,Wu=ju,Gu=Object.prototype,nb=Gu.hasOwnProperty,rb=Gu.toString,Dn=Wu?Wu.toStringTag:void 0;function ob(e){var t=nb.call(e,Dn),n=e[Dn];try{e[Dn]=void 0;var r=!0}catch{}var o=rb.call(e);return r&&(t?e[Dn]=n:delete e[Dn]),o}var sb=ob,ib=Object.prototype,ab=ib.toString;function lb(e){return ab.call(e)}var cb=lb,qu=ju,ub=sb,db=cb,fb="[object Null]",pb="[object Undefined]",Ku=qu?qu.toStringTag:void 0;function gb(e){return e==null?e===void 0?pb:fb:Ku&&Ku in Object(e)?ub(e):db(e)}var hb=gb;function mb(e){return e!=null&&typeof e=="object"}var vb=mb,yb=hb,wb=vb,bb="[object Symbol]";function xb(e){return typeof e=="symbol"||wb(e)&&yb(e)==bb}var Cb=xb,Sb=Qw,Xu=zu,Eb=Cb,Ju=NaN,Nb=/^[-+]0x[0-9a-f]+$/i,Tb=/^0b[01]+$/i,Pb=/^0o[0-7]+$/i,Ab=parseInt;function _b(e){if(typeof e=="number")return e;if(Eb(e))return Ju;if(Xu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Xu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Sb(e);var n=Tb.test(e);return n||Pb.test(e)?Ab(e.slice(2),n?2:8):Nb.test(e)?Ju:+e}var Fb=_b,Ob=zu,Xs=Gw,Yu=Fb,Db="Expected a function",Mb=Math.max,$b=Math.min;function kb(e,t,n){var r,o,s,i,a,u,c=0,f=!1,g=!1,m=!0;if(typeof e!="function")throw new TypeError(Db);t=Yu(t)||0,Ob(n)&&(f=!!n.leading,g="maxWait"in n,s=g?Mb(Yu(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(N){var S=r,A=o;return r=o=void 0,c=N,i=e.apply(A,S),i}function v(N){return c=N,a=setTimeout(w,t),f?p(N):i}function h(N){var S=N-u,A=N-c,B=t-S;return g?$b(B,s-A):B}function y(N){var S=N-u,A=N-c;return u===void 0||S>=t||S<0||g&&A>=s}function w(){var N=Xs();if(y(N))return x(N);a=setTimeout(w,h(N))}function x(N){return a=void 0,m&&r?p(N):(r=o=void 0,i)}function E(){a!==void 0&&clearTimeout(a),c=0,r=u=o=a=void 0}function T(){return a===void 0?i:x(Xs())}function C(){var N=Xs(),S=y(N);if(r=arguments,o=this,u=N,S){if(a===void 0)return v(u);if(g)return clearTimeout(a),a=setTimeout(w,t),p(u)}return a===void 0&&(a=setTimeout(w,t)),i}return C.cancel=E,C.flush=T,C}var Ib=kb;const Rb=Rw(Ib);function Lb(){var e=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,t=typeof self=="object"&&self&&self.Object===Object&&self;return e||t}Lb()||(global.Date=Date);function Vb(e,t){var n;Bu&&(Vu(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Hu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=O.useMemo(function(){return Rb(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,rl([],nl(i),!1))},o,t)},[]);return Iw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function Bb(e,t,n){var r=nl(O.useState({}),2),o=r[0],s=r[1],i=Vb(function(){s({})},n).run;O.useEffect(function(){return i()},t),kw(e,[o])}const Hb=O.forwardRef(({onChange:e},t)=>{const n=O.useRef(null),[r,o]=O.useState("");return O.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),Bb(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(Nt,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:s=>o(s.target.value),className:"pr-8"}),r&&l.jsx("button",{onClick:()=>{var s;o(""),(s=n.current)==null||s.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:l.jsx(Mw,{className:"h-5 w-5"})})]})}),We={current:!1},Zu="crawl:jobs",Mn="crawl:current_job",zb=e=>{const[t,n]=O.useState(null),[r,o]=O.useState(0);return O.useEffect(()=>{const s=localStorage.getItem(Mn);if(s){const i=JSON.parse(s);n(i),i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),O.useEffect(()=>{if(!(t!=null&&t.startTime))return;const s=setInterval(()=>{o(Math.floor((Date.now()-t.startTime)/1e3))},1e3);return()=>clearInterval(s)},[t==null?void 0:t.startTime]),O.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await oe.get(`${e}/api/crawl/${t.id}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(Mn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(Mn)},100),f})}catch(a){console.error("Error polling job status:",a)}},i=setInterval(s,3e3);return s(),()=>clearInterval(i)},[t==null?void 0:t.id,e]),{currentJob:t,elapsedTime:r,setCurrentJob:s=>{s&&!s.startTime&&(s.startTime=Date.now()),n(s),s?localStorage.setItem(Mn,JSON.stringify(s)):localStorage.removeItem(Mn)}}},Ub=(e,t,n)=>{const r=[],o=s=>{(e[s]||[]).forEach(a=>{a.name.toLowerCase().includes(t.toLowerCase())&&r.push(a),a.isFolder&&a.key.startsWith(n)&&o(a.key)})};return o(n),r},zr=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},jb=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...zr(e,o.key))}),n},Wb=(e,t,n=[])=>{const[r,o]=O.useState({}),[s,i]=O.useState(!1),[a,u]=O.useState(null),c=async()=>{i(!0);try{const f=!We.current;We.current&&(We.current=!1);const g=await oe.get(`${e}/api/files`,{params:{cache:f,displayPrefixes:JSON.stringify(n),prefix:t},timeout:3e5});o(g.data),u(null)}catch(f){u(f instanceof Error?f:new Error("Failed to fetch files"))}finally{i(!1)}};return O.useEffect(()=>{c()},[]),{data:r,isLoading:s,error:a,refetch:c}},Ur=e=>{var r,o,s;const t=((s=(o=(r=e==null?void 0:e.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:s.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(t||"")},Gb=O.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3000",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var xd;const[i,a]=O.useState(""),[u,c]=O.useState(new Set),[f,g]=O.useState(n),[m,p]=O.useState(!1),[v,h]=O.useState(""),[y,w]=O.useState(!1),[x,E]=O.useState(null),[T,C]=O.useState(!1),[N,S]=O.useState(!1),[A,B]=O.useState(!1),[H,K]=O.useState(null),$=O.useRef(null),{toast:R}=Ps(),[D,G]=O.useState(null),[j,X]=O.useState(""),[q,ne]=O.useState(!1),[ae,se]=O.useState(new Set),[Ce,Ae]=O.useState(""),[nt,dn]=O.useState(!1),[dt,Ft]=O.useState(!1),[ft,rt]=O.useState("rename"),[fn,pt]=O.useState(!1),[gt,Re]=O.useState(""),[Ot,pn]=O.useState("1"),[Dt,Vn]=O.useState(!1),{currentJob:b,elapsedTime:P,setCurrentJob:F}=zb(t),{data:L={},isLoading:V,error:k,refetch:W}=Wb(t,n,s);O.useEffect(()=>{b!=null&&b.status&&(b.status.status==="completed"?(R({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${b.url} với ${b.status.completed} trang`}),We.current=!0,W()):b.status.status==="failed"&&R({title:"Thu thập website thất bại",description:`Không thể thu thập ${b.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(xd=b==null?void 0:b.status)==null?void 0:xd.status]);const te=O.useMemo(()=>L[f]||[],[L,f]),ce=O.useMemo(()=>i?Ub(L,i,f):te,[te,i,f,L]),fe=O.useMemo(()=>{const M={};return ce.forEach((I,U)=>{u.has(I.key)&&(M[U]=!0)}),M},[u,ce]),ht=M=>{const I=zr(L,M);if(I.length===0)return u.has(M)?"all":"none";const U=I.filter(re=>u.has(re)).length;return U===0?"none":U===I.length?"all":"partial"},gn=M=>{g(M)},Bn=async(M,I)=>{w(!0);try{const U=`${I}${M}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:U})).status!==200){R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}We.current=!0,await W(),R({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${M}"`}),h(""),p(!1)}catch(U){console.error("Error creating folder:",U),R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{w(!1)}},hn=async(M,I,U)=>{K(U);try{const re=new FormData;re.append("prefix",I),Array.from(M).forEach(pe=>{pe instanceof File&&re.append("files",pe)}),(await oe.post(`${t}/api/upload`,re,{headers:{"Content-Type":"multipart/form-data"}})).status===200&&(We.current=!0,await W(),R({title:"Đã tải lên tập tin",description:`Đã tải lên thành công ${M.length} tập tin`}))}catch(re){console.error("Error uploading files:",re),R({title:"Lỗi",description:"Không thể tải lên tập tin",variant:"destructive"})}finally{K(null)}},ui=async M=>{C(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[M.key]}}),We.current=!0,await W(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công "${M.name}"`}),E(null)}catch(I){console.error("Error deleting file:",I),R({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{C(!1)}},Ut=M=>{const I=new Set(u),U=typeof M=="function"?M(fe):M;new Set(Object.keys(fe).map(Number)).forEach(ie=>{const pe=ce[ie];pe&&(U[ie]||(I.delete(pe.key),pe.isFolder&&zr(L,pe.key).forEach(_e=>I.delete(_e))))}),Object.entries(U).forEach(([ie,pe])=>{const _e=parseInt(ie),mt=ce[_e];mt&&pe&&(I.add(mt.key),mt.isFolder&&zr(L,mt.key).forEach(pi=>I.add(pi)))}),c(I)},di=async()=>{S(!0);try{const M=Array.from(u).map(I=>{var U;for(const re in L){const ie=(U=L[re])==null?void 0:U.find(pe=>pe.key===I);if(ie)return ie}return null}).filter(I=>I!==null);await oe.delete(`${t}/api/files`,{data:{paths:Array.from(u)}}),We.current=!0,await W(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công ${M.length} mục`}),B(!1),c(new Set)}catch(M){console.error("Error deleting files:",M),R({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{S(!1)}},Jr=async(M,I)=>{ne(!0);try{const U=M.key;let re;M.isFolder?re=U.split("/").slice(0,-2).join("/")+"/":re=U.substring(0,U.lastIndexOf("/")+1);const ie=re+I+(M.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:U,newPath:ie}),We.current=!0,await W(),R({title:"Đã đổi tên",description:`Đã đổi tên thành công "${M.name}" thành "${I}"`}),G(null),X("")}catch(U){console.error("Error renaming item:",U),R({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{ne(!1)}},yd=async M=>{se(I=>new Set([...I,...M]));try{const I=await oe.post(`${t}/api/download`,{paths:M},{responseType:"blob"}),U=window.URL.createObjectURL(I.data),re=document.createElement("a");re.href=U;const ie=I.headers["Content-Disposition"]||I.headers["content-disposition"],pe=ie==null?void 0:ie.match(/filename="(.+)"/),_e=pe?decodeURIComponent(pe[1]):"download.zip";re.setAttribute("download",_e),document.body.appendChild(re),re.click(),document.body.removeChild(re),window.URL.revokeObjectURL(U),R({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${M.length} mục${M.length>1,""}`})}catch(I){console.error("Error downloading files:",I),R({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{se(I=>{const U=new Set(I);return M.forEach(re=>U.delete(re)),U})}},wd=f?f.replace(n,"").split("/").filter(Boolean):[],mx=()=>Array.from(u).map(M=>{var I;for(const U in L){const re=(I=L[U])==null?void 0:I.find(ie=>ie.key===M);if(re)return re}return null}).filter(M=>M!==null),bd=O.useMemo(()=>{const M=[{id:"select",header:()=>{const I=jb(L,f),U=I.length>0&&I.every(ie=>u.has(ie)),re=I.some(ie=>u.has(ie));return l.jsx(Vo,{checked:U?!0:re?"indeterminate":!1,onCheckedChange:ie=>{if(ie){const pe=ce.reduce((_e,mt,pi)=>(_e[pi]=!0,_e),{});Ut(pe)}else Ut({})},"aria-label":"Chọn tất cả"})},cell:({row:I})=>{const U=I.original,ie=U.isFolder?ht(U.key):u.has(U.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(Vo,{checked:ie==="partial"?"indeterminate":ie==="all",onCheckedChange:pe=>{const _e={...fe};pe?_e[I.index]=!0:delete _e[I.index],Ut(_e)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:I})=>{const U=I.original,re=U.key.substring(0,U.key.lastIndexOf("/"))||"/",ie=i.trim()!==""&&re!==f,pe=re.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${U.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{U.isFolder&&gn(U.key)},children:[U.isFolder?l.jsx(Zr,{className:"h-5 w-5 text-blue-500"}):null,U.name]}),ie&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(Zr,{className:"h-4 w-4 text-gray-500 my-auto"}),l.jsxs("span",{className:"flex items-center ml-1",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{gn("")},children:"/"}),pe.map((_e,mt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{gn(pe.slice(0,mt+1).join("/")+"/")},children:_e}),mt<pe.length-1&&l.jsx("span",{children:"/"})]},mt))]})]})]})}}];return r||M.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:I,row:U})=>{const re=I();return l.jsx("span",{children:U.original.isFolder?"-":_g(re)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:I})=>{const U=I.original.lastModified;return l.jsx("span",{children:U.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:I})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>yd([I.original.key]),className:"h-8 w-8 p-0",disabled:ae.has(I.original.key),children:ae.has(I.original.key)?l.jsx(we,{className:"h-4 w-4 animate-spin"}):l.jsx(hi,{className:"h-4 w-4"})}),l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>{G(I.original),X(I.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Md,{className:"h-4 w-4"})}),l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>E(I.original),className:"h-8 w-8 p-0",children:l.jsx(mi,{className:"h-4 w-4"})})]})}),M},[u,ce,fe,ae,r]),fi=_i({data:ce,columns:bd,state:{rowSelection:fe},enableRowSelection:!0,onRowSelectionChange:Ut,getCoreRowModel:Ai()}),vx=async M=>{if(Ur(M)){dn(!0);try{const I=await oe.get(`${t}/api/read-text`,{params:{path:M.key}});Ae(I.data.content)}catch(I){console.error("Error loading file content:",I),R({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{dn(!1)}}},yx=async(M,I)=>{Ft(!0);try{await oe.post(`${t}/api/modify-text`,{path:M.key,content:I}),R({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),We.current=!0,await W(),G(null),Ae(""),rt("rename")}catch(U){console.error("Error saving file content:",U),R({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Ft(!1)}};O.useEffect(()=>{D&&Ur(D)&&(vx(D),rt("rename"))},[D]);const wx=async(M,I)=>{if(b){R({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}Vn(!0);try{const{data:U}=await oe.post(`${t}/api/crawl`,{url:M,limit:I,prefix:f});if(U.id){F({id:U.id,url:M,limit:I,prefix:f});const re=localStorage.getItem(Zu),ie=re?JSON.parse(re):[];ie.some(pe=>pe.id===U.id)||(ie.unshift({url:M,id:U.id,limit:I,prefix:f,timestamp:Date.now()}),ie.length>20&&(ie.length=20),localStorage.setItem(Zu,JSON.stringify(ie))),R({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${M} với giới hạn ${I}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),pt(!1),Re(""),pn("1")}}catch(U){console.error("Error crawling website:",U),R({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Vn(!1)}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(Aa,{className:"s3-explr-breadcrumb",children:l.jsxs(_a,{className:"s3-explr-breadcrumb-list",children:[l.jsx($o,{className:"s3-explr-breadcrumb-item",children:l.jsx(ko,{onClick:()=>g(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),wd.map((M,I)=>l.jsxs(l.Fragment,{children:[l.jsx(Fa,{className:"s3-explr-breadcrumb-separator"},`sep-${I}`),l.jsx($o,{className:"s3-explr-breadcrumb-item",children:l.jsx(ko,{onClick:()=>gn(n+wd.slice(0,I+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:M})},`item-${M}`)]}))]})}),l.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[l.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:l.jsx(Hb,{ref:$,onChange:M=>a(M)})}),l.jsxs(le,{variant:"outline",size:"sm",onClick:()=>{We.current=!0,W()},disabled:V,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Ed,{className:`h-4 w-4 s3-explr-refresh-icon ${V?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[u.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(le,{variant:"outline",size:"sm",onClick:()=>yd(Array.from(u)),disabled:Array.from(u).some(M=>ae.has(M)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(M=>ae.has(M))?l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(hi,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(nn,{open:A,onOpenChange:B,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(le,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(mi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(Rt,{className:"s3-explr-dialog-content",children:[l.jsxs(Lt,{className:"s3-explr-dialog-header",children:[l.jsx(Vt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",u.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>B(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{variant:"destructive",onClick:di,disabled:N,className:"s3-explr-confirm-delete-btn",children:N?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(nn,{open:m,onOpenChange:p,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!f,children:[l.jsx(Ad,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(Rt,{className:"s3-explr-dialog-content",children:[l.jsx(Lt,{className:"s3-explr-dialog-header",children:l.jsx(Vt,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(Nt,{disabled:y,id:"name",value:v,onChange:M=>h(M.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(le,{onClick:()=>{v.trim()&&Bn(v,f)},disabled:y,className:"s3-explr-create-btn",children:[y&&l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),y?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const M=document.createElement("input");M.type="file",M.multiple=!0,M.onchange=I=>{const U=I.target.files;U&&hn(U,f,"files")},M.click()},disabled:H!==null||!!s&&!f,children:H==="files"?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Td,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const M=document.createElement("input");M.type="file",M.multiple=!0,M.webkitdirectory=!0,M.onchange=I=>{const U=I.target.files;U&&hn(U,f,"folder")},M.click()},disabled:H!==null||!!s&&!f,children:H==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Zr,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),b?l.jsx(Iu,{delayDuration:0,children:l.jsxs(Ru,{children:[l.jsx(Lu,{asChild:!0,children:l.jsx("div",{children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(we,{className:"h-4 w-4 animate-spin s3-explr-loader"}),b.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",b.status.completed,"/",b.status.total,") - ",Math.floor(P/60),":",String(P%60).padStart(2,"0")]}):"Đang thu thập..."]})})}),b.status&&l.jsx(Ks,{side:"right",sideOffset:5,children:l.jsxs("div",{className:"space-y-1 p-2",children:[l.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",b.url]}),l.jsxs("p",{children:["Tiến độ: ",b.status.completed,"/",b.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(P/60),":",String(P%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",b.status.status==="scraping"?"Đang thu thập":b.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(nn,{open:fn,onOpenChange:pt,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!f,children:[l.jsx(Od,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(Rt,{className:"s3-explr-dialog-content",children:[l.jsxs(Lt,{className:"s3-explr-dialog-header",children:[l.jsx(Vt,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(hr,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(Nt,{id:"websiteUrl",value:gt,onChange:M=>Re(M.target.value),placeholder:"https://example.com",type:"url",disabled:Dt,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(Nt,{id:"crawlLimit",value:Ot,onChange:M=>{const I=M.target.value;/^\d*$/.test(I)&&pn(I)},placeholder:"1",type:"text",disabled:Dt,className:"s3-explr-input"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>{pt(!1),Re(""),pn("1")},disabled:Dt,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{onClick:()=>{gt.trim()&&wx(gt.trim(),parseInt(Ot)||1)},disabled:Dt||!gt.trim(),className:"s3-explr-crawl-btn",children:Dt?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(nn,{open:!!x,onOpenChange:M=>!M&&E(null),children:l.jsxs(Rt,{className:"s3-explr-dialog-content",children:[l.jsxs(Lt,{className:"s3-explr-dialog-header",children:[l.jsx(Vt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",x==null?void 0:x.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>E(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{variant:"destructive",onClick:()=>ui(x),disabled:T,className:"s3-explr-confirm-delete-btn",children:T?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(nn,{open:!!D,onOpenChange:M=>{M||(G(null),X(""),Ae(""),rt("rename"))},children:l.jsxs(Rt,{className:"s3-explr-dialog-content max-w-2xl",children:[l.jsx(Lt,{className:"s3-explr-dialog-header",children:l.jsx(Vt,{className:"s3-explr-dialog-title",children:D!=null&&D.isFolder?"Đổi tên thư mục":Ur(D)?"Quản lý tập tin":"Đổi tên tập tin"})}),D&&!D.isFolder&&Ur(D)?l.jsxs(rv,{value:ft,onValueChange:M=>rt(M),children:[l.jsxs(gc,{className:"grid w-full grid-cols-2",children:[l.jsx(ps,{value:"rename",children:"Đổi tên"}),l.jsx(ps,{value:"edit",children:"Sửa nội dung"})]}),l.jsx(gs,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Nt,{id:"newName",value:j,onChange:M=>X(M.target.value),placeholder:"Nhập tên mới",disabled:q,className:"s3-explr-input"})]})})}),l.jsx(gs,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:nt?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(we,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(Bt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Cr,{id:"content",value:Ce,onChange:M=>Ae(M.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:dt})]})})})]}):l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Nt,{id:"newName",value:j,onChange:M=>X(M.target.value),placeholder:"Nhập tên mới",disabled:q,className:"s3-explr-input"})]})}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>{G(null),X(""),Ae("")},className:"s3-explr-cancel-btn",children:"Hủy"}),ft==="edit"?l.jsx(le,{onClick:()=>D&&yx(D,Ce),disabled:dt||nt,className:"s3-explr-save-btn",children:dt?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(le,{onClick:()=>{j.trim()&&D&&Jr(D,j.trim())},disabled:q||!j.trim()||j.trim()===(D==null?void 0:D.name),className:"s3-explr-rename-btn",children:q?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})})]})]}),k&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:fi.getHeaderGroups().map(M=>l.jsx(ze,{className:"hover:bg-transparent s3-explr-header-row",children:M.headers.map(I=>l.jsx(Xe,{className:"s3-explr-header-cell",children:I.isPlaceholder?null:Gn(I.column.columnDef.header,I.getContext())},I.id))},M.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:fi.getRowModel().rows.length===0?l.jsx(ze,{className:"s3-explr-empty-row",children:l.jsx(Te,{colSpan:bd.length,className:"h-24 text-center s3-explr-empty-cell",children:i?l.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',i,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:V?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):fi.getRowModel().rows.map(M=>l.jsx(ze,{className:"h-12 s3-explr-row",children:M.getVisibleCells().map(I=>l.jsx(Te,{className:"align-middle s3-explr-cell",children:Gn(I.column.columnDef.cell,I.getContext())},I.id))},M.id))})]})}),r&&o&&l.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[l.jsxs("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:[u.size," ",(u.size===1,"tập tin")," đã chọn"]}),l.jsx(le,{variant:"default",onClick:()=>o(mx()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Hc,{})]})});var $n=e=>e.type==="checkbox",zt=e=>e instanceof Date,Ee=e=>e==null;const Qu=e=>typeof e=="object";var he=e=>!Ee(e)&&!Array.isArray(e)&&Qu(e)&&!zt(e),qb=e=>he(e)&&e.target?$n(e.target)?e.target.checked:e.target.value:e,Kb=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Xb=(e,t)=>e.has(Kb(t)),Jb=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},Js=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ie(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Js&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!Jb(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Ie(e[o]));else return e;return t}var jr=e=>Array.isArray(e)?e.filter(Boolean):[],ge=e=>e===void 0,z=(e,t,n)=>{if(!t||!he(e))return n;const r=jr(t.split(/[,[\].]+?/)).reduce((o,s)=>Ee(o)?o:o[s],e);return ge(r)||r===e?ge(e[t])?n:e[t]:r},Qe=e=>typeof e=="boolean",Ys=e=>/^\w*$/.test(e),ed=e=>jr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),de=(e,t,n)=>{let r=-1;const o=Ys(t)?[t]:ed(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let u=n;if(r!==i){const c=e[a];u=he(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const td={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ge={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ct={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};O.createContext(null);var Yb=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Ge.all&&(t._proxyFormState[i]=!r||Ge.all),e[i]}});return o},Pe=e=>he(e)&&!Object.keys(e).length,Zb=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Pe(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===Ge.all)},Wr=e=>Array.isArray(e)?e:[e];function Qb(e){const t=O.useRef(e);t.current=e,O.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var et=e=>typeof e=="string",ex=(e,t,n,r,o)=>et(e)?(r&&t.watch.add(e),z(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),z(n,s))):(r&&(t.watchAll=!0),n),tx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},nd=e=>({isOnSubmit:!e||e===Ge.onSubmit,isOnBlur:e===Ge.onBlur,isOnChange:e===Ge.onChange,isOnAll:e===Ge.all,isOnTouch:e===Ge.onTouched}),rd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const kn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=z(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(kn(a,t))break}else if(he(a)&&kn(a,t))break}}};var nx=(e,t,n)=>{const r=Wr(z(e,n));return de(r,"root",t[n]),de(e,n,r),e},Zs=e=>e.type==="file",tt=e=>typeof e=="function",Gr=e=>{if(!Js)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qr=e=>et(e),Qs=e=>e.type==="radio",Kr=e=>e instanceof RegExp;const od={value:!1,isValid:!1},sd={value:!0,isValid:!0};var id=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ge(e[0].attributes.value)?ge(e[0].value)||e[0].value===""?sd:{value:e[0].value,isValid:!0}:sd:od}return od};const ad={isValid:!1,value:null};var ld=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ad):ad;function cd(e,t,n="validate"){if(qr(e)||Array.isArray(e)&&e.every(qr)||Qe(e)&&!e)return{type:n,message:qr(e)?e:"",ref:t}}var un=e=>he(e)&&!Kr(e)?e:{value:e,message:""},ud=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:g,pattern:m,validate:p,name:v,valueAsNumber:h,mount:y,disabled:w}=e._f,x=z(t,v);if(!y||w)return{};const E=i?i[0]:s,T=$=>{r&&E.reportValidity&&(E.setCustomValidity(Qe($)?"":$||""),E.reportValidity())},C={},N=Qs(s),S=$n(s),A=N||S,B=(h||Zs(s))&&ge(s.value)&&ge(x)||Gr(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,H=tx.bind(null,v,n,C),K=($,R,D,G=ct.maxLength,j=ct.minLength)=>{const X=$?R:D;C[v]={type:$?G:j,message:X,ref:s,...H($?G:j,X)}};if(o?!Array.isArray(x)||!x.length:a&&(!A&&(B||Ee(x))||Qe(x)&&!x||S&&!id(i).isValid||N&&!ld(i).isValid)){const{value:$,message:R}=qr(a)?{value:!!a,message:a}:un(a);if($&&(C[v]={type:ct.required,message:R,ref:E,...H(ct.required,R)},!n))return T(R),C}if(!B&&(!Ee(f)||!Ee(g))){let $,R;const D=un(g),G=un(f);if(!Ee(x)&&!isNaN(x)){const j=s.valueAsNumber||x&&+x;Ee(D.value)||($=j>D.value),Ee(G.value)||(R=j<G.value)}else{const j=s.valueAsDate||new Date(x),X=ae=>new Date(new Date().toDateString()+" "+ae),q=s.type=="time",ne=s.type=="week";et(D.value)&&x&&($=q?X(x)>X(D.value):ne?x>D.value:j>new Date(D.value)),et(G.value)&&x&&(R=q?X(x)<X(G.value):ne?x<G.value:j<new Date(G.value))}if(($||R)&&(K(!!$,D.message,G.message,ct.max,ct.min),!n))return T(C[v].message),C}if((u||c)&&!B&&(et(x)||o&&Array.isArray(x))){const $=un(u),R=un(c),D=!Ee($.value)&&x.length>+$.value,G=!Ee(R.value)&&x.length<+R.value;if((D||G)&&(K(D,$.message,R.message),!n))return T(C[v].message),C}if(m&&!B&&et(x)){const{value:$,message:R}=un(m);if(Kr($)&&!x.match($)&&(C[v]={type:ct.pattern,message:R,ref:s,...H(ct.pattern,R)},!n))return T(R),C}if(p){if(tt(p)){const $=await p(x,t),R=cd($,E);if(R&&(C[v]={...R,...H(ct.validate,R.message)},!n))return T(R.message),C}else if(he(p)){let $={};for(const R in p){if(!Pe($)&&!n)break;const D=cd(await p[R](x,t),E,R);D&&($={...D,...H(R,D.message)},T(D.message),n&&(C[v]=$))}if(!Pe($)&&(C[v]={ref:E,...$},!n))return C}}return T(!0),C};function rx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ge(e)?r++:e[t[r++]];return e}function ox(e){for(const t in e)if(e.hasOwnProperty(t)&&!ge(e[t]))return!1;return!0}function ye(e,t){const n=Array.isArray(t)?t:Ys(t)?[t]:ed(t),r=n.length===1?e:rx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&Pe(r)||Array.isArray(r)&&ox(r))&&ye(e,n.slice(0,-1)),e}var ei=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},ti=e=>Ee(e)||!Qu(e);function _t(e,t){if(ti(e)||ti(t))return e===t;if(zt(e)&&zt(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(zt(s)&&zt(i)||he(s)&&he(i)||Array.isArray(s)&&Array.isArray(i)?!_t(s,i):s!==i)return!1}}return!0}var dd=e=>e.type==="select-multiple",sx=e=>Qs(e)||$n(e),ni=e=>Gr(e)&&e.isConnected,fd=e=>{for(const t in e)if(tt(e[t]))return!0;return!1};function Xr(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!fd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Xr(e[r],t[r])):Ee(e[r])||(t[r]=!0);return t}function pd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!fd(e[o])?ge(t)||ti(n[o])?n[o]=Array.isArray(e[o])?Xr(e[o],[]):{...Xr(e[o])}:pd(e[o],Ee(t)?{}:t[o],n[o]):n[o]=!_t(e[o],t[o]);return n}var In=(e,t)=>pd(e,t,Xr(t)),gd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ge(e)?e:t?e===""?NaN:e&&+e:n&&et(e)?new Date(e):r?r(e):e;function ri(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Zs(t)?t.files:Qs(t)?ld(e.refs).value:dd(t)?[...t.selectedOptions].map(({value:n})=>n):$n(t)?id(e.refs).value:gd(ge(t.value)?e.ref.value:t.value,e)}var ix=(e,t,n,r)=>{const o={};for(const s of e){const i=z(t,s);i&&de(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Rn=e=>ge(e)?e:Kr(e)?e.source:he(e)?Kr(e.value)?e.value.source:e.value:e;const hd="AsyncFunction";var ax=e=>!!e&&!!e.validate&&!!(tt(e.validate)&&e.validate.constructor.name===hd||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===hd)),lx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function md(e,t,n){const r=z(e,n);if(r||Ys(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=z(t,s),a=z(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var cx=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,ux=(e,t)=>!jr(z(e,t)).length&&ye(e,t);const dx={mode:Ge.onSubmit,reValidateMode:Ge.onChange,shouldFocusError:!0};function fx(e={}){let t={...dx,...e},n={submitCount:0,isDirty:!1,isLoading:tt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=he(t.defaultValues)||he(t.values)?Ie(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ie(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:ei(),array:ei(),state:ei()},m=nd(t.mode),p=nd(t.reValidateMode),v=t.criteriaMode===Ge.all,h=b=>P=>{clearTimeout(c),c=setTimeout(b,P)},y=async b=>{if(!t.disabled&&(f.isValid||b)){const P=t.resolver?Pe((await A()).errors):await H(r,!0);P!==n.isValid&&g.state.next({isValid:P})}},w=(b,P)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((b||Array.from(a.mount)).forEach(F=>{F&&(P?de(n.validatingFields,F,P):ye(n.validatingFields,F))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Pe(n.validatingFields)}))},x=(b,P=[],F,L,V=!0,k=!0)=>{if(L&&F&&!t.disabled){if(i.action=!0,k&&Array.isArray(z(r,b))){const W=F(z(r,b),L.argA,L.argB);V&&de(r,b,W)}if(k&&Array.isArray(z(n.errors,b))){const W=F(z(n.errors,b),L.argA,L.argB);V&&de(n.errors,b,W),ux(n.errors,b)}if(f.touchedFields&&k&&Array.isArray(z(n.touchedFields,b))){const W=F(z(n.touchedFields,b),L.argA,L.argB);V&&de(n.touchedFields,b,W)}f.dirtyFields&&(n.dirtyFields=In(o,s)),g.state.next({name:b,isDirty:$(b,P),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else de(s,b,P)},E=(b,P)=>{de(n.errors,b,P),g.state.next({errors:n.errors})},T=b=>{n.errors=b,g.state.next({errors:n.errors,isValid:!1})},C=(b,P,F,L)=>{const V=z(r,b);if(V){const k=z(s,b,ge(F)?z(o,b):F);ge(k)||L&&L.defaultChecked||P?de(s,b,P?k:ri(V._f)):G(b,k),i.mount&&y()}},N=(b,P,F,L,V)=>{let k=!1,W=!1;const te={name:b};if(!t.disabled){const ce=!!(z(r,b)&&z(r,b)._f&&z(r,b)._f.disabled);if(!F||L){f.isDirty&&(W=n.isDirty,n.isDirty=te.isDirty=$(),k=W!==te.isDirty);const fe=ce||_t(z(o,b),P);W=!!(!ce&&z(n.dirtyFields,b)),fe||ce?ye(n.dirtyFields,b):de(n.dirtyFields,b,!0),te.dirtyFields=n.dirtyFields,k=k||f.dirtyFields&&W!==!fe}if(F){const fe=z(n.touchedFields,b);fe||(de(n.touchedFields,b,F),te.touchedFields=n.touchedFields,k=k||f.touchedFields&&fe!==F)}k&&V&&g.state.next(te)}return k?te:{}},S=(b,P,F,L)=>{const V=z(n.errors,b),k=f.isValid&&Qe(P)&&n.isValid!==P;if(t.delayError&&F?(u=h(()=>E(b,F)),u(t.delayError)):(clearTimeout(c),u=null,F?de(n.errors,b,F):ye(n.errors,b)),(F?!_t(V,F):V)||!Pe(L)||k){const W={...L,...k&&Qe(P)?{isValid:P}:{},errors:n.errors,name:b};n={...n,...W},g.state.next(W)}},A=async b=>{w(b,!0);const P=await t.resolver(s,t.context,ix(b||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(b),P},B=async b=>{const{errors:P}=await A(b);if(b)for(const F of b){const L=z(P,F);L?de(n.errors,F,L):ye(n.errors,F)}else n.errors=P;return P},H=async(b,P,F={valid:!0})=>{for(const L in b){const V=b[L];if(V){const{_f:k,...W}=V;if(k){const te=a.array.has(k.name),ce=V._f&&ax(V._f);ce&&f.validatingFields&&w([L],!0);const fe=await ud(V,s,v,t.shouldUseNativeValidation&&!P,te);if(ce&&f.validatingFields&&w([L]),fe[k.name]&&(F.valid=!1,P))break;!P&&(z(fe,k.name)?te?nx(n.errors,fe,k.name):de(n.errors,k.name,fe[k.name]):ye(n.errors,k.name))}!Pe(W)&&await H(W,P,F)}}return F.valid},K=()=>{for(const b of a.unMount){const P=z(r,b);P&&(P._f.refs?P._f.refs.every(F=>!ni(F)):!ni(P._f.ref))&&dt(b)}a.unMount=new Set},$=(b,P)=>!t.disabled&&(b&&P&&de(s,b,P),!_t(se(),o)),R=(b,P,F)=>ex(b,a,{...i.mount?s:ge(P)?o:et(b)?{[b]:P}:P},F,P),D=b=>jr(z(i.mount?s:o,b,t.shouldUnregister?z(o,b,[]):[])),G=(b,P,F={})=>{const L=z(r,b);let V=P;if(L){const k=L._f;k&&(!k.disabled&&de(s,b,gd(P,k)),V=Gr(k.ref)&&Ee(P)?"":P,dd(k.ref)?[...k.ref.options].forEach(W=>W.selected=V.includes(W.value)):k.refs?$n(k.ref)?k.refs.length>1?k.refs.forEach(W=>(!W.defaultChecked||!W.disabled)&&(W.checked=Array.isArray(V)?!!V.find(te=>te===W.value):V===W.value)):k.refs[0]&&(k.refs[0].checked=!!V):k.refs.forEach(W=>W.checked=W.value===V):Zs(k.ref)?k.ref.value="":(k.ref.value=V,k.ref.type||g.values.next({name:b,values:{...s}})))}(F.shouldDirty||F.shouldTouch)&&N(b,V,F.shouldTouch,F.shouldDirty,!0),F.shouldValidate&&ae(b)},j=(b,P,F)=>{for(const L in P){const V=P[L],k=`${b}.${L}`,W=z(r,k);(a.array.has(b)||he(V)||W&&!W._f)&&!zt(V)?j(k,V,F):G(k,V,F)}},X=(b,P,F={})=>{const L=z(r,b),V=a.array.has(b),k=Ie(P);de(s,b,k),V?(g.array.next({name:b,values:{...s}}),(f.isDirty||f.dirtyFields)&&F.shouldDirty&&g.state.next({name:b,dirtyFields:In(o,s),isDirty:$(b,k)})):L&&!L._f&&!Ee(k)?j(b,k,F):G(b,k,F),rd(b,a)&&g.state.next({...n}),g.values.next({name:i.mount?b:void 0,values:{...s}})},q=async b=>{i.mount=!0;const P=b.target;let F=P.name,L=!0;const V=z(r,F),k=()=>P.type?ri(V._f):qb(b),W=te=>{L=Number.isNaN(te)||zt(te)&&isNaN(te.getTime())||_t(te,z(s,F,te))};if(V){let te,ce;const fe=k(),ht=b.type===td.BLUR||b.type===td.FOCUS_OUT,gn=!lx(V._f)&&!t.resolver&&!z(n.errors,F)&&!V._f.deps||cx(ht,z(n.touchedFields,F),n.isSubmitted,p,m),Bn=rd(F,a,ht);de(s,F,fe),ht?(V._f.onBlur&&V._f.onBlur(b),u&&u(0)):V._f.onChange&&V._f.onChange(b);const hn=N(F,fe,ht,!1),ui=!Pe(hn)||Bn;if(!ht&&g.values.next({name:F,type:b.type,values:{...s}}),gn)return f.isValid&&(t.mode==="onBlur"?ht&&y():y()),ui&&g.state.next({name:F,...Bn?{}:hn});if(!ht&&Bn&&g.state.next({...n}),t.resolver){const{errors:Ut}=await A([F]);if(W(fe),L){const di=md(n.errors,r,F),Jr=md(Ut,r,di.name||F);te=Jr.error,F=Jr.name,ce=Pe(Ut)}}else w([F],!0),te=(await ud(V,s,v,t.shouldUseNativeValidation))[F],w([F]),W(fe),L&&(te?ce=!1:f.isValid&&(ce=await H(r,!0)));L&&(V._f.deps&&ae(V._f.deps),S(F,ce,te,hn))}},ne=(b,P)=>{if(z(n.errors,P)&&b.focus)return b.focus(),1},ae=async(b,P={})=>{let F,L;const V=Wr(b);if(t.resolver){const k=await B(ge(b)?b:V);F=Pe(k),L=b?!V.some(W=>z(k,W)):F}else b?(L=(await Promise.all(V.map(async k=>{const W=z(r,k);return await H(W&&W._f?{[k]:W}:W)}))).every(Boolean),!(!L&&!n.isValid)&&y()):L=F=await H(r);return g.state.next({...!et(b)||f.isValid&&F!==n.isValid?{}:{name:b},...t.resolver||!b?{isValid:F}:{},errors:n.errors}),P.shouldFocus&&!L&&kn(r,ne,b?V:a.mount),L},se=b=>{const P={...i.mount?s:o};return ge(b)?P:et(b)?z(P,b):b.map(F=>z(P,F))},Ce=(b,P)=>({invalid:!!z((P||n).errors,b),isDirty:!!z((P||n).dirtyFields,b),error:z((P||n).errors,b),isValidating:!!z(n.validatingFields,b),isTouched:!!z((P||n).touchedFields,b)}),Ae=b=>{b&&Wr(b).forEach(P=>ye(n.errors,P)),g.state.next({errors:b?n.errors:{}})},nt=(b,P,F)=>{const L=(z(r,b,{_f:{}})._f||{}).ref,V=z(n.errors,b)||{},{ref:k,message:W,type:te,...ce}=V;de(n.errors,b,{...ce,...P,ref:L}),g.state.next({name:b,errors:n.errors,isValid:!1}),F&&F.shouldFocus&&L&&L.focus&&L.focus()},dn=(b,P)=>tt(b)?g.values.subscribe({next:F=>b(R(void 0,P),F)}):R(b,P,!0),dt=(b,P={})=>{for(const F of b?Wr(b):a.mount)a.mount.delete(F),a.array.delete(F),P.keepValue||(ye(r,F),ye(s,F)),!P.keepError&&ye(n.errors,F),!P.keepDirty&&ye(n.dirtyFields,F),!P.keepTouched&&ye(n.touchedFields,F),!P.keepIsValidating&&ye(n.validatingFields,F),!t.shouldUnregister&&!P.keepDefaultValue&&ye(o,F);g.values.next({values:{...s}}),g.state.next({...n,...P.keepDirty?{isDirty:$()}:{}}),!P.keepIsValid&&y()},Ft=({disabled:b,name:P,field:F,fields:L,value:V})=>{if(Qe(b)&&i.mount||b){const k=b?void 0:ge(V)?ri(F?F._f:z(L,P)._f):V;(b||!b&&!ge(k))&&de(s,P,k),N(P,k,!1,!1,!0)}},ft=(b,P={})=>{let F=z(r,b);const L=Qe(P.disabled)||Qe(t.disabled);return de(r,b,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:b}},name:b,mount:!0,...P}}),a.mount.add(b),F?Ft({field:F,disabled:Qe(P.disabled)?P.disabled:t.disabled,name:b,value:P.value}):C(b,!0,P.value),{...L?{disabled:P.disabled||t.disabled}:{},...t.progressive?{required:!!P.required,min:Rn(P.min),max:Rn(P.max),minLength:Rn(P.minLength),maxLength:Rn(P.maxLength),pattern:Rn(P.pattern)}:{},name:b,onChange:q,onBlur:q,ref:V=>{if(V){ft(b,P),F=z(r,b);const k=ge(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,W=sx(k),te=F._f.refs||[];if(W?te.find(ce=>ce===k):k===F._f.ref)return;de(r,b,{_f:{...F._f,...W?{refs:[...te.filter(ni),k,...Array.isArray(z(o,b))?[{}]:[]],ref:{type:k.type,name:b}}:{ref:k}}}),C(b,!1,void 0,k)}else F=z(r,b,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||P.shouldUnregister)&&!(Xb(a.array,b)&&i.action)&&a.unMount.add(b)}}},rt=()=>t.shouldFocusError&&kn(r,ne,a.mount),fn=b=>{Qe(b)&&(g.state.next({disabled:b}),kn(r,(P,F)=>{const L=z(r,F);L&&(P.disabled=L._f.disabled||b,Array.isArray(L._f.refs)&&L._f.refs.forEach(V=>{V.disabled=L._f.disabled||b}))},0,!1))},pt=(b,P)=>async F=>{let L;if(F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist()),t.disabled){P&&await P({...n.errors},F);return}let V=Ie(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:k,values:W}=await A();n.errors=k,V=W}else await H(r);if(ye(n.errors,"root"),Pe(n.errors)){g.state.next({errors:{}});try{await b(V,F)}catch(k){L=k}}else P&&await P({...n.errors},F),rt(),setTimeout(rt);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Pe(n.errors)&&!L,submitCount:n.submitCount+1,errors:n.errors}),L)throw L},gt=(b,P={})=>{z(r,b)&&(ge(P.defaultValue)?X(b,Ie(z(o,b))):(X(b,P.defaultValue),de(o,b,Ie(P.defaultValue))),P.keepTouched||ye(n.touchedFields,b),P.keepDirty||(ye(n.dirtyFields,b),n.isDirty=P.defaultValue?$(b,Ie(z(o,b))):$()),P.keepError||(ye(n.errors,b),f.isValid&&y()),g.state.next({...n}))},Re=(b,P={})=>{const F=b?Ie(b):o,L=Ie(F),V=Pe(b),k=V?o:L;if(P.keepDefaultValues||(o=F),!P.keepValues){if(P.keepDirtyValues){const W=new Set([...a.mount,...Object.keys(In(o,s))]);for(const te of Array.from(W))z(n.dirtyFields,te)?de(k,te,z(s,te)):X(te,z(k,te))}else{if(Js&&ge(b))for(const W of a.mount){const te=z(r,W);if(te&&te._f){const ce=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(Gr(ce)){const fe=ce.closest("form");if(fe){fe.reset();break}}}}r={}}s=t.shouldUnregister?P.keepDefaultValues?Ie(o):{}:Ie(k),g.array.next({values:{...k}}),g.values.next({values:{...k}})}a={mount:P.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!P.keepIsValid||!!P.keepDirtyValues,i.watch=!!t.shouldUnregister,g.state.next({submitCount:P.keepSubmitCount?n.submitCount:0,isDirty:V?!1:P.keepDirty?n.isDirty:!!(P.keepDefaultValues&&!_t(b,o)),isSubmitted:P.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V?{}:P.keepDirtyValues?P.keepDefaultValues&&s?In(o,s):n.dirtyFields:P.keepDefaultValues&&b?In(o,b):P.keepDirty?n.dirtyFields:{},touchedFields:P.keepTouched?n.touchedFields:{},errors:P.keepErrors?n.errors:{},isSubmitSuccessful:P.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ot=(b,P)=>Re(tt(b)?b(s):b,P);return{control:{register:ft,unregister:dt,getFieldState:Ce,handleSubmit:pt,setError:nt,_executeSchema:A,_getWatch:R,_getDirty:$,_updateValid:y,_removeUnmounted:K,_updateFieldArray:x,_updateDisabledField:Ft,_getFieldArray:D,_reset:Re,_resetDefaultValues:()=>tt(t.defaultValues)&&t.defaultValues().then(b=>{Ot(b,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:b=>{n={...n,...b}},_disableForm:fn,_subjects:g,_proxyFormState:f,_setErrors:T,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(b){i=b},get _defaultValues(){return o},get _names(){return a},set _names(b){a=b},get _formState(){return n},set _formState(b){n=b},get _options(){return t},set _options(b){t={...t,...b}}},trigger:ae,register:ft,handleSubmit:pt,watch:dn,setValue:X,getValues:se,reset:Ot,resetField:gt,clearErrors:Ae,unregister:dt,setError:nt,setFocus:(b,P={})=>{const F=z(r,b),L=F&&F._f;if(L){const V=L.refs?L.refs[0]:L.ref;V.focus&&(V.focus(),P.shouldSelect&&tt(V.select)&&V.select())}},getFieldState:Ce}}function px(e={}){const t=O.useRef(),n=O.useRef(),[r,o]=O.useState({isDirty:!1,isValidating:!1,isLoading:tt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:tt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...fx(e),formState:r});const s=t.current.control;return s._options=e,Qb({subject:s._subjects.state,next:i=>{Zb(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),O.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),O.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),O.useEffect(()=>{e.values&&!_t(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),O.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),O.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),O.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),O.useMemo(()=>({...t.current,formState:Yb(r,s)}),[r,s])}const oi=({className:e,children:t,content:n,side:r})=>{const[o,s]=O.useState(!1);return l.jsx(Iu,{delayDuration:0,children:l.jsxs(Ru,{open:o,children:[l.jsx(Lu,{asChild:!0,children:l.jsx("button",{type:"button",className:Z("cursor-pointer",e),onClick:()=>s(!o),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onTouchStart:()=>s(!o),onKeyDown:i=>{i.preventDefault(),i.key==="Enter"&&s(!o)},children:t})}),l.jsx(Ks,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},si=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:Z("mx-auto flex w-full justify-center",e),...t});si.displayName="Pagination";const ii=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:Z("flex flex-row items-center gap-1",e),...t}));ii.displayName="PaginationContent";const ut=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("",e),...t}));ut.displayName="PaginationItem";const Ln=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:Z(Ma({variant:t?"outline":"ghost",size:n}),e),...r});Ln.displayName="PaginationLink";const ai=({className:e,...t})=>l.jsxs(Ln,{"aria-label":"Go to previous page",size:"default",className:Z("gap-1 pl-2.5",e),...t,children:[l.jsx(Wp,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});ai.displayName="PaginationPrevious";const li=({className:e,...t})=>l.jsxs(Ln,{"aria-label":"Go to next page",size:"default",className:Z("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(ha,{className:"h-4 w-4"})]});li.displayName="PaginationNext";const ci=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:Z("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(Gp,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});ci.displayName="PaginationEllipsis";const gx=({apiBaseUrl:e="http://localhost:3000"})=>{var E,T,C;const[t,n]=O.useState([]),[r,o]=O.useState(!1),[s,i]=O.useState([]),[a,u]=O.useState(1),[c,f]=O.useState(1),[g,m]=O.useState(null),p=N=>{const S=N.match(/\d{6}/);if(!S)return{month:"",year:""};const A=S[0],B=A.substring(0,2),H=A.substring(2);return{month:B,year:H}},v=N=>N.map(A=>{let B=(A==null?void 0:A.month)||"",H=(A==null?void 0:A.year)||"";if((!B||!H)&&(A!=null&&A.file_name)){const K=p(A.file_name);B=B||K.month,H=H||K.year}return{id:A==null?void 0:A.id,prefix:(A==null?void 0:A.prefix)||"",model:(A==null?void 0:A.model)||"",fileName:(A==null?void 0:A.file_name)||"",code:(A==null?void 0:A.stock_id)||"",month:B,year:H,content:(A==null?void 0:A.text_summary)||"",status:(A==null?void 0:A.status)||"",note:(A==null?void 0:A.note)||"",lastUpdate:A==null?void 0:A.updated_at,stock_id:A==null?void 0:A.stock_id}}),h=N=>{if(!(N!=null&&N.data))return[];const S=v(N==null?void 0:N.data);n(S),f(N.pagination.totalPages)},y=async(N=1,S=15)=>{console.log("🚀 ~ fetchData ~ page:",N),m(N);try{const A=await oe.get(`${e}/api/latest-summaries`,{params:{page:N,limit:S}});console.log("🚀 ~ fetchData ~ result.data:",A.data),(A==null?void 0:A.status)===200?h(A.data):console.error(A)}catch(A){console.error("Error fetching data:",A)}finally{m(null),o(!1)}};O.useEffect(()=>{y(a)},[a]);const w=O.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:S})=>l.jsx("span",{className:"flex flex-col",children:S.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:S})=>{const A=S.original.month,B=S.original.year;return l.jsx("span",{className:"flex flex-col",children:`${A}/${B}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:S})=>{const A=S.getValue("content");return l.jsx(oi,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:A}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:A})})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:S})=>{const B=S.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${B?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:B?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:S})=>l.jsx(oi,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:S.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:S.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:S})=>{const A=new Date(S.original.lastUpdate),B=A.getDate(),H=A.getMonth()+1,K=`ngày ${B} tháng ${H}`;return l.jsx("span",{className:"flex flex-col",children:K})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:S})=>{const[A,B]=O.useState(!1),[H,K]=O.useState(!1),{handleSubmit:$,register:R,reset:D}=px(),G=S.original.id,j=S.getValue("status"),[X,q]=O.useState(!1),ne=async()=>{try{q(!0);const se=await oe.patch(`${e}/api/toggle-publish/${G}`,{id:G,typeAction:"update",status:j,idInput:G,stock_id:S.original.stock_id,prefix:S.original.prefix,model:S.original.model,summary_result:S.original.content,note:S.original.note});se.status===200?y(a):console.error("Failed to toggle publish status:",se)}catch(se){console.error("Error toggling publish status:",se)}finally{q(!1)}},ae=async se=>{B(!0);try{const Ce=await oe.patch(`${e}/api/update-summary`,{note:se.note,text_summary:se.content,id:G});Ce.status===200?(await y(a),K(!1)):console.error("Failed to update summary:",Ce)}catch(Ce){console.error("Error updating summary:",Ce)}return B(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsxs(nn,{open:H,onOpenChange:se=>{K(se),se?D({content:S.original.content,note:S.original.note}):D()},children:[l.jsx(gr,{asChild:!0,children:l.jsx(le,{variant:"outline",size:"sm",onClick:()=>K(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(Rt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(Lt,{className:"flex flex-col gap-3",children:[l.jsx(Vt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:$(ae),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Nội dung:"}),l.jsx(Cr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:S.original.answer||"",rows:10,...R("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Lưu ý:"}),l.jsx(Cr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:S.original.note||"",rows:1,...R("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(le,{disabled:A,type:"submit",variant:"default",children:A?l.jsx(we,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(le,{variant:"outline",size:"sm",onClick:ne,disabled:X,className:"w-[70px] px-2 py-0.5 h-7",children:X?l.jsx(we,{className:"h-4 w-4 animate-spin"}):j==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=_i({data:t,columns:w,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:pf(),getCoreRowModel:Ai()});return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:l.jsx(Nt,{placeholder:"Tìm kiếm theo mã...",value:((E=x.getColumn("code"))==null?void 0:E.getFilterValue())??"",onChange:N=>{var S;return(S=x.getColumn("code"))==null?void 0:S.setFilterValue(N.target.value)},className:"max-w-sm"})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(N=>l.jsx(ze,{className:"hover:bg-transparent s3-explr-header-row",children:N.headers.map(S=>l.jsx(Xe,{className:"s3-explr-header-cell",children:S.isPlaceholder?null:Gn(S.column.columnDef.header,S.getContext())},S.id))},N.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:(T=x.getRowModel().rows)!=null&&T.length?(C=x.getRowModel().rows)==null?void 0:C.map(N=>l.jsx(ze,{className:"h-12 s3-explr-row",children:N.getVisibleCells().map(S=>l.jsx(Te,{className:"align-middle s3-explr-cell",children:Gn(S.column.columnDef.cell,S.getContext())},S.id))},N.id)):r?l.jsx(ze,{children:l.jsx(Te,{colSpan:w.length,className:"h-24 text-center",children:"loading..."})}):l.jsx(ze,{children:l.jsx(Te,{colSpan:w.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(si,{children:l.jsxs(ii,{children:[l.jsx(ut,{children:l.jsx(ai,{onClick:()=>u(N=>Math.max(1,N-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(N,S)=>S+1).filter(N=>N===1||N===c||Math.abs(N-a)<=1).map((N,S,A)=>l.jsxs(l.Fragment,{children:[S>0&&A[S-1]!==N-1&&l.jsx(ut,{children:l.jsx(ci,{})},N+"..."),l.jsx(ut,{children:l.jsx(Ln,{onClick:()=>u(N),isActive:a===N,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===N?l.jsx(we,{className:"h-4 w-4 animate-spin"}):N})},N)]})),l.jsx(ut,{children:l.jsx(li,{onClick:()=>u(N=>Math.min(c,N+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},vd=10,hx=O.memo(({apiBaseUrl:e="http://localhost:3000"})=>{const[t,n]=O.useState(1),[r,o]=O.useState([]),[s,i]=O.useState({total:0,page:1,limit:vd,totalPages:1}),[a,u]=O.useState(!0),[c,f]=O.useState(null),[g,m]=O.useState(new Set),{toast:p}=Ps(),[v,h]=O.useState(!1),y=async C=>{try{f(C);const N=await oe.get(`${e}/api/jobs`,{params:{page:C.toString(),limit:vd.toString()}});o(N.data.data),i(N.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};O.useEffect(()=>{y(t)},[t,e]);const w=async C=>{m(N=>new Set(N).add(C.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:C}),p({title:"Job Restarted",description:`Job ${C} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${C}. Please try again.`})}finally{m(N=>{const S=new Set(N);return S.delete(C.toString()),S})}},x=async()=>{h(!0),n(1),await y(1),h(!1)},E=C=>new Date(C).toLocaleString(),T=C=>{if(C=parseFloat(C),C<60)return`${C.toFixed(2)}s`;const N=Math.floor(C/60),S=(C%60).toFixed(0);return`${N}m ${S}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(Up,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(le,{variant:"outline",size:"icon",onClick:x,disabled:v||a,className:"ml-2",children:l.jsx(qp,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(mr,{children:[l.jsx(vr,{children:l.jsxs(ze,{children:[l.jsx(Xe,{children:"ID"}),l.jsx(Xe,{children:"Tên Công Việc"}),l.jsx(Xe,{children:"Thời Gian Bắt Đầu"}),l.jsx(Xe,{children:"Thời Gian Cập Nhật"}),l.jsx(Xe,{children:"Thời Gian Thực Thi"}),l.jsx(Xe,{children:"Trạng Thái"}),l.jsx(Xe,{children:"Thao Tác"})]})}),l.jsx(yr,{children:a&&r.length===0?l.jsx(ze,{children:l.jsx(Te,{colSpan:7,className:"text-center py-4",children:l.jsx(we,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(C=>{var N,S;return l.jsxs(ze,{children:[l.jsx(Te,{className:"!w-[100px]",children:C.id}),l.jsx(Te,{className:"font-medium",children:(N=C.job_name)==null?void 0:N.replace("Upload file","Summary")}),l.jsx(Te,{className:"!w-[200px]",children:E(C.created_at)}),l.jsx(Te,{className:"!w-[200px]",children:E(C.updated_at)}),l.jsx(Te,{className:"!w-[150px]",children:T(C.execution_time_seconds)}),l.jsx(Te,{className:"!w-[200px]",children:l.jsx(oi,{content:C.status==="fail"&&C.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:C.error}):null,children:l.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
|
|
132
|
+
${C.status==="done"?"bg-green-100 text-green-800":C.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:C.status==="fail"?"FAILED":(S=C.status)==null?void 0:S.toUpperCase()})})}),l.jsx(Te,{className:"!w-[200px]",children:C.status==="fail"?l.jsx(le,{variant:"outline",size:"sm",onClick:()=>w(C.id),disabled:g.has(C.id.toString()),className:"h-[32px]",children:g.has(C.id.toString())?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):l.jsx("div",{className:"h-[32px]"})})]},C.id)})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(si,{children:l.jsxs(ii,{children:[l.jsx(ut,{children:l.jsx(ai,{onClick:()=>n(C=>Math.max(1,C-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(C,N)=>N+1).filter(C=>C===1||C===s.totalPages||Math.abs(C-t)<=1).map((C,N,S)=>l.jsxs(l.Fragment,{children:[N>0&&S[N-1]!==C-1&&l.jsx(ut,{children:l.jsx(ci,{})},C+"..."),l.jsx(ut,{children:l.jsx(Ln,{onClick:()=>n(C),isActive:t===C,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===C?l.jsx(we,{className:"h-4 w-4 animate-spin"}):C})},C)]})),l.jsx(ut,{children:l.jsx(li,{onClick:()=>n(C=>Math.min(s.totalPages,C+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(Hc,{})]})});Le.Job=hx,Le.S3Explorer=Gb,Le.Summary=gx,Object.defineProperty(Le,Symbol.toStringTag,{value:"Module"})});
|
|
138
133
|
//# sourceMappingURL=s3-explorer.umd.cjs.map
|