dccxx-s3-explorer 1.0.26 → 1.0.27
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 +3604 -3463
- package/dist/s3-explorer.js.map +1 -1
- package/dist/s3-explorer.umd.cjs +37 -32
- 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(
|
|
1
|
+
(function(qe,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):(qe=typeof globalThis<"u"?globalThis:qe||self,l(qe.S3Explorer={},qe.jsxRuntime,qe.React,qe.ReactDOM))})(this,function(qe,l,D,no){"use strict";function yi(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=yi(D),jn=yi(no);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:"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 wi=d.forwardRef(Pd);function Ad({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 _d=d.forwardRef(Ad);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:"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 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:"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 Md=d.forwardRef(Dd);function Id({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 ro=d.forwardRef(Id);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:"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 kd=d.forwardRef($d);function Ld({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 Rd=d.forwardRef(Ld);function Vd({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:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const Bd=d.forwardRef(Vd);function zd({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 bi=d.forwardRef(zd);/**
|
|
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 St(e,t){return typeof e=="function"?e(t):e}function Le(e,t){return n=>{t.setState(r=>({...r,[e]:St(n,r[e])}))}}function Wn(e){return e instanceof Function}function Hd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Ud(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 Y(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*m,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 Hd(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:Y(()=>[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 Ud(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:Y(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(p=>p.getFlatColumns())]},J(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Y(()=>[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]},J(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Ee="debugHeaders";function wi(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 jd={createTable:e=>{e.getHeaderGroups=Y(()=>[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 jn(t,[...a,...c,...u],e)},J(e.options,Ee,"getHeaderGroups")),e.getCenterHeaderGroups=Y(()=>[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))),jn(t,n,e,"center")),J(e.options,Ee,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Y(()=>[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 jn(t,s,e,"left")},J(e.options,Ee,"getLeftHeaderGroups")),e.getRightHeaderGroups=Y(()=>[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 jn(t,s,e,"right")},J(e.options,Ee,"getRightHeaderGroups")),e.getFooterGroups=Y(()=>[e.getHeaderGroups()],t=>[...t].reverse(),J(e.options,Ee,"getFooterGroups")),e.getLeftFooterGroups=Y(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),J(e.options,Ee,"getLeftFooterGroups")),e.getCenterFooterGroups=Y(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),J(e.options,Ee,"getCenterFooterGroups")),e.getRightFooterGroups=Y(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),J(e.options,Ee,"getRightFooterGroups")),e.getFlatHeaders=Y(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ee,"getFlatHeaders")),e.getLeftFlatHeaders=Y(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ee,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Y(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ee,"getCenterFlatHeaders")),e.getRightFlatHeaders=Y(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),J(e.options,Ee,"getRightFlatHeaders")),e.getCenterLeafHeaders=Y(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ee,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Y(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ee,"getLeftLeafHeaders")),e.getRightLeafHeaders=Y(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),J(e.options,Ee,"getRightLeafHeaders")),e.getLeafHeaders=Y(()=>[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,Ee,"getLeafHeaders"))}};function jn(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],b=y.column.depth===v.depth;let S,E=!1;if(b&&y.column.parent?S=y.column.parent:(S=y.column,E=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(y);else{const x=wi(n,S,{id:[r,p,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${h.filter(P=>P.column===S).length}`:void 0,depth:p,index:h.length});x.subHeaders.push(y),h.push(x)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(h,p-1)},f=t.map((m,p)=>wi(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(S=>{let{colSpan:E,rowSpan:x}=S;h+=E,w.push(x)})):h=1;const b=Math.min(...w);return y=y+b,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 ro=(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:()=>zd(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:Y(()=>[e.getAllLeafColumns()],u=>u.map(c=>Hd(e,a,c,c.id)),J(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Y(()=>[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},Wd={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()}}},bi=(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))};bi.autoRemove=e=>Ge(e);const xi=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};xi.autoRemove=e=>Ge(e);const Ci=(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())};Ci.autoRemove=e=>Ge(e);const Si=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Si.autoRemove=e=>Ge(e)||!(e!=null&&e.length);const Ei=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Ei.autoRemove=e=>Ge(e)||!(e!=null&&e.length);const Ni=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Ni.autoRemove=e=>Ge(e)||!(e!=null&&e.length);const Ti=(e,t,n)=>e.getValue(t)===n;Ti.autoRemove=e=>Ge(e);const Pi=(e,t,n)=>e.getValue(t)==n;Pi.autoRemove=e=>Ge(e);const oo=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};oo.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]},oo.autoRemove=e=>Ge(e)||Ge(e[0])&&Ge(e[1]);const ut={includesString:bi,includesStringSensitive:xi,equalsString:Ci,arrIncludes:Si,arrIncludesAll:Ei,arrIncludesSome:Ni,equals:Ti,weakEquals:Pi,inNumberRange:oo};function Ge(e){return e==null||e===""}const Gd={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$e("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"?ut.includesString:typeof r=="number"?ut.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ut.equals:Array.isArray(r)?ut.arrIncludes:ut.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:ut[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(Ai(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(Ai(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 Ai(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const so={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(!Bd(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},qd={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:$e("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 so.sum;if(Object.prototype.toString.call(r)==="[object Date]")return so.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:so[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 Kd(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 Xd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$e("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Y(n=>[vn(t,n)],n=>n.findIndex(r=>r.id===e.id),J(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=vn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=vn(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=Y(()=>[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 Kd(s,n,r)},J(e.options,"debugTable","_getOrderColumnsFn"))}},io=()=>({left:[],right:[]}),Yd={getInitialState:e=>({columnPinning:io(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$e("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=Y(()=>[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=Y(()=>[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=Y(()=>[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?io():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:io())},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=Y(()=>[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=Y(()=>[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=Y(()=>[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"))}},Wn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ao=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Jd={getDefaultColumnDef:()=>Wn,getInitialState:e=>({columnSizing:{},columnSizingInfo:ao(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$e("columnSizing",e),onColumnSizingInfoChange:$e("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:Wn.minSize,(r=s??e.columnDef.size)!=null?r:Wn.size),(o=e.columnDef.maxSize)!=null?o:Wn.maxSize)},e.getStart=Y(n=>[n,vn(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=Y(n=>[n,vn(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(),lo(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=lo(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(S=>{var E,x;const P=t.options.columnResizeDirection==="rtl"?-1:1,_=(b-((E=S==null?void 0:S.startOffset)!=null?E:0))*P,O=Math.max(_/((x=S==null?void 0:S.startSize)!=null?x:0),-.999999);return S.columnSizingStart.forEach(k=>{let[F,G]=k;c[F]=Math.round(Math.max(G+G*O,0)*100)/100}),{...S,deltaOffset:_,deltaPercentage:O}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},g=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(b=>({...b,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 b;p==null||p.removeEventListener("touchmove",h.moveHandler),p==null||p.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((b=w.touches[0])==null?void 0:b.clientX)}},y=Zd()?{passive:!1}:!1;lo(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?ao():(n=e.initialState.columnSizingInfo)!=null?n:ao())},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 Gn=null;function Zd(){if(typeof Gn=="boolean")return Gn;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 Gn=e,Gn}function lo(e){return e.type==="touchstart"}const Qd={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$e("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=Y(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),J(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Y(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],J(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Y(()=>[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 vn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ef={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()}}},tf={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$e("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=()=>ut.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:ut[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},nf={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$e("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()}}}},co=0,uo=10,fo=()=>({pageIndex:co,pageSize:uo}),rf={getInitialState:e=>({...e,pagination:{...fo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:$e("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?fo():(o=e.initialState.pagination)!=null?o:fo())},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?co:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:co)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?uo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:uo)},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=Y(()=>[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}}},po=()=>({top:[],bottom:[]}),of={getInitialState:e=>({rowPinning:po(),...e}),getDefaultOptions:e=>({onRowPinningChange:$e("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?po():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:po())},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=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),J(e.options,"debugRows","getTopRows")),e.getBottomRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),J(e.options,"debugRows","getBottomRows")),e.getCenterRows=Y(()=>[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"))}},sf={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$e("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=>{go(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ho(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ho(e,n):{rows:[],flatRows:[],rowsById:{}},J(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ho(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 go(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return mo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return vo(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return vo(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)}}}},go=(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=>go(e,a.id,n,r,o))};function ho(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=mo(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 mo(e,t){var n;return(n=t[e.id])!=null?n:!1}function vo(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()&&(mo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=vo(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const yo=/([0-9]+)/gm,af=(e,t,n)=>_i(Ct(e.getValue(n)).toLowerCase(),Ct(t.getValue(n)).toLowerCase()),lf=(e,t,n)=>_i(Ct(e.getValue(n)),Ct(t.getValue(n))),cf=(e,t,n)=>wo(Ct(e.getValue(n)).toLowerCase(),Ct(t.getValue(n)).toLowerCase()),uf=(e,t,n)=>wo(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},ff=(e,t,n)=>wo(e.getValue(n),t.getValue(n));function wo(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 _i(e,t){const n=e.split(yo).filter(Boolean),r=t.split(yo).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 yn={alphanumeric:af,alphanumericCaseSensitive:lf,text:cf,textCaseSensitive:uf,datetime:df,basic:ff},pf=[jd,Qd,Xd,Yd,Wd,Gd,ef,tf,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$e("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 yn.datetime;if(typeof s=="string"&&(r=!0,s.split(yo).length>1))return yn.alphanumeric}return r?yn.text:yn.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:yn[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())}},qd,nf,rf,of,sf,Jd];function gf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...pf,...(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=xt(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:Y(()=>[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}},J(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Y(()=>[o._getColumnDefs()],m=>{const p=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const b=Ud(o,w,y,h),S=w;return b.columns=S.columns?p(S.columns,b,y+1):[],b})};return p(m)},J(e,"debugColumns","getAllColumns")),getAllFlatColumns:Y(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),J(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Y(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),J(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Y(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},J(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 Fi(){return e=>Y(()=>[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=ro(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 hf(e,t,n){return n.options.filterFromLeafRows?mf(e,t,n):vf(e,t,n)}function mf(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=ro(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 vf(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=ro(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 yf(){return e=>Y(()=>[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 hf(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 Z(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 jd(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:Y(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Z(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Wd(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:Y(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(p=>p.getFlatColumns())]},Z(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Y(()=>[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]},Z(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Se="debugHeaders";function xi(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 Gd={createTable:e=>{e.getHeaderGroups=Y(()=>[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 Gn(t,[...a,...c,...u],e)},Z(e.options,Se,"getHeaderGroups")),e.getCenterHeaderGroups=Y(()=>[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")),Z(e.options,Se,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Y(()=>[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")},Z(e.options,Se,"getLeftHeaderGroups")),e.getRightHeaderGroups=Y(()=>[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")},Z(e.options,Se,"getRightHeaderGroups")),e.getFooterGroups=Y(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Z(e.options,Se,"getFooterGroups")),e.getLeftFooterGroups=Y(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Z(e.options,Se,"getLeftFooterGroups")),e.getCenterFooterGroups=Y(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Z(e.options,Se,"getCenterFooterGroups")),e.getRightFooterGroups=Y(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Z(e.options,Se,"getRightFooterGroups")),e.getFlatHeaders=Y(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Se,"getFlatHeaders")),e.getLeftFlatHeaders=Y(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Se,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Y(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Se,"getCenterFlatHeaders")),e.getRightFlatHeaders=Y(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Se,"getRightFlatHeaders")),e.getCenterLeafHeaders=Y(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Se,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Y(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Se,"getLeftLeafHeaders")),e.getRightLeafHeaders=Y(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Se,"getRightLeafHeaders")),e.getLeafHeaders=Y(()=>[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()},Z(e.options,Se,"getLeafHeaders"))}};function Gn(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],b=y.column.depth===v.depth;let S,E=!1;if(b&&y.column.parent?S=y.column.parent:(S=y.column,E=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(y);else{const C=xi(n,S,{id:[r,p,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${h.filter(P=>P.column===S).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)=>xi(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(S=>{let{colSpan:E,rowSpan:C}=S;h+=E,w.push(C)})):h=1;const b=Math.min(...w);return y=y+b,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 oo=(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:()=>Ud(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:Y(()=>[e.getAllLeafColumns()],u=>u.map(c=>jd(e,a,c,c.id)),Z(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Y(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),Z(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},qd={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()}}},Ci=(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))};Ci.autoRemove=e=>Ke(e);const Si=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Si.autoRemove=e=>Ke(e);const Ei=(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())};Ei.autoRemove=e=>Ke(e);const Ni=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Ni.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Ti=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Ti.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Pi=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Pi.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Ai=(e,t,n)=>e.getValue(t)===n;Ai.autoRemove=e=>Ke(e);const _i=(e,t,n)=>e.getValue(t)==n;_i.autoRemove=e=>Ke(e);const so=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};so.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]},so.autoRemove=e=>Ke(e)||Ke(e[0])&&Ke(e[1]);const ht={includesString:Ci,includesStringSensitive:Si,equalsString:Ei,arrIncludes:Ni,arrIncludesAll:Ti,arrIncludesSome:Pi,equals:Ai,weakEquals:_i,inNumberRange:so};function Ke(e){return e==null||e===""}const Kd={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Le("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"?ht.includesString:typeof r=="number"?ht.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ht.equals:Array.isArray(r)?ht.arrIncludes:ht.weakEquals},e.getFilterFn=()=>{var n,r;return Wn(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:ht[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=St(n,s?s.value:void 0);if(Fi(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=St(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Fi(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 Fi(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const io={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(!Hd(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},Xd={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:Le("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 io.sum;if(Object.prototype.toString.call(r)==="[object Date]")return io.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Wn(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:io[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 Jd(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 Yd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Le("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Y(n=>[yn(t,n)],n=>n.findIndex(r=>r.id===e.id),Z(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=yn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=yn(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=Y(()=>[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 Jd(s,n,r)},Z(e.options,"debugTable","_getOrderColumnsFn"))}},ao=()=>({left:[],right:[]}),Zd={getInitialState:e=>({columnPinning:ao(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Le("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=Y(()=>[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))},Z(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Y(()=>[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"})),Z(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Y(()=>[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"})),Z(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?ao():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:ao())},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=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Z(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Z(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Y(()=>[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))},Z(e.options,"debugColumns","getCenterLeafColumns"))}},qn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},lo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Qd={getDefaultColumnDef:()=>qn,getInitialState:e=>({columnSizing:{},columnSizingInfo:lo(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Le("columnSizing",e),onColumnSizingInfoChange:Le("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:qn.minSize,(r=s??e.columnDef.size)!=null?r:qn.size),(o=e.columnDef.maxSize)!=null?o:qn.maxSize)},e.getStart=Y(n=>[n,yn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Z(t.options,"debugColumns","getStart")),e.getAfter=Y(n=>[n,yn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Z(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(),co(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=co(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(S=>{var E,C;const P=t.options.columnResizeDirection==="rtl"?-1:1,_=(b-((E=S==null?void 0:S.startOffset)!=null?E:0))*P,O=Math.max(_/((C=S==null?void 0:S.startSize)!=null?C:0),-.999999);return S.columnSizingStart.forEach($=>{let[F,G]=$;c[F]=Math.round(Math.max(G+G*O,0)*100)/100}),{...S,deltaOffset:_,deltaPercentage:O}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},g=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(b=>({...b,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 b;p==null||p.removeEventListener("touchmove",h.moveHandler),p==null||p.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((b=w.touches[0])==null?void 0:b.clientX)}},y=ef()?{passive:!1}:!1;co(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?lo():(n=e.initialState.columnSizingInfo)!=null?n:lo())},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 Kn=null;function ef(){if(typeof Kn=="boolean")return Kn;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 Kn=e,Kn}function co(e){return e.type==="touchstart"}const tf={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Le("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=Y(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Z(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Y(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Z(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Y(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Z(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 yn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const nf={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()}}},rf={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Le("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=()=>ht.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Wn(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ht[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},of={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Le("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()}}}},uo=0,fo=10,po=()=>({pageIndex:uo,pageSize:fo}),sf={getInitialState:e=>({...e,pagination:{...po(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Le("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=>St(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?po():(o=e.initialState.pagination)!=null?o:po())},e.setPageIndex=r=>{e.setPagination(o=>{let s=St(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?uo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:uo)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?fo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:fo)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,St(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=St(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=Y(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Z(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}}},go=()=>({top:[],bottom:[]}),af={getInitialState:e=>({rowPinning:go(),...e}),getDefaultOptions:e=>({onRowPinningChange:Le("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?go():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:go())},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=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Z(e.options,"debugRows","getTopRows")),e.getBottomRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Z(e.options,"debugRows","getBottomRows")),e.getCenterRows=Y(()=>[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))},Z(e.options,"debugRows","getCenterRows"))}},lf={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Le("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=>{ho(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?mo(e,n):{rows:[],flatRows:[],rowsById:{}},Z(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?mo(e,n):{rows:[],flatRows:[],rowsById:{}},Z(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?mo(e,n):{rows:[],flatRows:[],rowsById:{}},Z(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 ho(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return vo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return yo(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return yo(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)}}}},ho=(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=>ho(e,a.id,n,r,o))};function mo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=vo(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 vo(e,t){var n;return(n=t[e.id])!=null?n:!1}function yo(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()&&(vo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=yo(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const wo=/([0-9]+)/gm,cf=(e,t,n)=>Oi(Et(e.getValue(n)).toLowerCase(),Et(t.getValue(n)).toLowerCase()),uf=(e,t,n)=>Oi(Et(e.getValue(n)),Et(t.getValue(n))),df=(e,t,n)=>bo(Et(e.getValue(n)).toLowerCase(),Et(t.getValue(n)).toLowerCase()),ff=(e,t,n)=>bo(Et(e.getValue(n)),Et(t.getValue(n))),pf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},gf=(e,t,n)=>bo(e.getValue(n),t.getValue(n));function bo(e,t){return e===t?0:e>t?1:-1}function Et(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Oi(e,t){const n=e.split(wo).filter(Boolean),r=t.split(wo).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 wn={alphanumeric:cf,alphanumericCaseSensitive:uf,text:df,textCaseSensitive:ff,datetime:pf,basic:gf},hf=[Gd,tf,Yd,Zd,qd,Kd,nf,rf,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Le("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 wn.datetime;if(typeof s=="string"&&(r=!0,s.split(wo).length>1))return wn.alphanumeric}return r?wn.text:wn.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 Wn(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:wn[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())}},Xd,of,sf,af,lf,Qd];function mf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...hf,...(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=St(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:Y(()=>[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}},Z(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Y(()=>[o._getColumnDefs()],m=>{const p=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const b=Wd(o,w,y,h),S=w;return b.columns=S.columns?p(S.columns,b,y+1):[],b})};return p(m)},Z(e,"debugColumns","getAllColumns")),getAllFlatColumns:Y(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),Z(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Y(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),Z(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Y(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},Z(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 Di(){return e=>Y(()=>[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=oo(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},Z(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function vf(e,t,n){return n.options.filterFromLeafRows?yf(e,t,n):wf(e,t,n)}function yf(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=oo(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 wf(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=oo(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 bf(){return e=>Y(()=>[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 vf(t.rows,g,e)},Z(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
|
|
14
14
|
* react-table
|
|
15
15
|
*
|
|
16
16
|
* Copyright (c) TanStack
|
|
@@ -19,78 +19,83 @@
|
|
|
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?wf(e)?d.createElement(e,t):e:null}function wf(e){return bf(e)||typeof e=="function"||xf(e)}function bf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function xf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Oi(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:gf(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 Di(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cf}=Object.prototype,{getPrototypeOf:bo}=Object,Kn=(e=>t=>{const n=Cf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qe=e=>(e=e.toLowerCase(),t=>Kn(t)===e),Xn=e=>t=>typeof t===e,{isArray:Kt}=Array,wn=Xn("undefined");function Sf(e){return e!==null&&!wn(e)&&e.constructor!==null&&!wn(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mi=qe("ArrayBuffer");function Ef(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mi(e.buffer),t}const Nf=Xn("string"),Ie=Xn("function"),ki=Xn("number"),Yn=e=>e!==null&&typeof e=="object",Tf=e=>e===!0||e===!1,Jn=e=>{if(Kn(e)!=="object")return!1;const t=bo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Pf=qe("Date"),Af=qe("File"),_f=qe("Blob"),Ff=qe("FileList"),Of=e=>Yn(e)&&Ie(e.pipe),Df=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ie(e.append)&&((t=Kn(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},Mf=qe("URLSearchParams"),[kf,$f,If,Lf]=["ReadableStream","Request","Response","Headers"].map(qe),Rf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Kt(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 $i(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 Vt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ii=e=>!wn(e)&&e!==Vt;function xo(){const{caseless:e}=Ii(this)&&this||{},t={},n=(r,o)=>{const s=e&&$i(t,o)||o;Jn(t[s])&&Jn(r)?t[s]=xo(t[s],r):Jn(r)?t[s]=xo({},r):Kt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&bn(arguments[r],n);return t}const Vf=(e,t,n,{allOwnKeys:r}={})=>(bn(t,(o,s)=>{n&&Ie(o)?e[s]=Di(o,n):e[s]=o},{allOwnKeys:r}),e),Bf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),zf=(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)},Hf=(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&&bo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Uf=(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},jf=e=>{if(!e)return null;if(Kt(e))return e;let t=e.length;if(!ki(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Wf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&bo(Uint8Array)),Gf=(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])}},qf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Kf=qe("HTMLFormElement"),Xf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Li=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Yf=qe("RegExp"),Ri=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Jf=e=>{Ri(e,(t,n)=>{if(Ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ie(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+"'")})}})},Zf=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Kt(e)?r(e):r(String(e).split(t)),n},Qf=()=>{},ep=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Co="abcdefghijklmnopqrstuvwxyz",Vi="0123456789",Bi={DIGIT:Vi,ALPHA:Co,ALPHA_DIGIT:Co+Co.toUpperCase()+Vi},tp=(e=16,t=Bi.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function np(e){return!!(e&&Ie(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const rp=e=>{const t=new Array(10),n=(r,o)=>{if(Yn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Kt(r)?[]:{};return bn(r,(i,a)=>{const u=n(i,o+1);!wn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},op=qe("AsyncFunction"),sp=e=>e&&(Yn(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),zi=((e,t)=>e?setImmediate:t?((n,r)=>(Vt.addEventListener("message",({source:o,data:s})=>{o===Vt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Vt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ie(Vt.postMessage)),ip=typeof queueMicrotask<"u"?queueMicrotask.bind(Vt):typeof process<"u"&&process.nextTick||zi,T={isArray:Kt,isArrayBuffer:Mi,isBuffer:Sf,isFormData:Df,isArrayBufferView:Ef,isString:Nf,isNumber:ki,isBoolean:Tf,isObject:Yn,isPlainObject:Jn,isReadableStream:kf,isRequest:$f,isResponse:If,isHeaders:Lf,isUndefined:wn,isDate:Pf,isFile:Af,isBlob:_f,isRegExp:Yf,isFunction:Ie,isStream:Of,isURLSearchParams:Mf,isTypedArray:Wf,isFileList:Ff,forEach:bn,merge:xo,extend:Vf,trim:Rf,stripBOM:Bf,inherits:zf,toFlatObject:Hf,kindOf:Kn,kindOfTest:qe,endsWith:Uf,toArray:jf,forEachEntry:Gf,matchAll:qf,isHTMLForm:Kf,hasOwnProperty:Li,hasOwnProp:Li,reduceDescriptors:Ri,freezeMethods:Jf,toObjectSet:Zf,toCamelCase:Xf,noop:Qf,toFiniteNumber:ep,findKey:$i,global:Vt,isContextDefined:Ii,ALPHABET:Bi,generateString:tp,isSpecCompliantForm:np,toJSONObject:rp,isAsyncFn:op,isThenable:sp,setImmediate:zi,asap:ip};function te(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)}T.inherits(te,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:T.toJSONObject(this.config),code:this.code,status:this.status}}});const Hi=te.prototype,Ui={};["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=>{Ui[e]={value:e}}),Object.defineProperties(te,Ui),Object.defineProperty(Hi,"isAxiosError",{value:!0}),te.from=(e,t,n,r,o,s)=>{const i=Object.create(Hi);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),te.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 So(e){return T.isPlainObject(e)||T.isArray(e)}function ji(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Wi(e,t,n){return e?e.concat(t).map(function(o,s){return o=ji(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function lp(e){return T.isArray(e)&&!e.some(So)}const cp=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Zn(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!T.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(T.isDate(v))return v.toISOString();if(!u&&T.isBlob(v))throw new te("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(v)||T.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(T.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&lp(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=ji(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?Wi([h],E,s):i===null?h:h+"[]",c(S))}),!1}return So(v)?!0:(t.append(Wi(y,h,s),c(v)),!1)}const g=[],m=Object.assign(cp,{defaultVisitor:f,convertValue:c,isVisitable:So});function p(v,h){if(!T.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));g.push(v),T.forEach(v,function(w,b){(!(T.isUndefined(w)||w===null)&&o.call(t,w,T.isString(b)?b.trim():b,h,m))===!0&&p(w,h?h.concat(b):[b])}),g.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Gi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Eo(e,t){this._pairs=[],e&&Zn(e,this,t)}const qi=Eo.prototype;qi.append=function(t,n){this._pairs.push([t,n])},qi.toString=function(t){const n=t?function(r){return t.call(this,r,Gi)}:Gi;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function up(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ki(e,t,n){if(!t)return e;const r=n&&n.encode||up;T.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=T.isURLSearchParams(t)?t.toString():new Eo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Xi{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){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Yi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Eo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},No=typeof window<"u"&&typeof document<"u",To=typeof navigator=="object"&&navigator||void 0,fp=No&&(!To||["ReactNative","NativeScript","NS"].indexOf(To.product)<0),pp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",gp=No&&window.location.href||"http://localhost",Ne={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:No,hasStandardBrowserEnv:fp,hasStandardBrowserWebWorkerEnv:pp,navigator:To,origin:gp},Symbol.toStringTag,{value:"Module"})),...dp};function hp(e,t){return Zn(e,new Ne.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Ne.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function mp(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vp(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 Ji(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&&T.isArray(o)?o.length:i,u?(T.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!T.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&T.isArray(o[i])&&(o[i]=vp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(mp(r),o,n,0)}),n}return null}function yp(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const xn={transitional:Yi,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=T.isObject(t);if(s&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return o?JSON.stringify(Ji(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.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 hp(t,this.formSerializer).toString();if((a=T.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),yp(t)):t}],transformResponse:[function(t){const n=this.transitional||xn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&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"?te.from(a,te.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:Ne.classes.FormData,Blob:Ne.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{xn.headers[e]={}});const wp=T.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"]),bp=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[Zi]=this[Zi]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Cn(i);r[a]||(Ep(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(_e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(_e);function Ao(e,t){const n=this||xn,r=t||n,o=_e.from(r.headers);let s=r.data;return T.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Qi(e){return!!(e&&e.__CANCEL__)}function Xt(e,t,n){te.call(this,e??"canceled",te.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Xt,te,{__CANCEL__:!0});function ea(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new te("Request failed with status code "+n.status,[te.ERR_BAD_REQUEST,te.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Np(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Tp(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 Pp(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=Tp(50,250);return Pp(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)},ta=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},na=e=>(...t)=>T.asap(()=>e(...t)),Ap=Ne.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ne.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ne.origin),Ne.navigator&&/(msie|trident)/i.test(Ne.navigator.userAgent)):()=>!0,_p=Ne.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),T.isString(r)&&i.push("path="+r),T.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 Fp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Op(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ra(e,t){return e&&!Fp(t)?Op(e,t):t}const oa=e=>e instanceof _e?{...e}:e;function Bt(e,t){t=t||{};const n={};function r(c,f,g,m){return T.isPlainObject(c)&&T.isPlainObject(f)?T.merge.call({caseless:m},c,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function o(c,f,g,m){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,g,m)}else return r(c,f,g,m)}function s(c,f){if(!T.isUndefined(f))return r(void 0,f)}function i(c,f){if(T.isUndefined(f)){if(!T.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(oa(c),oa(f),g,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,m=g(e[f],t[f],f);T.isUndefined(m)&&g!==a||(n[f]=m)}),n}const sa=e=>{const t=Bt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=_e.from(i),t.url=Ki(ra(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(T.isFormData(n)){if(Ne.hasStandardBrowserEnv||Ne.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(Ne.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Ap(t.url))){const c=o&&s&&_p.read(s);c&&i.set(o,c)}return t},Dp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=sa(e);let s=o.data;const i=_e.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 S=_e.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};ea(function(_){n(_),h()},function(_){r(_),h()},x),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 te("Request aborted",te.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new te("Network Error",te.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const x=o.transitional||Yi;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new te(E,x.clarifyTimeoutError?te.ETIMEDOUT:te.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&T.forEach(i.toJSON(),function(E,x){y.setRequestHeader(x,E)}),T.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([m,v]=er(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=er(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new Xt(null,e,y):S),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const b=Np(o.url);if(b&&Ne.protocols.indexOf(b)===-1){r(new te("Unsupported protocol "+b+":",te.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Mp=(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 te?f:new Xt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new te(`timeout ${t} of ms exceeded`,te.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=()=>T.asap(a),u}},kp=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},$p=async function*(e,t){for await(const n of Ip(e))yield*kp(n,t)},Ip=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()}},ia=(e,t,n,r)=>{const o=$p(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})},tr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",aa=tr&&typeof ReadableStream=="function",Lp=tr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),la=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Rp=aa&&la(()=>{let e=!1;const t=new Request(Ne.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ca=64*1024,_o=aa&&la(()=>T.isReadableStream(new Response("").body)),nr={stream:_o&&(e=>e.body)};tr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!nr[t]&&(nr[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new te(`Response type '${t}' is not supported`,te.ERR_NOT_SUPPORT,r)})})})(new Response);const Vp=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Ne.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await Lp(e)).byteLength},Bp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Vp(t)},Fo={http:ap,xhr:Dp,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:m}=sa(e);c=c?(c+"").toLowerCase():"text";let p=Mp([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Rp&&n!=="get"&&n!=="head"&&(y=await Bp(f,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),P;if(T.isFormData(r)&&(P=x.headers.get("content-type"))&&f.setContentType(P),x.body){const[_,O]=ta(y,er(na(u)));r=ia(x.body,ca,_,O)}}T.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 b=await fetch(v);const S=_o&&(c==="stream"||c==="response");if(_o&&(a||S&&h)){const x={};["status","statusText","headers"].forEach(k=>{x[k]=b[k]});const P=T.toFiniteNumber(b.headers.get("content-length")),[_,O]=a&&ta(P,er(na(a),!0))||[];b=new Response(ia(b.body,ca,_,()=>{O&&O(),h&&h()}),x)}c=c||"text";let E=await nr[T.findKey(nr,c)||"text"](b,e);return!S&&h&&h(),await new Promise((x,P)=>{ea(x,P,{data:E,headers:_e.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:v})})}catch(w){throw h&&h(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new te("Network Error",te.ERR_NETWORK,e,v),{cause:w.cause||w}):te.from(w,w&&w.code,e,v)}})};T.forEach(Fo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ua=e=>`- ${e}`,zp=e=>T.isFunction(e)||e===null||e===!1,da={getAdapter:e=>{e=T.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,!zp(n)&&(r=Fo[(i=String(n)).toLowerCase()],r===void 0))throw new te(`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=Bt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&
|
|
22
|
+
*/function Xn(e,t){return e?xf(e)?d.createElement(e,t):e:null}function xf(e){return Cf(e)||typeof e=="function"||Sf(e)}function Cf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Sf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Mi(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:mf(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 Ii(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ef}=Object.prototype,{getPrototypeOf:xo}=Object,Jn=(e=>t=>{const n=Ef.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xe=e=>(e=e.toLowerCase(),t=>Jn(t)===e),Yn=e=>t=>typeof t===e,{isArray:Kt}=Array,bn=Yn("undefined");function Nf(e){return e!==null&&!bn(e)&&e.constructor!==null&&!bn(e.constructor)&&Re(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $i=Xe("ArrayBuffer");function Tf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$i(e.buffer),t}const Pf=Yn("string"),Re=Yn("function"),ki=Yn("number"),Zn=e=>e!==null&&typeof e=="object",Af=e=>e===!0||e===!1,Qn=e=>{if(Jn(e)!=="object")return!1;const t=xo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},_f=Xe("Date"),Ff=Xe("File"),Of=Xe("Blob"),Df=Xe("FileList"),Mf=e=>Zn(e)&&Re(e.pipe),If=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Re(e.append)&&((t=Jn(e))==="formdata"||t==="object"&&Re(e.toString)&&e.toString()==="[object FormData]"))},$f=Xe("URLSearchParams"),[kf,Lf,Rf,Vf]=["ReadableStream","Request","Response","Headers"].map(Xe),Bf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function xn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Kt(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 Li(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 Vt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ri=e=>!bn(e)&&e!==Vt;function Co(){const{caseless:e}=Ri(this)&&this||{},t={},n=(r,o)=>{const s=e&&Li(t,o)||o;Qn(t[s])&&Qn(r)?t[s]=Co(t[s],r):Qn(r)?t[s]=Co({},r):Kt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&xn(arguments[r],n);return t}const zf=(e,t,n,{allOwnKeys:r}={})=>(xn(t,(o,s)=>{n&&Re(o)?e[s]=Ii(o,n):e[s]=o},{allOwnKeys:r}),e),Hf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Uf=(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)},jf=(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&&xo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Wf=(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},Gf=e=>{if(!e)return null;if(Kt(e))return e;let t=e.length;if(!ki(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},qf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&xo(Uint8Array)),Kf=(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])}},Xf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Jf=Xe("HTMLFormElement"),Yf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Vi=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Zf=Xe("RegExp"),Bi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};xn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Qf=e=>{Bi(e,(t,n)=>{if(Re(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Re(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+"'")})}})},ep=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Kt(e)?r(e):r(String(e).split(t)),n},tp=()=>{},np=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,So="abcdefghijklmnopqrstuvwxyz",zi="0123456789",Hi={DIGIT:zi,ALPHA:So,ALPHA_DIGIT:So+So.toUpperCase()+zi},rp=(e=16,t=Hi.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function op(e){return!!(e&&Re(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const sp=e=>{const t=new Array(10),n=(r,o)=>{if(Zn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Kt(r)?[]:{};return xn(r,(i,a)=>{const u=n(i,o+1);!bn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},ip=Xe("AsyncFunction"),ap=e=>e&&(Zn(e)||Re(e))&&Re(e.then)&&Re(e.catch),Ui=((e,t)=>e?setImmediate:t?((n,r)=>(Vt.addEventListener("message",({source:o,data:s})=>{o===Vt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Vt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Re(Vt.postMessage)),lp=typeof queueMicrotask<"u"?queueMicrotask.bind(Vt):typeof process<"u"&&process.nextTick||Ui,T={isArray:Kt,isArrayBuffer:$i,isBuffer:Nf,isFormData:If,isArrayBufferView:Tf,isString:Pf,isNumber:ki,isBoolean:Af,isObject:Zn,isPlainObject:Qn,isReadableStream:kf,isRequest:Lf,isResponse:Rf,isHeaders:Vf,isUndefined:bn,isDate:_f,isFile:Ff,isBlob:Of,isRegExp:Zf,isFunction:Re,isStream:Mf,isURLSearchParams:$f,isTypedArray:qf,isFileList:Df,forEach:xn,merge:Co,extend:zf,trim:Bf,stripBOM:Hf,inherits:Uf,toFlatObject:jf,kindOf:Jn,kindOfTest:Xe,endsWith:Wf,toArray:Gf,forEachEntry:Kf,matchAll:Xf,isHTMLForm:Jf,hasOwnProperty:Vi,hasOwnProp:Vi,reduceDescriptors:Bi,freezeMethods:Qf,toObjectSet:ep,toCamelCase:Yf,noop:tp,toFiniteNumber:np,findKey:Li,global:Vt,isContextDefined:Ri,ALPHABET:Hi,generateString:rp,isSpecCompliantForm:op,toJSONObject:sp,isAsyncFn:ip,isThenable:ap,setImmediate:Ui,asap:lp};function ne(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)}T.inherits(ne,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:T.toJSONObject(this.config),code:this.code,status:this.status}}});const ji=ne.prototype,Wi={};["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=>{Wi[e]={value:e}}),Object.defineProperties(ne,Wi),Object.defineProperty(ji,"isAxiosError",{value:!0}),ne.from=(e,t,n,r,o,s)=>{const i=Object.create(ji);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),ne.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const cp=null;function Eo(e){return T.isPlainObject(e)||T.isArray(e)}function Gi(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function qi(e,t,n){return e?e.concat(t).map(function(o,s){return o=Gi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function up(e){return T.isArray(e)&&!e.some(Eo)}const dp=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function er(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!T.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(T.isDate(v))return v.toISOString();if(!u&&T.isBlob(v))throw new ne("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(v)||T.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(T.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&up(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=Gi(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?qi([h],E,s):i===null?h:h+"[]",c(S))}),!1}return Eo(v)?!0:(t.append(qi(y,h,s),c(v)),!1)}const g=[],m=Object.assign(dp,{defaultVisitor:f,convertValue:c,isVisitable:Eo});function p(v,h){if(!T.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));g.push(v),T.forEach(v,function(w,b){(!(T.isUndefined(w)||w===null)&&o.call(t,w,T.isString(b)?b.trim():b,h,m))===!0&&p(w,h?h.concat(b):[b])}),g.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Ki(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function No(e,t){this._pairs=[],e&&er(e,this,t)}const Xi=No.prototype;Xi.append=function(t,n){this._pairs.push([t,n])},Xi.toString=function(t){const n=t?function(r){return t.call(this,r,Ki)}:Ki;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function fp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ji(e,t,n){if(!t)return e;const r=n&&n.encode||fp;T.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=T.isURLSearchParams(t)?t.toString():new No(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Yi{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){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Zi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:No,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},To=typeof window<"u"&&typeof document<"u",Po=typeof navigator=="object"&&navigator||void 0,gp=To&&(!Po||["ReactNative","NativeScript","NS"].indexOf(Po.product)<0),hp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",mp=To&&window.location.href||"http://localhost",Ee={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:To,hasStandardBrowserEnv:gp,hasStandardBrowserWebWorkerEnv:hp,navigator:Po,origin:mp},Symbol.toStringTag,{value:"Module"})),...pp};function vp(e,t){return er(e,new Ee.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Ee.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function yp(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wp(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 Qi(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&&T.isArray(o)?o.length:i,u?(T.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!T.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&T.isArray(o[i])&&(o[i]=wp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(yp(r),o,n,0)}),n}return null}function bp(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Cn={transitional:Zi,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=T.isObject(t);if(s&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return o?JSON.stringify(Qi(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.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 vp(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return er(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),bp(t)):t}],transformResponse:[function(t){const n=this.transitional||Cn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&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"?ne.from(a,ne.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:Ee.classes.FormData,Blob:Ee.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{Cn.headers[e]={}});const xp=T.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"]),Cp=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]&&xp[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ea=Symbol("internals");function Sn(e){return e&&String(e).trim().toLowerCase()}function tr(e){return e===!1||e==null?e:T.isArray(e)?e.map(tr):String(e)}function Sp(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 Ep=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ao(e,t,n,r,o){if(T.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function Np(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Tp(e,t){const n=T.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 Fe{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=Sn(u);if(!f)throw new Error("header name must be a non-empty string");const g=T.findKey(o,f);(!g||o[g]===void 0||c===!0||c===void 0&&o[g]!==!1)&&(o[g||u]=tr(a))}const i=(a,u)=>T.forEach(a,(c,f)=>s(c,f,u));if(T.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(T.isString(t)&&(t=t.trim())&&!Ep(t))i(Cp(t),n);else if(T.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=Sn(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Sp(o);if(T.isFunction(n))return n.call(this,o,r);if(T.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Sn(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ao(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Sn(i),i){const a=T.findKey(r,i);a&&(!n||Ao(r,r[a],a,n))&&(delete r[a],o=!0)}}return T.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||Ao(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return T.forEach(this,(o,s)=>{const i=T.findKey(r,s);if(i){n[i]=tr(o),delete n[s];return}const a=t?Np(s):String(s).trim();a!==s&&delete n[s],n[a]=tr(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&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[ea]=this[ea]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Sn(i);r[a]||(Tp(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}Fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(Fe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(Fe);function _o(e,t){const n=this||Cn,r=t||n,o=Fe.from(r.headers);let s=r.data;return T.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function ta(e){return!!(e&&e.__CANCEL__)}function Xt(e,t,n){ne.call(this,e??"canceled",ne.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Xt,ne,{__CANCEL__:!0});function na(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ne("Request failed with status code "+n.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Pp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Ap(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 _p(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 nr=(e,t,n=3)=>{let r=0;const o=Ap(50,250);return _p(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)},ra=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},oa=e=>(...t)=>T.asap(()=>e(...t)),Fp=Ee.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ee.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ee.origin),Ee.navigator&&/(msie|trident)/i.test(Ee.navigator.userAgent)):()=>!0,Op=Ee.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),T.isString(r)&&i.push("path="+r),T.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 Dp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Mp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function sa(e,t){return e&&!Dp(t)?Mp(e,t):t}const ia=e=>e instanceof Fe?{...e}:e;function Bt(e,t){t=t||{};const n={};function r(c,f,g,m){return T.isPlainObject(c)&&T.isPlainObject(f)?T.merge.call({caseless:m},c,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function o(c,f,g,m){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,g,m)}else return r(c,f,g,m)}function s(c,f){if(!T.isUndefined(f))return r(void 0,f)}function i(c,f){if(T.isUndefined(f)){if(!T.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(ia(c),ia(f),g,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,m=g(e[f],t[f],f);T.isUndefined(m)&&g!==a||(n[f]=m)}),n}const aa=e=>{const t=Bt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Fe.from(i),t.url=Ji(sa(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(T.isFormData(n)){if(Ee.hasStandardBrowserEnv||Ee.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(Ee.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Fp(t.url))){const c=o&&s&&Op.read(s);c&&i.set(o,c)}return t},Ip=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=aa(e);let s=o.data;const i=Fe.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 S=Fe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};na(function(_){n(_),h()},function(_){r(_),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 ne("Request aborted",ne.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new ne("Network Error",ne.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Zi;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new ne(E,C.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&T.forEach(i.toJSON(),function(E,C){y.setRequestHeader(C,E)}),T.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([m,v]=nr(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=nr(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new Xt(null,e,y):S),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const b=Pp(o.url);if(b&&Ee.protocols.indexOf(b)===-1){r(new ne("Unsupported protocol "+b+":",ne.ERR_BAD_REQUEST,e));return}y.send(s||null)})},$p=(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 ne?f:new Xt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new ne(`timeout ${t} of ms exceeded`,ne.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=()=>T.asap(a),u}},kp=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},Lp=async function*(e,t){for await(const n of Rp(e))yield*kp(n,t)},Rp=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()}},la=(e,t,n,r)=>{const o=Lp(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})},rr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ca=rr&&typeof ReadableStream=="function",Vp=rr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ua=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Bp=ca&&ua(()=>{let e=!1;const t=new Request(Ee.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),da=64*1024,Fo=ca&&ua(()=>T.isReadableStream(new Response("").body)),or={stream:Fo&&(e=>e.body)};rr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!or[t]&&(or[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ne(`Response type '${t}' is not supported`,ne.ERR_NOT_SUPPORT,r)})})})(new Response);const zp=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Ee.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await Vp(e)).byteLength},Hp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??zp(t)},Oo={http:cp,xhr:Ip,fetch:rr&&(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}=aa(e);c=c?(c+"").toLowerCase():"text";let p=$p([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Bp&&n!=="get"&&n!=="head"&&(y=await Hp(f,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),P;if(T.isFormData(r)&&(P=C.headers.get("content-type"))&&f.setContentType(P),C.body){const[_,O]=ra(y,nr(oa(u)));r=la(C.body,da,_,O)}}T.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 b=await fetch(v);const S=Fo&&(c==="stream"||c==="response");if(Fo&&(a||S&&h)){const C={};["status","statusText","headers"].forEach($=>{C[$]=b[$]});const P=T.toFiniteNumber(b.headers.get("content-length")),[_,O]=a&&ra(P,nr(oa(a),!0))||[];b=new Response(la(b.body,da,_,()=>{O&&O(),h&&h()}),C)}c=c||"text";let E=await or[T.findKey(or,c)||"text"](b,e);return!S&&h&&h(),await new Promise((C,P)=>{na(C,P,{data:E,headers:Fe.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:v})})}catch(w){throw h&&h(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new ne("Network Error",ne.ERR_NETWORK,e,v),{cause:w.cause||w}):ne.from(w,w&&w.code,e,v)}})};T.forEach(Oo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const fa=e=>`- ${e}`,Up=e=>T.isFunction(e)||e===null||e===!1,pa={getAdapter:e=>{e=T.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,!Up(n)&&(r=Oo[(i=String(n)).toLowerCase()],r===void 0))throw new ne(`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(fa).join(`
|
|
26
|
+
`):" "+fa(s[0]):"as no adapter specified";throw new ne("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Oo};function Do(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xt(null,e)}function ga(e){return Do(e),e.headers=Fe.from(e.headers),e.data=_o.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pa.getAdapter(e.adapter||Cn.adapter)(e).then(function(r){return Do(e),r.data=_o.call(e,e.transformResponse,r),r.headers=Fe.from(r.headers),r},function(r){return ta(r)||(Do(e),r&&r.response&&(r.response.data=_o.call(e,e.transformResponse,r.response),r.response.headers=Fe.from(r.response.headers))),Promise.reject(r)})}const ha="1.7.9",sr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{sr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ma={};sr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+ha+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new ne(o(i," has been removed"+(n?" in "+n:"")),ne.ERR_DEPRECATED);return n&&!ma[i]&&(ma[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}},sr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function jp(e,t,n){if(typeof e!="object")throw new ne("options must be an object",ne.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 ne("option "+s+" must be "+u,ne.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ne("Unknown option "+s,ne.ERR_BAD_OPTION)}}const ir={assertOptions:jp,validators:sr},nt=ir.validators;class zt{constructor(t){this.defaults=t,this.interceptors={request:new Yi,response:new Yi}}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=Bt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ir.assertOptions(r,{silentJSONParsing:nt.transitional(nt.boolean),forcedJSONParsing:nt.transitional(nt.boolean),clarifyTimeoutError:nt.transitional(nt.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:ir.assertOptions(o,{encode:nt.function,serialize:nt.function},!0)),ir.assertOptions(n,{baseUrl:nt.spelling("baseURL"),withXsrfToken:nt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&T.merge(s.common,s[n.method]);s&&T.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=Fe.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=[ga.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=ga.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=Bt(this.defaults,t);const n=sa(t.baseURL,t.url);return Ji(n,t.params,t.paramsSerializer)}}T.forEach(["delete","get","head","options"],function(t){zt.prototype[t]=function(n,r){return this.request(Bt(r||{},{method:t,url:n,data:(r||{}).data}))}}),T.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Bt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}zt.prototype[t]=n(),zt.prototype[t+"Form"]=n(!0)});class Mo{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 Xt(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 Mo(function(o){t=o}),cancel:t}}}function Wp(e){return function(n){return e.apply(null,n)}}function Gp(e){return T.isObject(e)&&e.isAxiosError===!0}const Io={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(Io).forEach(([e,t])=>{Io[t]=e});function va(e){const t=new zt(e),n=Ii(zt.prototype.request,t);return T.extend(n,zt.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return va(Bt(e,o))},n}const ie=va(Cn);ie.Axios=zt,ie.CanceledError=Xt,ie.CancelToken=Mo,ie.isCancel=ta,ie.VERSION=ha,ie.toFormData=er,ie.AxiosError=ne,ie.Cancel=ie.CanceledError,ie.all=function(t){return Promise.all(t)},ie.spread=Wp,ie.isAxiosError=Gp,ie.mergeConfig=Bt,ie.AxiosHeaders=Fe,ie.formToJSON=e=>Qi(T.isHTMLForm(e)?new FormData(e):e),ie.getAdapter=pa.getAdapter,ie.HttpStatusCode=Io,ie.default=ie;/**
|
|
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 qp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ya=(...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 Kp={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 Xp=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>D.createElement("svg",{ref:u,...Kp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ya("lucide",o),...a},[...i.map(([c,f])=>D.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 rt=(e,t)=>{const n=D.forwardRef(({className:r,...o},s)=>D.createElement(Xp,{ref:s,iconNode:t,className:ya(`lucide-${qp(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 Jp=rt("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 Yp=rt("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 Zp=rt("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 wa=rt("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 Qp=rt("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 eg=rt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
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 ve=rt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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
|
|
87
|
+
*/const tg=rt("PenOff",[["path",{d:"m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982",key:"bjo8r8"}],["path",{d:"m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353",key:"16h5ne"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
88
88
|
* @license lucide-react v0.468.0 - ISC
|
|
89
89
|
*
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const ko=dt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ya(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function eg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ya(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():ya(e[o],null)}}}}var Yt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(tg);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($o,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx($o,{...r,ref:t,children:n})});Yt.displayName="Slot";var $o=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=rg(n);return d.cloneElement(n,{...ng(r,n.props),ref:t?eg(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});$o.displayName="SlotClone";var wa=({children:e})=>l.jsx(l.Fragment,{children:e});function tg(e){return d.isValidElement(e)&&e.type===wa}function ng(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 rg(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 ba(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=ba(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function xa(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ba(e))&&(r&&(r+=" "),r+=t);return r}const Io="-",og=e=>{const t=ig(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Io);return a[0]===""&&a.length!==1&&a.shift(),Ca(a,t)||sg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},Ca=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ca(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Io);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Sa=/^\[(.+)\]$/,sg=e=>{if(Sa.test(e)){const t=Sa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ig=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return lg(Object.entries(e.classGroups),n).forEach(([s,i])=>{Lo(i,r,s,t)}),r},Lo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ea(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ag(o)){Lo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Lo(i,Ea(t,s),n,r)})})},Ea=(e,t)=>{let n=e;return t.split(Io).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ag=e=>e.isThemeGetter,lg=(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,cg=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)}}},Na="!",ug=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(Na),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},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},fg=e=>({cache:cg(e.cacheSize),parseClassName:ug(e),...og(e)}),pg=/\s+/,gg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(pg);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=dg(f).join(":"),w=g?y+Na:y,b=w+h;if(s.includes(b))continue;s.push(b);const S=o(h,v);for(let E=0;E<S.length;++E){const x=S[E];s.push(w+x)}a=c+(a.length>0?" "+a:a)}return a};function hg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ta(t))&&(r&&(r+=" "),r+=n);return r}const Ta=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ta(e[r]))&&(n&&(n+=" "),n+=t);return n};function mg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=fg(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=gg(u,n);return o(u,f),f}return function(){return s(hg.apply(null,arguments))}}const ce=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Pa=/^\[(?:([a-z-]+):)?(.+)\]$/i,vg=/^\d+\/\d+$/,yg=new Set(["px","full","screen"]),wg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bg=/\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$/,xg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Cg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Sg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ft=e=>Jt(e)||yg.has(e)||vg.test(e),St=e=>Zt(e,"length",Og),Jt=e=>!!e&&!Number.isNaN(Number(e)),Ro=e=>Zt(e,"number",Jt),Sn=e=>!!e&&Number.isInteger(Number(e)),Eg=e=>e.endsWith("%")&&Jt(e.slice(0,-1)),re=e=>Pa.test(e),Et=e=>wg.test(e),Ng=new Set(["length","size","percentage"]),Tg=e=>Zt(e,Ng,Aa),Pg=e=>Zt(e,"position",Aa),Ag=new Set(["image","url"]),_g=e=>Zt(e,Ag,Mg),Fg=e=>Zt(e,"",Dg),En=()=>!0,Zt=(e,t,n)=>{const r=Pa.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Og=e=>bg.test(e)&&!xg.test(e),Aa=()=>!1,Dg=e=>Cg.test(e),Mg=e=>Sg.test(e),kg=mg(()=>{const e=ce("colors"),t=ce("spacing"),n=ce("blur"),r=ce("brightness"),o=ce("borderColor"),s=ce("borderRadius"),i=ce("borderSpacing"),a=ce("borderWidth"),u=ce("contrast"),c=ce("grayscale"),f=ce("hueRotate"),g=ce("invert"),m=ce("gap"),p=ce("gradientColorStops"),v=ce("gradientColorStopPositions"),h=ce("inset"),y=ce("margin"),w=ce("opacity"),b=ce("padding"),S=ce("saturate"),E=ce("scale"),x=ce("sepia"),P=ce("skew"),_=ce("space"),O=ce("translate"),k=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",re,t],$=()=>[re,t],L=()=>["",ft,St],M=()=>["auto",Jt,re],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["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"],K=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",re],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],de=()=>[Jt,re];return{cacheSize:500,separator:":",theme:{colors:[En],spacing:[ft,St],blur:["none","",Et,re],brightness:de(),borderColor:[e],borderRadius:["none","","full",Et,re],borderSpacing:$(),borderWidth:L(),contrast:de(),grayscale:ne(),hueRotate:de(),invert:ne(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Eg,St],inset:G(),margin:G(),opacity:de(),padding:$(),saturate:de(),scale:de(),sepia:ne(),skew:de(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Et]}],"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:[...q(),re]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],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",Sn,re]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",Sn,re]}],"grid-cols":[{"grid-cols":[En]}],"col-start-end":[{col:["auto",{span:["full",Sn,re]},re]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[En]}],"row-start-end":[{row:["auto",{span:[Sn,re]},re]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[Et]},Et]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,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",Ro]}],"font-family":[{font:[En]}],"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",re]}],"line-clamp":[{"line-clamp":["none",Jt,Ro]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ft,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"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:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ft,St]}],"underline-offset":[{"underline-offset":["auto",ft,re]}],"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",re]}],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",re]}],"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:[...q(),Pg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Tg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_g]}],"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:[...W(),"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:W()}],"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:["",...W()]}],"outline-offset":[{"outline-offset":[ft,re]}],"outline-w":[{outline:[ft,St]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ft,St]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Et,Fg]}],"shadow-color":[{shadow:[En]}],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",Et,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[S]}],sepia:[{sepia:[x]}],"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":[S]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"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",re]}],duration:[{duration:de()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:de()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Sn,re]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],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",re]}],"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",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ft,St,Ro]}],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 kg(xa(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]}`},_a=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Z("s3-explr-ui-breadcrumb",e),...t}));_a.displayName="Breadcrumb";const Fa=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}));Fa.displayName="BreadcrumbList";const Vo=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}));Vo.displayName="BreadcrumbItem";const Bo=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Yt:"a";return l.jsx(o,{ref:r,className:Z("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Bo.displayName="BreadcrumbLink";const Ig=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}));Ig.displayName="BreadcrumbPage";const Oa=({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(va,{})});Oa.displayName="BreadcrumbSeparator";const Da=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ma=xa,zo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ma(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=Da(f)||Da(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 Ma(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},ka=zo("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"}}),ie=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Yt:"button";return l.jsx(i,{className:Z(ka({variant:t,size:n,className:e})),ref:s,...o})});ie.displayName="Button";function Lg(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function sr(...e){return t=>e.forEach(n=>Lg(n,t))}function ze(...e){return d.useCallback(sr(...e),e)}function Rg(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 Nt(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,Vg(o,...t)]}function Vg(...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 he(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 Pe(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 Qt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Bg({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Pe(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 Bg({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Pe(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function zg(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 Le=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function $a(e){const[t,n]=d.useState(void 0);return Le(()=>{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 Hg(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var en=e=>{const{present:t,children:n}=e,r=Ug(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ze(r.ref,jg(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};en.displayName="Presence";function Ug(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Hg(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]),Le(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=ir(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]),Le(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=ir(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=ir(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 ir(e){return(e==null?void 0:e.animationName)||"none"}function jg(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 Ia=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Gg);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(Ho,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ho,{...r,ref:t,children:n})});Ia.displayName="Slot";var Ho=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Kg(n);return d.cloneElement(n,{...qg(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ho.displayName="SlotClone";var Wg=({children:e})=>l.jsx(l.Fragment,{children:e});function Gg(e){return d.isValidElement(e)&&e.type===Wg}function qg(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 Kg(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 Xg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=Xg.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ia: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 La(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var Uo="Checkbox",[Yg,Xx]=Nt(Uo),[Jg,Zg]=Yg(Uo),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=ze(t,E=>p(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,b]=Qt({prop:o,defaultProp:s,onChange:c}),S=d.useRef(w);return d.useEffect(()=>{const E=m==null?void 0:m.form;if(E){const x=()=>b(S.current);return E.addEventListener("reset",x),()=>E.removeEventListener("reset",x)}},[m,b]),l.jsxs(Jg,{scope:n,state:w,disabled:a,children:[l.jsx(ve.button,{type:"button",role:"checkbox","aria-checked":Tt(w)?"mixed":w,"aria-required":i,"data-state":za(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:he(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:he(e.onClick,E=>{b(x=>Tt(x)?!0:!x),y&&(h.current=E.isPropagationStopped(),h.current||E.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:Tt(s)?!1:s})]})});Ra.displayName=Uo;var Va="CheckboxIndicator",Ba=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Zg(Va,n);return l.jsx(en,{present:r||Tt(s.state)||s.state===!0,children:l.jsx(ve.span,{"data-state":za(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ba.displayName=Va;var Qg=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=zg(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=Tt(n),p.call(f,Tt(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Tt(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 Tt(e){return e==="indeterminate"}function za(e){return Tt(e)?"indeterminate":e?"checked":"unchecked"}var Ha=Ra,eh=Ba;const jo=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(eh,{className:Z("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(Xp,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));jo.displayName=Ha.displayName;var th=d.useId||(()=>{}),nh=0;function tn(e){const[t,n]=d.useState(th());return Le(()=>{e||n(r=>r??String(nh++))},[e]),e||(t?`radix-${t}`:"")}function Ua(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(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 rh="DismissableLayer",Wo="dismissableLayer.update",oh="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",ja,Wa=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(Wa),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=ze(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),b=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=ah(_=>{const O=_.target,k=[...c.branches].some(F=>F.contains(O));!E||k||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=lh(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return Ua(_=>{b===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ja=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),qa(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ja)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),qa())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(Wo,_),()=>document.removeEventListener(Wo,_)},[]),l.jsx(ve.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:he(e.onFocusCapture,P.onFocusCapture),onBlurCapture:he(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:he(e.onPointerDownCapture,x.onPointerDownCapture)})});Go.displayName=rh;var ih="DismissableLayerBranch",Ga=d.forwardRef((e,t)=>{const n=d.useContext(Wa),r=d.useRef(null),o=ze(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})});Ga.displayName=ih;function ah(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Ka(oh,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 lh(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ka(sh,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 qa(){const e=new CustomEvent(Wo);document.dispatchEvent(e)}function Ka(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?La(o,s):o.dispatchEvent(s)}var ch=Go,uh=Ga,qo="focusScope.autoFocusOnMount",Ko="focusScope.autoFocusOnUnmount",Xa={bubbles:!1,cancelable:!0},dh="FocusScope",Ya=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Pe(o),f=Pe(s),g=d.useRef(null),m=ze(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(S){if(p.paused||!a)return;const E=S.target;a.contains(E)?g.current=E:Pt(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Pt(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&Pt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const b=new MutationObserver(w);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){Qa.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(qo,Xa);a.addEventListener(qo,c),a.dispatchEvent(w),w.defaultPrevented||(fh(vh(Ja(a)),{select:!0}),document.activeElement===h&&Pt(a))}return()=>{a.removeEventListener(qo,c),setTimeout(()=>{const w=new CustomEvent(Ko,Xa);a.addEventListener(Ko,f),a.dispatchEvent(w),w.defaultPrevented||Pt(h??document.body,{select:!0}),a.removeEventListener(Ko,f),Qa.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 b=h.currentTarget,[S,E]=ph(b);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&Pt(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&Pt(E,{select:!0})):w===b&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(ve.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Ya.displayName=dh;function fh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pt(r,{select:t}),document.activeElement!==n)return}function ph(e){const t=Ja(e),n=Za(t,e),r=Za(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 Za(e,t){for(const n of e)if(!gh(n,{upTo:t}))return n}function gh(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 hh(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&&hh(e)&&t&&e.select()}}var Qa=mh();function mh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=el(e,t),e.unshift(t)},remove(t){var n;e=el(e,t),(n=e[0])==null||n.resume()}}}function el(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function vh(e){return e.filter(t=>t.tagName!=="A")}var yh="Portal",Xo=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Le(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?to.createPortal(l.jsx(ve.div,{...r,ref:t}),i):null});Xo.displayName=yh;var Yo=0;function wh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tl()),document.body.insertAdjacentElement("beforeend",e[1]??tl()),Yo++,()=>{Yo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yo--}},[])}function tl(){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 tt=function(){return tt=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},tt.apply(this,arguments)};function nl(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 rl(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 ol(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",xh="--removed-body-scroll-bar-size";function Jo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ch(e,t){var n=D.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 Sh=typeof window<"u"?d.useLayoutEffect:d.useEffect,sl=new WeakMap;function Eh(e,t){var n=Ch(null,function(r){return e.forEach(function(o){return Jo(o,r)})});return Sh(function(){var r=sl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Jo(a,null)}),s.forEach(function(a){o.has(a)||Jo(a,i)})}sl.set(n,e)},[e]),n}function Nh(e){return e}function Th(e,t){t===void 0&&(t=Nh);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 Ph(e){e===void 0&&(e={});var t=Th(null);return t.options=tt({async:!0,ssr:!1},e),t}var il=function(e){var t=e.sideCar,n=nl(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,tt({},n))};il.isSideCarExport=!0;function Ah(e,t){return e.useMedium(t),il}var al=Ph(),Zo=function(){},cr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Zo,onWheelCapture:Zo,onTouchMoveCapture:Zo}),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,b=e.gapMode,S=nl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,x=Eh([n,t]),P=tt(tt({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:al,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:b}),i?d.cloneElement(d.Children.only(a),tt(tt({},P),{ref:x})):d.createElement(w,tt({},P,{className:u,ref:x}),a))});cr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cr.classNames={fullWidth:lr,zeroRight:ar};var _h=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Fh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_h();return t&&e.setAttribute("nonce",t),e}function Oh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Dh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Mh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Fh())&&(Oh(t,n),Dh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kh=function(){var e=Mh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ll=function(){var e=kh(),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},Qo=function(e){return parseInt(e||"",10)||0},Ih=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[Qo(n),Qo(r),Qo(o)]},Lh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $h;var t=Ih(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])}},Rh=ll(),nn="data-scroll-locked",Vh=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
|
-
|
|
92
|
+
*/const ng=rt("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"}]]);/**
|
|
93
|
+
* @license lucide-react v0.468.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const $o=rt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rg={category:"Thư mục gốc",fileName:"Tên tệp",fullPath:"Đường dẫn đầy đủ",createAt:"Ngày tạo",creator:"Người tạo",creatorId:"ID người tạo",DataSource:"Nguồn dữ liệu",SuggestedAICategories:"Danh mục AI gợi ý",KeywordAISuggestion:"Từ khóa AI gợi ý",SummaryOfSuggestedAI:"Tóm tắt AI gợi ý",AccessLevel:"Cấp độ truy cập"},og=e=>e==="SummaryOfSuggestedAI"||e==="KeywordAISuggestion"||e==="SuggestedAICategories",ko=e=>e==="fullPath"||e==="createAt"||e==="creator"||e==="creatorId"||e==="DataSource"||e==="AccessLevel"||e==="category"||e==="fileName",sg=(e,t)=>{if(e.length>3)return t({title:"Lỗi tải lên",description:"Bạn chỉ có thể tải lên tối đa 3 tệp.",variant:"destructive"}),!0;for(let o=0;o<e.length;o++){const s=e[o];if(s&&s.size>2097152)return t({title:"Lỗi tải lên",description:`Tệp ${s.name} vượt quá giới hạn kích thước 2MB.`,variant:"destructive"}),!0}return!1};function ba(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ig(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ba(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():ba(e[o],null)}}}}var Jt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(ag);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(Lo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Lo,{...r,ref:t,children:n})});Jt.displayName="Slot";var Lo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=cg(n);return d.cloneElement(n,{...lg(r,n.props),ref:t?ig(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Lo.displayName="SlotClone";var xa=({children:e})=>l.jsx(l.Fragment,{children:e});function ag(e){return d.isValidElement(e)&&e.type===xa}function lg(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 cg(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 Ca(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=Ca(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Sa(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ca(e))&&(r&&(r+=" "),r+=t);return r}const Ro="-",ug=e=>{const t=fg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Ro);return a[0]===""&&a.length!==1&&a.shift(),Ea(a,t)||dg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},Ea=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ea(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Ro);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Na=/^\[(.+)\]$/,dg=e=>{if(Na.test(e)){const t=Na.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},fg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return gg(Object.entries(e.classGroups),n).forEach(([s,i])=>{Vo(i,r,s,t)}),r},Vo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ta(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(pg(o)){Vo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Vo(i,Ta(t,s),n,r)})})},Ta=(e,t)=>{let n=e;return t.split(Ro).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},pg=e=>e.isThemeGetter,gg=(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,hg=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)}}},Pa="!",mg=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(Pa),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},vg=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},yg=e=>({cache:hg(e.cacheSize),parseClassName:mg(e),...ug(e)}),wg=/\s+/,bg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(wg);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=vg(f).join(":"),w=g?y+Pa:y,b=w+h;if(s.includes(b))continue;s.push(b);const S=o(h,v);for(let E=0;E<S.length;++E){const C=S[E];s.push(w+C)}a=c+(a.length>0?" "+a:a)}return a};function xg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Aa(t))&&(r&&(r+=" "),r+=n);return r}const Aa=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Aa(e[r]))&&(n&&(n+=" "),n+=t);return n};function Cg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=yg(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=bg(u,n);return o(u,f),f}return function(){return s(xg.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},_a=/^\[(?:([a-z-]+):)?(.+)\]$/i,Sg=/^\d+\/\d+$/,Eg=new Set(["px","full","screen"]),Ng=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tg=/\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$/,Pg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ag=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_g=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mt=e=>Yt(e)||Eg.has(e)||Sg.test(e),Nt=e=>Zt(e,"length",Lg),Yt=e=>!!e&&!Number.isNaN(Number(e)),Bo=e=>Zt(e,"number",Yt),En=e=>!!e&&Number.isInteger(Number(e)),Fg=e=>e.endsWith("%")&&Yt(e.slice(0,-1)),re=e=>_a.test(e),Tt=e=>Ng.test(e),Og=new Set(["length","size","percentage"]),Dg=e=>Zt(e,Og,Fa),Mg=e=>Zt(e,"position",Fa),Ig=new Set(["image","url"]),$g=e=>Zt(e,Ig,Vg),kg=e=>Zt(e,"",Rg),Nn=()=>!0,Zt=(e,t,n)=>{const r=_a.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Lg=e=>Tg.test(e)&&!Pg.test(e),Fa=()=>!1,Rg=e=>Ag.test(e),Vg=e=>_g.test(e),Bg=Cg(()=>{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"),b=ue("padding"),S=ue("saturate"),E=ue("scale"),C=ue("sepia"),P=ue("skew"),_=ue("space"),O=ue("translate"),$=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",re,t],k=()=>[re,t],R=()=>["",mt,Nt],I=()=>["auto",Yt,re],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",re],ce=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>[Yt,re];return{cacheSize:500,separator:":",theme:{colors:[Nn],spacing:[mt,Nt],blur:["none","",Tt,re],brightness:fe(),borderColor:[e],borderRadius:["none","","full",Tt,re],borderSpacing:k(),borderWidth:R(),contrast:fe(),grayscale:ee(),hueRotate:fe(),invert:ee(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[Fg,Nt],inset:G(),margin:G(),opacity:fe(),padding:k(),saturate:fe(),scale:fe(),sepia:ee(),skew:fe(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Tt]}],"break-after":[{"break-after":ce()}],"break-before":[{"break-before":ce()}],"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:[...q(),re]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],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",En,re]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",En,re]}],"grid-cols":[{"grid-cols":[Nn]}],"col-start-end":[{col:["auto",{span:["full",En,re]},re]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Nn]}],"row-start-end":[{row:["auto",{span:[En,re]},re]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[Tt]},Tt]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Tt,Nt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bo]}],"font-family":[{font:[Nn]}],"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",re]}],"line-clamp":[{"line-clamp":["none",Yt,Bo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mt,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"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:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mt,Nt]}],"underline-offset":[{"underline-offset":["auto",mt,re]}],"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:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],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",re]}],"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:[...q(),Mg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$g]}],"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:[...U(),"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:U()}],"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:["",...U()]}],"outline-offset":[{"outline-offset":[mt,re]}],"outline-w":[{outline:[mt,Nt]}],"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":[mt,Nt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tt,kg]}],"shadow-color":[{shadow:[Nn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Tt,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[S]}],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":[S]}],"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",re]}],duration:[{duration:fe()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:fe()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[En,re]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],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",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mt,Nt,Bo]}],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 Q(...e){return Bg(Sa(e))}const zg=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]}`},Oa=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Q("s3-explr-ui-breadcrumb",e),...t}));Oa.displayName="Breadcrumb";const Da=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:Q("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}));Da.displayName="BreadcrumbList";const zo=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Q("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));zo.displayName="BreadcrumbItem";const Ho=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Jt:"a";return l.jsx(o,{ref:r,className:Q("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Ho.displayName="BreadcrumbLink";const Hg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Q("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Hg.displayName="BreadcrumbPage";const Ma=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:Q("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(wa,{})});Ma.displayName="BreadcrumbSeparator";const Ia=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,$a=Sa,Uo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return $a(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=Ia(f)||Ia(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 $a(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},ka=Uo("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?Jt:"button";return l.jsx(i,{className:Q(ka({variant:t,size:n,className:e})),ref:s,...o})});le.displayName="Button";function Ug(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ar(...e){return t=>e.forEach(n=>Ug(n,t))}function He(...e){return d.useCallback(ar(...e),e)}function jg(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 Pt(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,Wg(o,...t)]}function Wg(...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 ye(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 Pe(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 Qt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Gg({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Pe(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 Gg({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Pe(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function qg(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 Ve=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function La(e){const[t,n]=d.useState(void 0);return Ve(()=>{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 Kg(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var en=e=>{const{present:t,children:n}=e,r=Xg(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=He(r.ref,Jg(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};en.displayName="Presence";function Xg(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Kg(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]),Ve(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=lr(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]),Ve(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=lr(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=lr(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 lr(e){return(e==null?void 0:e.animationName)||"none"}function Jg(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 Ra=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Zg);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(jo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(jo,{...r,ref:t,children:n})});Ra.displayName="Slot";var jo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=eh(n);return d.cloneElement(n,{...Qg(r,n.props),ref:t?ar(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});jo.displayName="SlotClone";var Yg=({children:e})=>l.jsx(l.Fragment,{children:e});function Zg(e){return d.isValidElement(e)&&e.type===Yg}function Qg(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 eh(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 th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=th.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ra: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 Va(e,t){e&&jn.flushSync(()=>e.dispatchEvent(t))}var Wo="Checkbox",[nh,rC]=Pt(Wo),[rh,oh]=nh(Wo),Ba=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=He(t,E=>p(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,b]=Qt({prop:o,defaultProp:s,onChange:c}),S=d.useRef(w);return d.useEffect(()=>{const E=m==null?void 0:m.form;if(E){const C=()=>b(S.current);return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[m,b]),l.jsxs(rh,{scope:n,state:w,disabled:a,children:[l.jsx(be.button,{type:"button",role:"checkbox","aria-checked":At(w)?"mixed":w,"aria-required":i,"data-state":Ua(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:ye(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:ye(e.onClick,E=>{b(C=>At(C)?!0:!C),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(sh,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:At(s)?!1:s})]})});Ba.displayName=Wo;var za="CheckboxIndicator",Ha=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=oh(za,n);return l.jsx(en,{present:r||At(s.state)||s.state===!0,children:l.jsx(be.span,{"data-state":Ua(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ha.displayName=za;var sh=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=qg(n),u=La(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=At(n),p.call(f,At(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(At(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 At(e){return e==="indeterminate"}function Ua(e){return At(e)?"indeterminate":e?"checked":"unchecked"}var ja=Ba,ih=Ha;const Go=d.forwardRef(({className:e,...t},n)=>l.jsx(ja,{ref:n,className:Q("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(ih,{className:Q("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(Yp,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));Go.displayName=ja.displayName;var ah=d.useId||(()=>{}),lh=0;function tn(e){const[t,n]=d.useState(ah());return Ve(()=>{e||n(r=>r??String(lh++))},[e]),e||(t?`radix-${t}`:"")}function Wa(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(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 ch="DismissableLayer",qo="dismissableLayer.update",uh="dismissableLayer.pointerDownOutside",dh="dismissableLayer.focusOutside",Ga,qa=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ko=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),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=He(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),b=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,C=ph(_=>{const O=_.target,$=[...c.branches].some(F=>F.contains(O));!E||$||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=gh(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return Wa(_=>{b===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ga=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Xa(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ga)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Xa())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(qo,_),()=>document.removeEventListener(qo,_)},[]),l.jsx(be.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,C.onPointerDownCapture)})});Ko.displayName=ch;var fh="DismissableLayerBranch",Ka=d.forwardRef((e,t)=>{const n=d.useContext(qa),r=d.useRef(null),o=He(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(be.div,{...e,ref:o})});Ka.displayName=fh;function ph(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Ja(uh,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 gh(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ja(dh,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 Xa(){const e=new CustomEvent(qo);document.dispatchEvent(e)}function Ja(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?Va(o,s):o.dispatchEvent(s)}var hh=Ko,mh=Ka,Xo="focusScope.autoFocusOnMount",Jo="focusScope.autoFocusOnUnmount",Ya={bubbles:!1,cancelable:!0},vh="FocusScope",Za=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Pe(o),f=Pe(s),g=d.useRef(null),m=He(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(S){if(p.paused||!a)return;const E=S.target;a.contains(E)?g.current=E:_t(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||_t(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&_t(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const b=new MutationObserver(w);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){tl.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(Xo,Ya);a.addEventListener(Xo,c),a.dispatchEvent(w),w.defaultPrevented||(yh(Sh(Qa(a)),{select:!0}),document.activeElement===h&&_t(a))}return()=>{a.removeEventListener(Xo,c),setTimeout(()=>{const w=new CustomEvent(Jo,Ya);a.addEventListener(Jo,f),a.dispatchEvent(w),w.defaultPrevented||_t(h??document.body,{select:!0}),a.removeEventListener(Jo,f),tl.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 b=h.currentTarget,[S,E]=wh(b);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&_t(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&_t(E,{select:!0})):w===b&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(be.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Za.displayName=vh;function yh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_t(r,{select:t}),document.activeElement!==n)return}function wh(e){const t=Qa(e),n=el(t,e),r=el(t.reverse(),e);return[n,r]}function Qa(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 el(e,t){for(const n of e)if(!bh(n,{upTo:t}))return n}function bh(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 xh(e){return e instanceof HTMLInputElement&&"select"in e}function _t(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xh(e)&&t&&e.select()}}var tl=Ch();function Ch(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=nl(e,t),e.unshift(t)},remove(t){var n;e=nl(e,t),(n=e[0])==null||n.resume()}}}function nl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Sh(e){return e.filter(t=>t.tagName!=="A")}var Eh="Portal",Yo=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Ve(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?no.createPortal(l.jsx(be.div,{...r,ref:t}),i):null});Yo.displayName=Eh;var Zo=0;function Nh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rl()),document.body.insertAdjacentElement("beforeend",e[1]??rl()),Zo++,()=>{Zo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zo--}},[])}function rl(){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 ot=function(){return ot=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},ot.apply(this,arguments)};function ol(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 sl(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 il(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 cr="right-scroll-bar-position",ur="width-before-scroll-bar",Th="with-scroll-bars-hidden",Ph="--removed-body-scroll-bar-size";function Qo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ah(e,t){var n=D.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 _h=typeof window<"u"?d.useLayoutEffect:d.useEffect,al=new WeakMap;function Fh(e,t){var n=Ah(null,function(r){return e.forEach(function(o){return Qo(o,r)})});return _h(function(){var r=al.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Qo(a,null)}),s.forEach(function(a){o.has(a)||Qo(a,i)})}al.set(n,e)},[e]),n}function Oh(e){return e}function Dh(e,t){t===void 0&&(t=Oh);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 Mh(e){e===void 0&&(e={});var t=Dh(null);return t.options=ot({async:!0,ssr:!1},e),t}var ll=function(e){var t=e.sideCar,n=ol(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,ot({},n))};ll.isSideCarExport=!0;function Ih(e,t){return e.useMedium(t),ll}var cl=Mh(),es=function(){},dr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:es,onWheelCapture:es,onTouchMoveCapture:es}),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,b=e.gapMode,S=ol(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,C=Fh([n,t]),P=ot(ot({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:cl,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:b}),i?d.cloneElement(d.Children.only(a),ot(ot({},P),{ref:C})):d.createElement(w,ot({},P,{className:u,ref:C}),a))});dr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},dr.classNames={fullWidth:ur,zeroRight:cr};var $h=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function kh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$h();return t&&e.setAttribute("nonce",t),e}function Lh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Vh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=kh())&&(Lh(t,n),Rh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Bh=function(){var e=Vh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ul=function(){var e=Bh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},zh={left:0,top:0,right:0,gap:0},ts=function(e){return parseInt(e||"",10)||0},Hh=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[ts(n),ts(r),ts(o)]},Uh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zh;var t=Hh(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])}},jh=ul(),nn="data-scroll-locked",Wh=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
98
|
+
.`.concat(Th,` {
|
|
94
99
|
overflow: hidden `).concat(r,`;
|
|
95
100
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
96
101
|
}
|
|
@@ -107,32 +112,32 @@
|
|
|
107
112
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
108
113
|
}
|
|
109
114
|
|
|
110
|
-
.`).concat(
|
|
115
|
+
.`).concat(cr,` {
|
|
111
116
|
right: `).concat(a,"px ").concat(r,`;
|
|
112
117
|
}
|
|
113
118
|
|
|
114
|
-
.`).concat(
|
|
119
|
+
.`).concat(ur,` {
|
|
115
120
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
116
121
|
}
|
|
117
122
|
|
|
118
|
-
.`).concat(
|
|
123
|
+
.`).concat(cr," .").concat(cr,` {
|
|
119
124
|
right: 0 `).concat(r,`;
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
.`).concat(
|
|
127
|
+
.`).concat(ur," .").concat(ur,` {
|
|
123
128
|
margin-right: 0 `).concat(r,`;
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
body[`).concat(nn,`] {
|
|
127
|
-
`).concat(
|
|
132
|
+
`).concat(Ph,": ").concat(a,`px;
|
|
128
133
|
}
|
|
129
|
-
`)},
|
|
134
|
+
`)},dl=function(){var e=parseInt(document.body.getAttribute(nn)||"0",10);return isFinite(e)?e:0},Gh=function(){d.useEffect(function(){return document.body.setAttribute(nn,(dl()+1).toString()),function(){var e=dl()-1;e<=0?document.body.removeAttribute(nn):document.body.setAttribute(nn,e.toString())}},[])},qh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Gh();var s=d.useMemo(function(){return Uh(o)},[o]);return d.createElement(jh,{styles:Wh(s,!t,o,n?"":"!important")})},ns=!1;if(typeof window<"u")try{var fr=Object.defineProperty({},"passive",{get:function(){return ns=!0,!0}});window.addEventListener("test",fr,fr),window.removeEventListener("test",fr,fr)}catch{ns=!1}var rn=ns?{passive:!1}:!1,Kh=function(e){return e.tagName==="TEXTAREA"},fl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Kh(e)&&n[t]==="visible")},Xh=function(e){return fl(e,"overflowY")},Jh=function(e){return fl(e,"overflowX")},pl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=gl(e,r);if(o){var s=hl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Yh=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Zh=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gl=function(e,t){return e==="v"?Xh(t):Jh(t)},hl=function(e,t){return e==="v"?Yh(t):Zh(t)},Qh=function(e,t){return e==="h"&&t==="rtl"?-1:1},em=function(e,t,n,r,o){var s=Qh(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=hl(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&gl(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},pr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ml=function(e){return[e.deltaX,e.deltaY]},vl=function(e){return e&&"current"in e?e.current:e},tm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nm=function(e){return`
|
|
130
135
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
131
136
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
132
|
-
`)},Jh=0,on=[];function Zh(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(Jh++)[0],s=d.useState(ll)[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=ol([e.lockRef.current],(e.shards||[]).map(hl),!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=dr(h),b=n.current,S="deltaX"in h?h.deltaX:b[0]-w[0],E="deltaY"in h?h.deltaY:b[1]-w[1],x,P=h.target,_=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&_==="h"&&P.type==="range")return!1;var O=dl(_,P);if(!O)return!0;if(O?x=_:(x=_==="v"?"h":"v",O=dl(_,P)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=x),!x)return!0;var k=r.current||x;return Kh(k,y,h,k==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!on.length||on[on.length-1]!==s)){var w="deltaY"in y?gl(y):dr(y),b=t.current.filter(function(x){return x.name===y.type&&(x.target===y.target||y.target===x.shadowParent)&&Xh(x.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(hl).filter(Boolean).filter(function(x){return x.contains(y.target)}),E=S.length>0?a(y,S[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(h,y,w,b){var S={name:h,delta:y,target:w,should:b,shadowParent:Qh(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),f=d.useCallback(function(h){n.current=dr(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,gl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,dr(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return on.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,rn),document.addEventListener("touchmove",u,rn),document.addEventListener("touchstart",f,rn),function(){on=on.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,rn),document.removeEventListener("touchmove",u,rn),document.removeEventListener("touchstart",f,rn)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:Yh(o)}):null,p?d.createElement(zh,{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 em=Ah(al,Zh);var ml=d.forwardRef(function(e,t){return d.createElement(cr,tt({},e,{ref:t,sideCar:em}))});ml.classNames=cr.classNames;var tm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sn=new WeakMap,fr=new WeakMap,pr={},ts=0,vl=function(e){return e&&(e.host||vl(e.parentNode))},nm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vl(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})},rm=function(e,t,n,r){var o=nm(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(m){if(a.has(m))f(m);else try{var p=m.getAttribute(r),v=p!==null&&p!=="false",h=(sn.get(m)||0)+1,y=(s.get(m)||0)+1;sn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&fr.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(),ts++,function(){i.forEach(function(g){var m=sn.get(g)-1,p=s.get(g)-1;sn.set(g,m),s.set(g,p),m||(fr.has(g)||g.removeAttribute(r),fr.delete(g)),p||g.removeAttribute(n)}),ts--,ts||(sn=new WeakMap,sn=new WeakMap,fr=new WeakMap,pr={})}},om=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=tm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),rm(r,o,n,"aria-hidden")):function(){return null}},yl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(im);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(ns,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ns,{...r,ref:t,children:n})});yl.displayName="Slot";var ns=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=lm(n);return d.cloneElement(n,{...am(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ns.displayName="SlotClone";var sm=({children:e})=>l.jsx(l.Fragment,{children:e});function im(e){return d.isValidElement(e)&&e.type===sm}function am(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 lm(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 rs="Dialog",[wl,Yx]=Nt(rs),[cm,Ke]=wl(rs),bl=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]=Qt({prop:r,defaultProp:o,onChange:s});return l.jsx(cm,{scope:t,triggerRef:a,contentRef:u,contentId:tn(),titleId:tn(),descriptionId:tn(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};bl.displayName=rs;var xl="DialogTrigger",Cl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(xl,n),s=ze(t,o.triggerRef);return l.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":is(o.open),...r,ref:s,onClick:he(e.onClick,o.onOpenToggle)})});Cl.displayName=xl;var os="DialogPortal",[um,Sl]=wl(os,{forceMount:void 0}),El=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Ke(os,t);return l.jsx(um,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(en,{present:n||s.open,children:l.jsx(Xo,{asChild:!0,container:o,children:i})}))})};El.displayName=os;var gr="DialogOverlay",Nl=d.forwardRef((e,t)=>{const n=Sl(gr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ke(gr,e.__scopeDialog);return s.modal?l.jsx(en,{present:r||s.open,children:l.jsx(dm,{...o,ref:t})}):null});Nl.displayName=gr;var dm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(gr,n);return l.jsx(ml,{as:yl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(ve.div,{"data-state":is(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ht="DialogContent",Tl=d.forwardRef((e,t)=>{const n=Sl(Ht,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ke(Ht,e.__scopeDialog);return l.jsx(en,{present:r||s.open,children:s.modal?l.jsx(fm,{...o,ref:t}):l.jsx(pm,{...o,ref:t})})});Tl.displayName=Ht;var fm=d.forwardRef((e,t)=>{const n=Ke(Ht,e.__scopeDialog),r=d.useRef(null),o=ze(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return om(s)},[]),l.jsx(Pl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:he(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:he(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:he(e.onFocusOutside,s=>s.preventDefault())})}),pm=d.forwardRef((e,t)=>{const n=Ke(Ht,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Pl,{...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()}})}),Pl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Ke(Ht,n),u=d.useRef(null),c=ze(t,u);return wh(),l.jsxs(l.Fragment,{children:[l.jsx(Ya,{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":is(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(gm,{titleId:a.titleId}),l.jsx(mm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),ss="DialogTitle",Al=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(ss,n);return l.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Al.displayName=ss;var _l="DialogDescription",Fl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(_l,n);return l.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});Fl.displayName=_l;var Ol="DialogClose",Dl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(Ol,n);return l.jsx(ve.button,{type:"button",...r,ref:t,onClick:he(e.onClick,()=>o.onOpenChange(!1))})});Dl.displayName=Ol;function is(e){return e?"open":"closed"}var Ml="DialogTitleWarning",[Jx,kl]=Rg(Ml,{contentName:Ht,titleName:ss,docsSlug:"dialog"}),gm=({titleId:e})=>{const t=kl(Ml),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
137
|
+
`)},rm=0,on=[];function om(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(rm++)[0],s=d.useState(ul)[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=il([e.lockRef.current],(e.shards||[]).map(vl),!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=pr(h),b=n.current,S="deltaX"in h?h.deltaX:b[0]-w[0],E="deltaY"in h?h.deltaY:b[1]-w[1],C,P=h.target,_=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&_==="h"&&P.type==="range")return!1;var O=pl(_,P);if(!O)return!0;if(O?C=_:(C=_==="v"?"h":"v",O=pl(_,P)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=C),!C)return!0;var $=r.current||C;return em($,y,h,$==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!on.length||on[on.length-1]!==s)){var w="deltaY"in y?ml(y):pr(y),b=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&tm(C.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(vl).filter(Boolean).filter(function(C){return C.contains(y.target)}),E=S.length>0?a(y,S[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(h,y,w,b){var S={name:h,delta:y,target:w,should:b,shadowParent:sm(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),f=d.useCallback(function(h){n.current=pr(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,ml(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,pr(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return on.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,rn),document.addEventListener("touchmove",u,rn),document.addEventListener("touchstart",f,rn),function(){on=on.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,rn),document.removeEventListener("touchmove",u,rn),document.removeEventListener("touchstart",f,rn)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:nm(o)}):null,p?d.createElement(qh,{gapMode:e.gapMode}):null)}function sm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const im=Ih(cl,om);var yl=d.forwardRef(function(e,t){return d.createElement(dr,ot({},e,{ref:t,sideCar:im}))});yl.classNames=dr.classNames;var am=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sn=new WeakMap,gr=new WeakMap,hr={},rs=0,wl=function(e){return e&&(e.host||wl(e.parentNode))},lm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wl(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})},cm=function(e,t,n,r){var o=lm(t,Array.isArray(e)?e:[e]);hr[n]||(hr[n]=new WeakMap);var s=hr[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=(sn.get(m)||0)+1,y=(s.get(m)||0)+1;sn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&gr.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(),rs++,function(){i.forEach(function(g){var m=sn.get(g)-1,p=s.get(g)-1;sn.set(g,m),s.set(g,p),m||(gr.has(g)||g.removeAttribute(r),gr.delete(g)),p||g.removeAttribute(n)}),rs--,rs||(sn=new WeakMap,sn=new WeakMap,gr=new WeakMap,hr={})}},um=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=am(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),cm(r,o,n,"aria-hidden")):function(){return null}},bl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(fm);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(os,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(os,{...r,ref:t,children:n})});bl.displayName="Slot";var os=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=gm(n);return d.cloneElement(n,{...pm(r,n.props),ref:t?ar(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});os.displayName="SlotClone";var dm=({children:e})=>l.jsx(l.Fragment,{children:e});function fm(e){return d.isValidElement(e)&&e.type===dm}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 gm(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 ss="Dialog",[xl,oC]=Pt(ss),[hm,Je]=xl(ss),Cl=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]=Qt({prop:r,defaultProp:o,onChange:s});return l.jsx(hm,{scope:t,triggerRef:a,contentRef:u,contentId:tn(),titleId:tn(),descriptionId:tn(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};Cl.displayName=ss;var Sl="DialogTrigger",El=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Sl,n),s=He(t,o.triggerRef);return l.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ls(o.open),...r,ref:s,onClick:ye(e.onClick,o.onOpenToggle)})});El.displayName=Sl;var is="DialogPortal",[mm,Nl]=xl(is,{forceMount:void 0}),Tl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Je(is,t);return l.jsx(mm,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(en,{present:n||s.open,children:l.jsx(Yo,{asChild:!0,container:o,children:i})}))})};Tl.displayName=is;var mr="DialogOverlay",Pl=d.forwardRef((e,t)=>{const n=Nl(mr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Je(mr,e.__scopeDialog);return s.modal?l.jsx(en,{present:r||s.open,children:l.jsx(vm,{...o,ref:t})}):null});Pl.displayName=mr;var vm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(mr,n);return l.jsx(yl,{as:bl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(be.div,{"data-state":ls(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ht="DialogContent",Al=d.forwardRef((e,t)=>{const n=Nl(Ht,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Je(Ht,e.__scopeDialog);return l.jsx(en,{present:r||s.open,children:s.modal?l.jsx(ym,{...o,ref:t}):l.jsx(wm,{...o,ref:t})})});Al.displayName=Ht;var ym=d.forwardRef((e,t)=>{const n=Je(Ht,e.__scopeDialog),r=d.useRef(null),o=He(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return um(s)},[]),l.jsx(_l,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,s=>s.preventDefault())})}),wm=d.forwardRef((e,t)=>{const n=Je(Ht,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(_l,{...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()}})}),_l=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Je(Ht,n),u=d.useRef(null),c=He(t,u);return Nh(),l.jsxs(l.Fragment,{children:[l.jsx(Za,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Ko,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ls(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(bm,{titleId:a.titleId}),l.jsx(Cm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),as="DialogTitle",Fl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(as,n);return l.jsx(be.h2,{id:o.titleId,...r,ref:t})});Fl.displayName=as;var Ol="DialogDescription",Dl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Ol,n);return l.jsx(be.p,{id:o.descriptionId,...r,ref:t})});Dl.displayName=Ol;var Ml="DialogClose",Il=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Ml,n);return l.jsx(be.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,()=>o.onOpenChange(!1))})});Il.displayName=Ml;function ls(e){return e?"open":"closed"}var $l="DialogTitleWarning",[sC,kl]=jg($l,{contentName:Ht,titleName:as,docsSlug:"dialog"}),bm=({titleId:e})=>{const t=kl($l),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
133
138
|
|
|
134
139
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
135
140
|
|
|
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},hm="DialogDescriptionWarning",mm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kl(hm).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},vm=bl,ym=Cl,wm=El,$l=Nl,Il=Tl,Ll=Al,Rl=Fl,bm=Dl;const Ut=vm,hr=ym,xm=wm,Vl=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}));Vl.displayName=$l.displayName;const At=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(xm,{children:[l.jsx(Vl,{}),l.jsxs(Il,{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(bm,{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(ko,{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"})]})]})]}));At.displayName=Il.displayName;const _t=({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});_t.displayName="DialogHeader";const Nn=({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});Nn.displayName="DialogFooter";const Ft=d.forwardRef(({className:e,...t},n)=>l.jsx(Ll,{ref:n,className:Z("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));Ft.displayName=Ll.displayName;const mr=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}));mr.displayName=Rl.displayName;const Ot=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}));Ot.displayName="Input";var Cm="Label",Bl=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())}}));Bl.displayName=Cm;var zl=Bl;const Sm=zo("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"}}),jt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(zl,{ref:o,className:Z(Sm({variant:t,size:n}),e),...r}));jt.displayName=zl.displayName;const vr=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})}));vr.displayName="Table";const yr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:Z("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));yr.displayName="TableHeader";const wr=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}));wr.displayName="TableBody";const Em=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}));Em.displayName="TableFooter";const Xe=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}));Xe.displayName="TableRow";const nt=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}));nt.displayName="TableHead";const Fe=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}));Fe.displayName="TableCell";const Nm=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}));Nm.displayName="TableCaption";function as(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 an(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 ls(...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 cs(...e){return d.useCallback(ls(...e),e)}var us=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(ds,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ds,{...r,ref:t,children:n})});us.displayName="Slot";var ds=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=_m(n);return d.cloneElement(n,{...Am(r,n.props),ref:t?ls(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ds.displayName="SlotClone";var Tm=({children:e})=>l.jsx(l.Fragment,{children:e});function Pm(e){return d.isValidElement(e)&&e.type===Tm}function Am(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 _m(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 Fm(e){const t=e+"CollectionProvider",[n,r]=Nt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=cs(v,w.collectionRef);return l.jsx(us,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=D.useRef(null),S=cs(v,b),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(us,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var Ul=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Dm);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(fs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(fs,{...r,ref:t,children:n})});Ul.displayName="Slot";var fs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=km(n);return d.cloneElement(n,{...Mm(r,n.props),ref:t?ls(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});fs.displayName="SlotClone";var Om=({children:e})=>l.jsx(l.Fragment,{children:e});function Dm(e){return d.isValidElement(e)&&e.type===Om}function Mm(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 km(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"],jl=$m.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ul: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}},{}),Im=d.createContext(void 0);function Wl(e){const t=d.useContext(Im);return e||t||"ltr"}var ps="rovingFocusGroup.onEntryFocus",Lm={bubbles:!1,cancelable:!0},br="RovingFocusGroup",[gs,Gl,Rm]=Fm(br),[Vm,ql]=Nt(br,[Rm]),[Bm,zm]=Vm(br),Kl=d.forwardRef((e,t)=>l.jsx(gs.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(gs.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Hm,{...e,ref:t})})}));Kl.displayName=br;var Hm=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=cs(t,m),v=Wl(s),[h=null,y]=Qt({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=Pe(c),E=Gl(n),x=d.useRef(!1),[P,_]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(ps,S),()=>O.removeEventListener(ps,S)},[S]),l.jsx(Bm,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,onItemFocus:d.useCallback(O=>y(O),[y]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>_(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>_(O=>O-1),[]),children:l.jsx(jl.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:an(e.onMouseDown,()=>{x.current=!0}),onFocus:an(e.onFocus,O=>{const k=!x.current;if(O.target===O.currentTarget&&k&&!w){const F=new CustomEvent(ps,Lm);if(O.currentTarget.dispatchEvent(F),!F.defaultPrevented){const G=E().filter(W=>W.focusable),$=G.find(W=>W.active),L=G.find(W=>W.id===h),q=[$,L,...G].filter(Boolean).map(W=>W.ref.current);Jl(q,f)}}x.current=!1}),onBlur:an(e.onBlur,()=>b(!1))})})}),Xl="RovingFocusGroupItem",Yl=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=tn(),u=s||a,c=zm(Xl,n),f=c.currentTabStopId===u,g=Gl(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(gs.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(jl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:an(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:an(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:an(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=Wm(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(b=>b.focusable).map(b=>b.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const b=w.indexOf(v.currentTarget);w=c.loop?Gm(w,b+1):w.slice(b+1)}setTimeout(()=>Jl(w))}})})})});Yl.displayName=Xl;var Um={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jm(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Wm(e,t,n){const r=jm(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Um[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 Gm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qm=Kl,Km=Yl;function Zl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xm(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Zl(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():Zl(e[o],null)}}}}function Ym(...e){return d.useCallback(Xm(...e),e)}function Jm(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Ql=e=>{const{present:t,children:n}=e,r=Zm(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Ym(r.ref,Qm(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Ql.displayName="Presence";function Zm(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Jm(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]),Le(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=xr(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]),Le(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=xr(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=xr(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 xr(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 ec(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ev(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ec(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():ec(e[o],null)}}}}var tc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(nv);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(hs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(hs,{...r,ref:t,children:n})});tc.displayName="Slot";var hs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=ov(n);return d.cloneElement(n,{...rv(r,n.props),ref:t?ev(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});hs.displayName="SlotClone";var tv=({children:e})=>l.jsx(l.Fragment,{children:e});function nv(e){return d.isValidElement(e)&&e.type===tv}function rv(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 ov(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?tc: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}},{}),ms="Tabs",[iv,Zx]=Nt(ms,[ql]),nc=ql(),[av,vs]=iv(ms),rc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=Wl(a),[g,m]=Qt({prop:r,onChange:o,defaultProp:s});return l.jsx(av,{scope:n,baseId:tn(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(Cr.div,{dir:f,"data-orientation":i,...c,ref:t})})});rc.displayName=ms;var oc="TabsList",sc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=vs(oc,n),i=nc(n);return l.jsx(qm,{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})})});sc.displayName=oc;var ic="TabsTrigger",ac=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=vs(ic,n),a=nc(n),u=uc(i.baseId,r),c=dc(i.baseId,r),f=r===i.value;return l.jsx(Km,{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:as(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:as(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:as(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});ac.displayName=ic;var lc="TabsContent",cc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=vs(lc,n),u=uc(a.baseId,r),c=dc(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(Ql,{present:o||f,children:({present:m})=>l.jsx(Cr.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})})});cc.displayName=lc;function uc(e,t){return`${e}-trigger-${t}`}function dc(e,t){return`${e}-content-${t}`}var lv=rc,fc=sc,pc=ac,gc=cc;const cv=lv,hc=d.forwardRef(({className:e,...t},n)=>l.jsx(fc,{ref:n,className:Z("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));hc.displayName=fc.displayName;const ys=d.forwardRef(({className:e,...t},n)=>l.jsx(pc,{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}));ys.displayName=pc.displayName;const ws=d.forwardRef(({className:e,...t},n)=>l.jsx(gc,{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}));ws.displayName=gc.displayName;const Sr=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}));Sr.displayName="Textarea";function uv(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,dv(o,...t)]}function dv(...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 bs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(pv);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(xs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(xs,{...r,ref:t,children:n})});bs.displayName="Slot";var xs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=hv(n);return d.cloneElement(n,{...gv(r,n.props),ref:t?sr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});xs.displayName="SlotClone";var fv=({children:e})=>l.jsx(l.Fragment,{children:e});function pv(e){return d.isValidElement(e)&&e.type===fv}function gv(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 hv(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 mv(e){const t=e+"CollectionProvider",[n,r]=uv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=ze(v,w.collectionRef);return l.jsx(bs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=D.useRef(null),S=ze(v,b),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(bs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var vv="VisuallyHidden",Cs=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}}));Cs.displayName=vv;var Ss="ToastProvider",[Es,yv,wv]=mv("Toast"),[mc,Qx]=Nt("Toast",[wv]),[bv,Er]=mc(Ss),vc=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 \`${Ss}\`. Expected non-empty \`string\`.`),l.jsx(Es.Provider,{scope:t,children:l.jsx(bv,{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})})};vc.displayName=Ss;var yc="ToastViewport",xv=["F8"],Ns="toast.viewportPause",Ts="toast.viewportResume",wc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=xv,label:o="Notifications ({hotkey})",...s}=e,i=Er(yc,n),a=yv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=ze(t,g,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;d.useEffect(()=>{const y=w=>{var S;r.length!==0&&r.every(E=>w[E]||w.code===E)&&((S=g.current)==null||S.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 b=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Ns);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Ts);w.dispatchEvent(P),i.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&S()},x=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",E),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",x),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",x),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[v,i.isClosePausedRef]);const h=d.useCallback(({tabbingDirection:y})=>{const b=a().map(S=>{const E=S.ref.current,x=[E,...kv(E)];return y==="forwards"?x:x.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=b=>{var x,P,_;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const O=document.activeElement,k=b.shiftKey;if(b.target===y&&k){(x=c.current)==null||x.focus();return}const $=h({tabbingDirection:k?"backwards":"forwards"}),L=$.findIndex(M=>M===O);_s($.slice(L+1))?b.preventDefault():k?(P=c.current)==null||P.focus():(_=f.current)==null||_.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(uh,{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=h({tabbingDirection:"forwards"});_s(y)}}),l.jsx(Es.Slot,{scope:n,children:l.jsx(ve.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(Ps,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});_s(y)}})]})});wc.displayName=yc;var bc="ToastFocusProxy",Ps=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Er(bc,n);return l.jsx(Cs,{"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=bc;var Nr="Toast",Cv="toast.swipeStart",Sv="toast.swipeMove",Ev="toast.swipeCancel",Nv="toast.swipeEnd",xc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=Qt({prop:r,defaultProp:o,onChange:s});return l.jsx(en,{present:n||a,children:l.jsx(Av,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Pe(e.onPause),onResume:Pe(e.onResume),onSwipeStart:he(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:he(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:he(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:he(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)})})})});xc.displayName=Nr;var[Tv,Pv]=mc(Nr,{onClose(){}}),Av=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=Er(Nr,n),[y,w]=d.useState(null),b=ze(t,M=>w(M)),S=d.useRef(null),E=d.useRef(null),x=o||h.duration,P=d.useRef(0),_=d.useRef(x),O=d.useRef(0),{onToastAdd:k,onToastRemove:F}=h,G=Pe(()=>{var q;(y==null?void 0:y.contains(document.activeElement))&&((q=h.viewport)==null||q.focus()),i()}),$=d.useCallback(M=>{!M||M===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(G,M))},[G]);d.useEffect(()=>{const M=h.viewport;if(M){const q=()=>{$(_.current),c==null||c()},W=()=>{const X=new Date().getTime()-P.current;_.current=_.current-X,window.clearTimeout(O.current),u==null||u()};return M.addEventListener(Ns,W),M.addEventListener(Ts,q),()=>{M.removeEventListener(Ns,W),M.removeEventListener(Ts,q)}}},[h.viewport,x,u,c,$]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&$(x)},[s,x,h.isClosePausedRef,$]),d.useEffect(()=>(k(),()=>F()),[k,F]);const L=d.useMemo(()=>y?Ac(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[L&&l.jsx(_v,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),l.jsx(Tv,{scope:n,onClose:G,children:Hn.createPortal(l.jsx(Es.ItemSlot,{scope:n,children:l.jsx(ch,{asChild:!0,onEscapeKeyDown:he(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||G(),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:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:he(e.onKeyDown,M=>{M.key==="Escape"&&(a==null||a(M.nativeEvent),M.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:he(e.onPointerDown,M=>{M.button===0&&(S.current={x:M.clientX,y:M.clientY})}),onPointerMove:he(e.onPointerMove,M=>{if(!S.current)return;const q=M.clientX-S.current.x,W=M.clientY-S.current.y,X=!!E.current,K=["left","right"].includes(h.swipeDirection),ne=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,ae=K?ne(0,q):0,de=K?0:ne(0,W),De=M.pointerType==="touch"?10:2,Se={x:ae,y:de},Ue={originalEvent:M,delta:Se};X?(E.current=Se,Tr(Sv,g,Ue,{discrete:!1})):_c(Se,h.swipeDirection,De)?(E.current=Se,Tr(Cv,f,Ue,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(q)>De||Math.abs(W)>De)&&(S.current=null)}),onPointerUp:he(e.onPointerUp,M=>{const q=E.current,W=M.target;if(W.hasPointerCapture(M.pointerId)&&W.releasePointerCapture(M.pointerId),E.current=null,S.current=null,q){const X=M.currentTarget,K={originalEvent:M,delta:q};_c(q,h.swipeDirection,h.swipeThreshold)?Tr(Nv,p,K,{discrete:!0}):Tr(Ev,m,K,{discrete:!0}),X.addEventListener("click",ne=>ne.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),_v=e=>{const{__scopeToast:t,children:n,...r}=e,o=Er(Nr,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Dv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(Xo,{asChild:!0,children:l.jsx(Cs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Fv="ToastTitle",Cc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});Cc.displayName=Fv;var Ov="ToastDescription",Sc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});Sc.displayName=Ov;var Ec="ToastAction",Nc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Pc,{altText:n,asChild:!0,children:l.jsx(As,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ec}\`. Expected non-empty \`string\`.`),null)});Nc.displayName=Ec;var Tc="ToastClose",As=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Pv(Tc,n);return l.jsx(Pc,{asChild:!0,children:l.jsx(ve.button,{type:"button",...r,ref:t,onClick:he(e.onClick,o.onClose)})})});As.displayName=Tc;var Pc=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 Ac(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Mv(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(...Ac(r))}}),t}function Tr(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?La(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 Dv(e=()=>{}){const t=Pe(e);Le(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Mv(e){return e.nodeType===e.ELEMENT_NODE}function kv(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 _s(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var $v=vc,Fc=wc,Oc=xc,Dc=Cc,Mc=Sc,kc=Nc,$c=As;const Iv=$v,Ic=d.forwardRef(({className:e,...t},n)=>l.jsx(Fc,{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}));Ic.displayName=Fc.displayName;const Lv=zo("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"}}),Lc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Oc,{ref:r,className:Z(Lv({variant:t}),e),...n}));Lc.displayName=Oc.displayName;const Rv=d.forwardRef(({className:e,...t},n)=>l.jsx(kc,{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}));Rv.displayName=kc.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(ko,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Rc.displayName=$c.displayName;const Vc=d.forwardRef(({className:e,...t},n)=>l.jsx(Dc,{ref:n,className:Z("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Vc.displayName=Dc.displayName;const Bc=d.forwardRef(({className:e,...t},n)=>l.jsx(Mc,{ref:n,className:Z("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Bc.displayName=Mc.displayName;const Vv=1,Bv=1e6;let Fs=0;function zv(){return Fs=(Fs+1)%Number.MAX_SAFE_INTEGER,Fs.toString()}const Os=new Map,zc=e=>{if(Os.has(e))return;const t=setTimeout(()=>{Os.delete(e),Tn({type:"REMOVE_TOAST",toastId:e})},Bv);Os.set(e,t)},Hv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Vv)};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?zc(n):e.toasts.forEach(r=>{zc(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)}}},Pr=[];let Ar={toasts:[]};function Tn(e){Ar=Hv(Ar,e),Pr.forEach(t=>{t(Ar)})}function Uv({...e}){const t=zv(),n=o=>Tn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Tn({type:"DISMISS_TOAST",toastId:t});return Tn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Ds(){const[e,t]=d.useState(Ar);return d.useEffect(()=>(Pr.push(t),()=>{const n=Pr.indexOf(t);n>-1&&Pr.splice(n,1)}),[e]),{...e,toast:Uv,dismiss:n=>Tn({type:"DISMISS_TOAST",toastId:n})}}function Hc(){const{toasts:e}=Ds();return l.jsxs(Iv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(Lc,{...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(Vc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Bc,{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(Ic,{className:"s3-explr-ui-toast-viewport"})]})}function pt(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 Uc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Uc(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():Uc(e[o],null)}}}}function Pn(...e){return d.useCallback(jv(...e),e)}var Wv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],An=Wv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yt: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 Gv(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var qv="DismissableLayer",Ms="dismissableLayer.update",Kv="dismissableLayer.pointerDownOutside",Xv="dismissableLayer.focusOutside",jc,Wc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gc=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Wc),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Pn(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),b=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=Zv(_=>{const O=_.target,k=[...c.branches].some(F=>F.contains(O));!E||k||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=Qv(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return Ua(_=>{b===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(jc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),qc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=jc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),qc())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(Ms,_),()=>document.removeEventListener(Ms,_)},[]),l.jsx(An.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:pt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:pt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:pt(e.onPointerDownCapture,x.onPointerDownCapture)})});Gc.displayName=qv;var Yv="DismissableLayerBranch",Jv=d.forwardRef((e,t)=>{const n=d.useContext(Wc),r=d.useRef(null),o=Pn(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})});Jv.displayName=Yv;function Zv(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Kc(Kv,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=Pe(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Kc(Xv,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 qc(){const e=new CustomEvent(Ms);document.dispatchEvent(e)}function Kc(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?Gv(o,s):o.dispatchEvent(s)}const ey=["top","right","bottom","left"],Dt=Math.min,Re=Math.max,_r=Math.round,Fr=Math.floor,rt=e=>({x:e,y:e}),ty={left:"right",right:"left",bottom:"top",top:"bottom"},ny={start:"end",end:"start"};function ks(e,t,n){return Re(e,Dt(t,n))}function gt(e,t){return typeof e=="function"?e(t):e}function ht(e){return e.split("-")[0]}function ln(e){return e.split("-")[1]}function $s(e){return e==="x"?"y":"x"}function Is(e){return e==="y"?"height":"width"}function Mt(e){return["top","bottom"].includes(ht(e))?"y":"x"}function Ls(e){return $s(Mt(e))}function ry(e,t,n){n===void 0&&(n=!1);const r=ln(e),o=Ls(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 oy(e){const t=Or(e);return[Rs(e),t,Rs(t)]}function Rs(e){return e.replace(/start|end/g,t=>ny[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 iy(e,t,n,r){const o=ln(e);let s=sy(ht(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Rs)))),s}function Or(e){return e.replace(/left|right|bottom|top/g,t=>ty[t])}function ay(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xc(e){return typeof e!="number"?ay(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 Yc(e,t,n){let{reference:r,floating:o}=e;const s=Mt(t),i=Ls(t),a=Is(i),u=ht(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(ln(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const ly=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}=Yc(c,r,u),m=r,p={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:w}=a[h],{x:b,y:S,data:E,reset:x}=await w({x:f,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=b??f,g=S??g,p={...p,[y]:{...p[y],...E}},x&&v<=50&&(v++,typeof x=="object"&&(x.placement&&(m=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:f,y:g}=Yc(c,m,u)),h=-1)}return{x:f,y:g,placement:m,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:m=!1,padding:p=0}=gt(t,e),v=Xc(p),y=a[m?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})),b=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},x=Dr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:u}):b);return{top:(w.top-x.top+v.top)/E.y,bottom:(x.bottom-w.bottom+v.bottom)/E.y,left:(w.left-x.left+v.left)/E.x,right:(x.right-w.right+v.right)/E.x}}const cy=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}=gt(e,t)||{};if(c==null)return{};const g=Xc(f),m={x:n,y:r},p=Ls(o),v=Is(p),h=await i.getDimensions(c),y=p==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[p]-m[p]-s.floating[v],x=m[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let _=P?P[S]:0;(!_||!await(i.isElement==null?void 0:i.isElement(P)))&&(_=a.floating[S]||s.floating[v]);const O=E/2-x/2,k=_/2-h[v]/2-1,F=Dt(g[w],k),G=Dt(g[b],k),$=F,L=_-h[v]-G,M=_/2-h[v]/2+O,q=ks($,M,L),W=!u.arrow&&ln(o)!=null&&M!==q&&s.reference[v]/2-(M<$?F:G)-h[v]/2<0,X=W?M<$?M-$:M-L:0;return{[p]:m[p]+X,data:{[p]:q,centerOffset:M-q-X,...W&&{alignmentOffset:X}},reset:W}}}),uy=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}=gt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=ht(o),b=Mt(a),S=ht(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=m||(S||!h?[Or(a)]:oy(a)),P=v!=="none";!m&&P&&x.push(...iy(a,h,v,E));const _=[a,...x],O=await _n(t,y),k=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&k.push(O[w]),g){const M=ry(o,i,E);k.push(O[M[0]],O[M[1]])}if(F=[...F,{placement:o,overflows:k}],!k.every(M=>M<=0)){var G,$;const M=(((G=s.flip)==null?void 0:G.index)||0)+1,q=_[M];if(q)return{data:{index:M,overflows:F},reset:{placement:q}};let W=($=F.filter(X=>X.overflows[0]<=0).sort((X,K)=>X.overflows[1]-K.overflows[1])[0])==null?void 0:$.placement;if(!W)switch(p){case"bestFit":{var L;const X=(L=F.filter(K=>{if(P){const ne=Mt(K.placement);return ne===b||ne==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(ne=>ne>0).reduce((ne,ae)=>ne+ae,0)]).sort((K,ne)=>K[1]-ne[1])[0])==null?void 0:L[0];X&&(W=X);break}case"initialPlacement":W=a;break}if(o!==W)return{reset:{placement:W}}}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 Zc(e){return ey.some(t=>e[t]>=0)}const dy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=gt(e,t);switch(r){case"referenceHidden":{const s=await _n(t,{...o,elementContext:"reference"}),i=Jc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Zc(i)}}}case"escaped":{const s=await _n(t,{...o,altBoundary:!0}),i=Jc(s,n.floating);return{data:{escapedOffsets:i,escaped:Zc(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=ht(n),a=ln(n),u=Mt(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=gt(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 py=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}}}}},gy=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:b}=y;return{x:w,y:b}}},...u}=gt(e,t),c={x:n,y:r},f=await _n(t,u),g=Mt(ht(o)),m=$s(g);let p=c[m],v=c[g];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=p+f[y],S=p-f[w];p=ks(b,p,S)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=v+f[y],S=v-f[w];v=ks(b,v,S)}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}}}}}},hy=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}=gt(e,t),f={x:n,y:r},g=Mt(o),m=$s(g);let p=f[m],v=f[g];const h=gt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const S=m==="y"?"height":"width",E=s.reference[m]-s.floating[S]+y.mainAxis,x=s.reference[m]+s.reference[S]-y.mainAxis;p<E?p=E:p>x&&(p=x)}if(c){var w,b;const S=m==="y"?"width":"height",E=["top","left"].includes(ht(o)),x=s.reference[g]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),P=s.reference[g]+s.reference[S]+(E?0:((b=i.offset)==null?void 0:b[g])||0)-(E?y.crossAxis:0);v<x?v=x:v>P&&(v=P)}return{[m]:p,[g]:v}}}},my=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}=gt(e,t),f=await _n(t,c),g=ht(o),m=ln(o),p=Mt(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 b=h-f.top-f.bottom,S=v-f.left-f.right,E=Dt(h-f[y],b),x=Dt(v-f[w],S),P=!t.middlewareData.shift;let _=E,O=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=b),P&&!m){const F=Re(f.left,0),G=Re(f.right,0),$=Re(f.top,0),L=Re(f.bottom,0);p?O=v-2*(F!==0||G!==0?F+G:Re(f.left,f.right)):_=h-2*($!==0||L!==0?$+L:Re(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:_});const k=await i.getDimensions(a.floating);return v!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function Mr(){return typeof window<"u"}function cn(e){return Qc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ot(e){var t;return(t=(Qc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qc(e){return Mr()?e instanceof Node||e instanceof Ve(e).Node:!1}function Ye(e){return Mr()?e instanceof Element||e instanceof Ve(e).Element:!1}function st(e){return Mr()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function eu(e){return!Mr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}function Fn(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 vy(e){return["table","td","th"].includes(cn(e))}function kr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vs(e){const t=Bs(),n=Ye(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 yy(e){let t=kt(e);for(;st(t)&&!un(t);){if(Vs(t))return t;if(kr(t))return null;t=kt(t)}return null}function Bs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function un(e){return["html","body","#document"].includes(cn(e))}function Je(e){return Ve(e).getComputedStyle(e)}function $r(e){return Ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(cn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||eu(e)&&e.host||ot(e);return eu(t)?t.host:t}function tu(e){const t=kt(e);return un(t)?e.ownerDocument?e.ownerDocument.body:e.body:st(t)&&Fn(t)?t:tu(t)}function On(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=tu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ve(o);if(s){const a=zs(i);return t.concat(i,i.visualViewport||[],Fn(o)?o:[],a&&n?On(a):[])}return t.concat(o,On(o,[],n))}function zs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nu(e){const t=Je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=st(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 Hs(e){return Ye(e)?e:e.contextElement}function dn(e){const t=Hs(e);if(!st(t))return rt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=nu(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 wy=rt(0);function ru(e){const t=Ve(e);return!Bs()||!t.visualViewport?wy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function by(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ve(e)?!1:t}function Wt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Hs(e);let i=rt(1);t&&(r?Ye(r)&&(i=dn(r)):i=dn(e));const a=by(s,n,r)?ru(s):rt(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=Ve(s),p=r&&Ye(r)?Ve(r):r;let v=m,h=zs(v);for(;h&&r&&p!==v;){const y=dn(h),w=h.getBoundingClientRect(),b=Je(h),S=w.left+(h.clientLeft+parseFloat(b.paddingLeft))*y.x,E=w.top+(h.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=S,c+=E,v=Ve(h),h=zs(v)}}return Dr({width:f,height:g,x:u,y:c})}function Us(e,t){const n=$r(e).scrollLeft;return t?t.left+n:Wt(ot(e)).left+n}function ou(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Us(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function xy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ot(r),a=t?kr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=rt(1);const f=rt(0),g=st(r);if((g||!g&&!s)&&((cn(r)!=="body"||Fn(i))&&(u=$r(r)),st(r))){const p=Wt(r);c=dn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?ou(i,u,!0):rt(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 Cy(e){return Array.from(e.getClientRects())}function Sy(e){const t=ot(e),n=$r(e),r=e.ownerDocument.body,o=Re(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Re(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Us(e);const a=-n.scrollTop;return Je(r).direction==="rtl"&&(i+=Re(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Ey(e,t){const n=Ve(e),r=ot(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=Bs();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function Ny(e,t){const n=Wt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=st(e)?dn(e):rt(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 su(e,t,n){let r;if(t==="viewport")r=Ey(e,n);else if(t==="document")r=Sy(ot(e));else if(Ye(t))r=Ny(t,n);else{const o=ru(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dr(r)}function iu(e,t){const n=kt(e);return n===t||!Ye(n)||un(n)?!1:Je(n).position==="fixed"||iu(n,t)}function Ty(e,t){const n=t.get(e);if(n)return n;let r=On(e,[],!1).filter(a=>Ye(a)&&cn(a)!=="body"),o=null;const s=Je(e).position==="fixed";let i=s?kt(e):e;for(;Ye(i)&&!un(i);){const a=Je(i),u=Vs(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Fn(i)&&!u&&iu(e,i))?r=r.filter(f=>f!==i):o=a,i=kt(i)}return t.set(e,r),r}function Py(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?kr(t)?[]:Ty(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=su(t,f,o);return c.top=Re(g.top,c.top),c.right=Dt(g.right,c.right),c.bottom=Dt(g.bottom,c.bottom),c.left=Re(g.left,c.left),c},su(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ay(e){const{width:t,height:n}=nu(e);return{width:t,height:n}}function _y(e,t,n){const r=st(t),o=ot(t),s=n==="fixed",i=Wt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=rt(0);if(r||!r&&!s)if((cn(t)!=="body"||Fn(o))&&(a=$r(t)),r){const m=Wt(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Us(o));const c=o&&!r&&!s?ou(o,a):rt(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 js(e){return Je(e).position==="static"}function au(e,t){if(!st(e)||Je(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ot(e)===n&&(n=n.ownerDocument.body),n}function lu(e,t){const n=Ve(e);if(kr(e))return n;if(!st(e)){let o=kt(e);for(;o&&!un(o);){if(Ye(o)&&!js(o))return o;o=kt(o)}return n}let r=au(e,t);for(;r&&vy(r)&&js(r);)r=au(r,t);return r&&un(r)&&js(r)&&!Vs(r)?n:r||yy(e)||n}const Fy=async function(e){const t=this.getOffsetParent||lu,n=this.getDimensions,r=await n(e.floating);return{reference:_y(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Oy(e){return Je(e).direction==="rtl"}const Dy={convertOffsetParentRelativeRectToViewportRelativeRect:xy,getDocumentElement:ot,getClippingRect:Py,getOffsetParent:lu,getElementRects:Fy,getClientRects:Cy,getDimensions:Ay,getScale:dn,isElement:Ye,isRTL:Oy};function My(e,t){let n=null,r;const o=ot(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=Fr(f),v=Fr(o.clientWidth-(c+g)),h=Fr(o.clientHeight-(f+m)),y=Fr(c),b={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Re(0,Dt(1,u))||1};let S=!0;function E(x){const P=x[0].intersectionRatio;if(P!==u){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return i(!0),s}function ky(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=Hs(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?My(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?Wt(e):null;u&&y();function y(){const w=Wt(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(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const $y=py,Iy=gy,Ly=uy,Ry=my,Vy=dy,cu=cy,By=hy,zy=(e,t,n)=>{const r=new Map,o={platform:Dy,...n},s={...o.platform,_c:r};return ly(e,t,{...o,platform:s})};var Ir=typeof document<"u"?D.useLayoutEffect:D.useEffect;function Lr(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(!Lr(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)&&!Lr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function uu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function du(e,t){const n=uu(e);return Math.round(t*n)/n}function Ws(e){const t=d.useRef(e);return Ir(()=>{t.current=e}),t}function Hy(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);Lr(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),b=d.useCallback(K=>{K!==P.current&&(P.current=K,h(K))},[]),S=d.useCallback(K=>{K!==_.current&&(_.current=K,w(K))},[]),E=s||v,x=i||y,P=d.useRef(null),_=d.useRef(null),O=d.useRef(f),k=u!=null,F=Ws(u),G=Ws(o),$=Ws(c),L=d.useCallback(()=>{if(!P.current||!_.current)return;const K={placement:t,strategy:n,middleware:m};G.current&&(K.platform=G.current),zy(P.current,_.current,K).then(ne=>{const ae={...ne,isPositioned:$.current!==!1};M.current&&!Lr(O.current,ae)&&(O.current=ae,Hn.flushSync(()=>{g(ae)}))})},[m,t,n,G,$]);Ir(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(K=>({...K,isPositioned:!1})))},[c]);const M=d.useRef(!1);Ir(()=>(M.current=!0,()=>{M.current=!1}),[]),Ir(()=>{if(E&&(P.current=E),x&&(_.current=x),E&&x){if(F.current)return F.current(E,x,L);L()}},[E,x,L,F,k]);const q=d.useMemo(()=>({reference:P,floating:_,setReference:b,setFloating:S}),[b,S]),W=d.useMemo(()=>({reference:E,floating:x}),[E,x]),X=d.useMemo(()=>{const K={position:n,left:0,top:0};if(!W.floating)return K;const ne=du(W.floating,f.x),ae=du(W.floating,f.y);return a?{...K,transform:"translate("+ne+"px, "+ae+"px)",...uu(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:ae}},[n,a,W.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:L,refs:q,elements:W,floatingStyles:X}),[f,L,q,W,X])}const Uy=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?cu({element:r.current,padding:o}).fn(n):{}:r?cu({element:r,padding:o}).fn(n):{}}}},jy=(e,t)=>({...$y(e),options:[e,t]}),Wy=(e,t)=>({...Iy(e),options:[e,t]}),Gy=(e,t)=>({...By(e),options:[e,t]}),qy=(e,t)=>({...Ly(e),options:[e,t]}),Ky=(e,t)=>({...Ry(e),options:[e,t]}),Xy=(e,t)=>({...Vy(e),options:[e,t]}),Yy=(e,t)=>({...Uy(e),options:[e,t]});var Jy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Zy=Jy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yt: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",fu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Zy.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"})})});fu.displayName=Qy;var ew=fu;function pu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=pu(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():pu(e[o],null)}}}}function gu(...e){return d.useCallback(tw(...e),e)}var nw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],hu=nw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yt: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}},{}),Gs="Popper",[mu,vu]=Nt(Gs),[rw,yu]=mu(Gs),wu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(rw,{scope:t,anchor:r,onAnchorChange:o,children:n})};wu.displayName=Gs;var bu="PopperAnchor",xu=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=yu(bu,n),i=d.useRef(null),a=gu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(hu.div,{...o,ref:a})});xu.displayName=bu;var qs="PopperContent",[ow,sw]=mu(qs),Cu=d.forwardRef((e,t)=>{var Te,Qe,Me,hn,yt,wt;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=yu(qs,n),[w,b]=d.useState(null),S=gu(t,je=>b(je)),[E,x]=d.useState(null),P=$a(E),_=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,k=r+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(c)?c:[c],$=G.length>0,L={padding:F,boundary:G.filter(aw),altBoundary:$},{refs:M,floatingStyles:q,placement:W,isPositioned:X,middlewareData:K}=Hy({strategy:"fixed",placement:k,whileElementsMounted:(...je)=>ky(...je,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[jy({mainAxis:o+O,alignmentAxis:i}),u&&Wy({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Gy():void 0,...L}),u&&qy({...L}),Ky({...L,apply:({elements:je,rects:Lt,availableWidth:mn,availableHeight:Rt})=>{const{width:Vn,height:C}=Lt.reference,N=je.floating.style;N.setProperty("--radix-popper-available-width",`${mn}px`),N.setProperty("--radix-popper-available-height",`${Rt}px`),N.setProperty("--radix-popper-anchor-width",`${Vn}px`),N.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&Yy({element:E,padding:a}),lw({arrowWidth:_,arrowHeight:O}),m&&Xy({strategy:"referenceHidden",...L})]}),[ne,ae]=Nu(W),de=Pe(v);Le(()=>{X&&(de==null||de())},[X,de]);const De=(Te=K.arrow)==null?void 0:Te.x,Se=(Qe=K.arrow)==null?void 0:Qe.y,Ue=((Me=K.arrow)==null?void 0:Me.centerOffset)!==0,[It,we]=d.useState();return Le(()=>{w&&we(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:X?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:It,"--radix-popper-transform-origin":[(hn=K.transformOrigin)==null?void 0:hn.x,(yt=K.transformOrigin)==null?void 0:yt.y].join(" "),...((wt=K.hide)==null?void 0:wt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(ow,{scope:n,placedSide:ne,onArrowChange:x,arrowX:De,arrowY:Se,shouldHideArrow:Ue,children:l.jsx(hu.div,{"data-side":ne,"data-align":ae,...h,ref:S,style:{...h.style,animation:X?void 0:"none"}})})})});Cu.displayName=qs;var Su="PopperArrow",iw={top:"bottom",right:"left",bottom:"top",left:"right"},Eu=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=sw(Su,r),i=iw[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(ew,{...o,ref:n,style:{...o.style,display:"block"}})})});Eu.displayName=Su;function aw(e){return e!==null}var lw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,b;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]=Nu(n),g={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((b=o.arrow)==null?void 0:b.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 Nu(e){const[t,n="center"]=e.split("-");return[t,n]}var cw=wu,uw=xu,dw=Cu,fw=Eu,pw="Portal",Tu=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Le(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?to.createPortal(l.jsx(An.div,{...r,ref:t}),i):null});Tu.displayName=pw;function gw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Ks=e=>{const{present:t,children:n}=e,r=hw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Pn(r.ref,mw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Ks.displayName="Presence";function hw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=gw(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]),Le(()=>{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]),Le(()=>{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 mw(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 vw="VisuallyHidden",Pu=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}}));Pu.displayName=vw;var yw=Pu,[Vr,eC]=Nt("Tooltip",[vu]),Br=vu(),Au="TooltipProvider",ww=700,Xs="tooltip.open",[bw,Ys]=Vr(Au),_u=e=>{const{__scopeTooltip:t,delayDuration:n=ww,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(bw,{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=Au;var zr="Tooltip",[xw,Dn]=Vr(zr),Fu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Ys(zr,e.__scopeTooltip),c=Br(t),[f,g]=d.useState(null),m=tn(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=Qt({prop:r,defaultProp:o,onChange:_=>{_?(u.onOpen(),document.dispatchEvent(new CustomEvent(Xs))):u.onClose(),s==null||s(_)}}),S=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),x=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),P=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},h)},[h,b]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(cw,{...c,children:l.jsx(xw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?P():E()},[u.isOpenDelayed,P,E]),onTriggerLeave:d.useCallback(()=>{v?x():(window.clearTimeout(p.current),p.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};Fu.displayName=zr;var Js="TooltipTrigger",Ou=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Dn(Js,n),s=Ys(Js,n),i=Br(n),a=d.useRef(null),u=Pn(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(uw,{asChild:!0,...i,children:l.jsx(An.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:pt(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:pt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:pt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:pt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:pt(e.onBlur,o.onClose),onClick:pt(e.onClick,o.onClose)})})});Ou.displayName=Js;var Zs="TooltipPortal",[Cw,Sw]=Vr(Zs,{forceMount:void 0}),Du=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Dn(Zs,t);return l.jsx(Cw,{scope:t,forceMount:n,children:l.jsx(Ks,{present:n||s.open,children:l.jsx(Tu,{asChild:!0,container:o,children:r})})})};Du.displayName=Zs;var fn="TooltipContent",Mu=d.forwardRef((e,t)=>{const n=Sw(fn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Dn(fn,e.__scopeTooltip);return l.jsx(Ks,{present:r||i.open,children:i.disableHoverableContent?l.jsx(ku,{side:o,...s,ref:t}):l.jsx(Ew,{side:o,...s,ref:t})})}),Ew=d.forwardRef((e,t)=>{const n=Dn(fn,e.__scopeTooltip),r=Ys(fn,e.__scopeTooltip),o=d.useRef(null),s=Pn(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},b=Aw(w,y.getBoundingClientRect()),S=_w(w,b),E=Fw(h.getBoundingClientRect()),x=Dw([...S,...E]);a(x),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},b=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),S=!Ow(w,i);b?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(ku,{...e,ref:s})}),[Nw,Tw]=Vr(zr,{isInside:!1}),ku=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Dn(fn,n),c=Br(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(Xs,f),()=>document.removeEventListener(Xs,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(Gc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(dw,{"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(wa,{children:r}),l.jsx(Nw,{scope:n,isInside:!0,children:l.jsx(yw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Mu.displayName=fn;var $u="TooltipArrow",Pw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Br(n);return Tw($u,n).isInside?null:l.jsx(fw,{...o,...r,ref:t})});Pw.displayName=$u;function Aw(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 _w(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 Fw(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 Ow(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 Dw(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),Mw(t)}function Mw(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 kw=_u,$w=Fu,Iw=Ou,Lw=Du,Iu=Mu;const Lu=kw,Ru=$w,Vu=Iw,Qs=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Lw,{children:l.jsx(Iu,{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})}));Qs.displayName=Iu.displayName;function Rw({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 Vw=d.forwardRef(Rw);var Bw=function(e){return function(t,n){var r=D.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Bu=function(e){return typeof e=="function"},zu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const zw=Bw(D.useEffect);function Hu(e){var t=D.useRef(e);return t.current=e,t}var Hw=function(e){zu&&(Bu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Hu(e);D.useEffect(function(){return function(){t.current()}},[])},Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Uu=jw,Ww=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,Gw=Ww,qw=Gw,Kw=typeof self=="object"&&self&&self.Object===Object&&self,Xw=qw||Kw||Function("return this")(),ju=Xw,Yw=ju,Jw=function(){return Yw.Date.now()},Zw=Jw,Qw=/\s/;function eb(e){for(var t=e.length;t--&&Qw.test(e.charAt(t)););return t}var tb=eb,nb=tb,rb=/^\s+/;function ob(e){return e&&e.slice(0,nb(e)+1).replace(rb,"")}var sb=ob,ib=ju,ab=ib.Symbol,Wu=ab,Gu=Wu,qu=Object.prototype,lb=qu.hasOwnProperty,cb=qu.toString,Mn=Gu?Gu.toStringTag:void 0;function ub(e){var t=lb.call(e,Mn),n=e[Mn];try{e[Mn]=void 0;var r=!0}catch{}var o=cb.call(e);return r&&(t?e[Mn]=n:delete e[Mn]),o}var db=ub,fb=Object.prototype,pb=fb.toString;function gb(e){return pb.call(e)}var hb=gb,Ku=Wu,mb=db,vb=hb,yb="[object Null]",wb="[object Undefined]",Xu=Ku?Ku.toStringTag:void 0;function bb(e){return e==null?e===void 0?wb:yb:Xu&&Xu in Object(e)?mb(e):vb(e)}var xb=bb;function Cb(e){return e!=null&&typeof e=="object"}var Sb=Cb,Eb=xb,Nb=Sb,Tb="[object Symbol]";function Pb(e){return typeof e=="symbol"||Nb(e)&&Eb(e)==Tb}var Ab=Pb,_b=sb,Yu=Uu,Fb=Ab,Ju=NaN,Ob=/^[-+]0x[0-9a-f]+$/i,Db=/^0b[01]+$/i,Mb=/^0o[0-7]+$/i,kb=parseInt;function $b(e){if(typeof e=="number")return e;if(Fb(e))return Ju;if(Yu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Yu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=_b(e);var n=Db.test(e);return n||Mb.test(e)?kb(e.slice(2),n?2:8):Ob.test(e)?Ju:+e}var Ib=$b,Lb=Uu,ei=Zw,Zu=Ib,Rb="Expected a function",Vb=Math.max,Bb=Math.min;function zb(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(Rb);t=Zu(t)||0,Lb(n)&&(f=!!n.leading,g="maxWait"in n,s=g?Vb(Zu(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(P){var _=r,O=o;return r=o=void 0,c=P,i=e.apply(O,_),i}function v(P){return c=P,a=setTimeout(w,t),f?p(P):i}function h(P){var _=P-u,O=P-c,k=t-_;return g?Bb(k,s-O):k}function y(P){var _=P-u,O=P-c;return u===void 0||_>=t||_<0||g&&O>=s}function w(){var P=ei();if(y(P))return b(P);a=setTimeout(w,h(P))}function b(P){return a=void 0,m&&r?p(P):(r=o=void 0,i)}function S(){a!==void 0&&clearTimeout(a),c=0,r=u=o=a=void 0}function E(){return a===void 0?i:b(ei())}function x(){var P=ei(),_=y(P);if(r=arguments,o=this,u=P,_){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 x.cancel=S,x.flush=E,x}var Hb=zb;const Ub=Uw(Hb);function jb(){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}jb()||(global.Date=Date);function Wb(e,t){var n;zu&&(Bu(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=D.useMemo(function(){return Ub(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,ol([],rl(i),!1))},o,t)},[]);return Hw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function Gb(e,t,n){var r=rl(D.useState({}),2),o=r[0],s=r[1],i=Wb(function(){s({})},n).run;D.useEffect(function(){return i()},t),zw(e,[o])}const qb=D.forwardRef(({onChange:e},t)=>{const n=D.useRef(null),[r,o]=D.useState("");return D.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),Gb(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(Ot,{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(Vw,{className:"h-5 w-5"})})]})}),Be={current:!1},Qu="crawl:jobs",pn="crawl:current_job",Kb=e=>{const[t,n]=D.useState(null),[r,o]=D.useState(0);return D.useEffect(()=>{const s=localStorage.getItem(pn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),D.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]),D.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await oe.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(pn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(pn)},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(pn,JSON.stringify(s)):localStorage.removeItem(pn)}}},Xb=(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},Yb=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Ur(e,o.key))}),n},Jb=(e,t,n=[])=>{const[r,o]=D.useState({}),[s,i]=D.useState(!1),[a,u]=D.useState(null),c=D.useRef(t);D.useEffect(()=>{c.current=t},[t]);const f=async()=>{i(!0);try{const g=!Be.current;Be.current&&(Be.current=!1);const m=await oe.get(`${e}/api/files`,{params:{cache:g,displayPrefixes:JSON.stringify(n),prefix:c.current},timeout:3e5});o(m.data),u(null)}catch(g){u(g instanceof Error?g:new Error("Failed to fetch files"))}finally{i(!1)}};return D.useEffect(()=>{f()},[]),{data:r,isLoading:s,error:a,refetch:f}},jr=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||"")},Zb=D.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3002",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var Ed;const[i,a]=D.useState(""),[u,c]=D.useState(new Set),[f,g]=D.useState(n),[m,p]=D.useState(null),[v,h]=D.useState(!1),[y,w]=D.useState(""),[b,S]=D.useState(!1),[E,x]=D.useState(null),[P,_]=D.useState(!1),[O,k]=D.useState(!1),[F,G]=D.useState(null),$=D.useRef(null),{toast:L}=Ds(),[M,q]=D.useState(null),[W,X]=D.useState(""),[K,ne]=D.useState(!1),[ae,de]=D.useState(new Set),[De,Se]=D.useState(""),[Ue,It]=D.useState(!1),[we,Te]=D.useState(!1),[Qe,Me]=D.useState("rename"),[hn,yt]=D.useState(!1),[wt,je]=D.useState(""),[Lt,mn]=D.useState("1"),[Rt,Vn]=D.useState(!1),[C,N]=D.useState(!1),[A,H]=D.useState(!1),[B,V]=D.useState(!1),{currentJob:z,elapsedTime:Q,setCurrentJob:ge}=Kb(t),me=m||n,{data:be,isLoading:Bn,error:zn,refetch:ke}=Jb(t,me,s);D.useEffect(()=>{z!=null&&z.status&&(z.status.status==="completed"?(L({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${z.url} với ${z.status.completed} trang`}),Be.current=!0,ke()):z.status.status==="failed"&&L({title:"Thu thập website thất bại",description:`Không thể thu thập ${z.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Ed=z==null?void 0:z.status)==null?void 0:Ed.status]);const Jr=D.useMemo(()=>be[f]||[],[be,f]),ct=D.useMemo(()=>i?Xb(be,i,f):Jr,[Jr,i,f,be]),qt=D.useMemo(()=>{const I={};return ct.forEach((R,U)=>{u.has(R.key)&&(I[U]=!0)}),I},[u,ct]),Zr=I=>{const R=Ur(be,I);if(R.length===0)return u.has(I)?"all":"none";const U=R.filter(ee=>u.has(ee)).length;return U===0?"none":U===R.length?"all":"partial"},Qr=I=>{V(!0),p(I),g(I)};D.useEffect(()=>{B&&(Be.current=!0,ke().finally(()=>V(!1)))},[B]);const Sx=async(I,R)=>{S(!0);try{const U=`${R}${I}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:U})).status!==200){L({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}Be.current=!0,await ke(),L({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${I}"`}),w(""),h(!1)}catch(U){console.error("Error creating folder:",U),L({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{S(!1)}},bd=async(I,R,U)=>{G(U),N(!0);try{const ee=new FormData;ee.append("prefix",R),Array.from(I).forEach(se=>ee.append("files",se)),await oe.post(`${t}/api/upload`,ee,{headers:{"Content-Type":"multipart/form-data"}}),p(R),Be.current=!0,await ke()}catch(ee){console.error("Lỗi tải lên:",ee)}finally{G(null),N(!1)}},Ex=async I=>{var R;H(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[I.key]}});const U=((R=I.key)==null?void 0:R.replace(/^(.*?)(\/.*)?$/,(ee,se,le)=>!le||le==="/"?"":se+"/"))||"";p(U),Be.current=!0,L({title:"Đã xóa tập tin",description:`Đã xóa thành công "${I.name}"`}),x(null)}catch(U){console.error("Error deleting file:",U),L({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{H(!1),await ke()}},eo=I=>{const R=new Set(u),U=typeof I=="function"?I(qt):I;new Set(Object.keys(qt).map(Number)).forEach(se=>{const le=ct[se];le&&(U[se]||(R.delete(le.key),le.isFolder&&Ur(be,le.key).forEach(xe=>R.delete(xe))))}),Object.entries(U).forEach(([se,le])=>{const xe=parseInt(se),bt=ct[xe];bt&&le&&(R.add(bt.key),bt.isFolder&&Ur(be,bt.key).forEach(hi=>R.add(hi)))}),c(R)},Nx=async()=>{var I;_(!0);try{const R=Array.from(u),U=R.map(se=>Object.values(be).flat().find(le=>le.key===se)).filter(se=>se!==void 0);if(U.length===0){L({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await oe.delete(`${t}/api/files`,{data:{paths:R}});const ee=((I=U[0])==null?void 0:I.key.replace(/^(.*?)(\/.*)?$/,(se,le,xe)=>!xe||xe==="/"?"":le+"/"))||"";p(ee),Be.current=!0,ke(),L({title:"Đã xóa tập tin",description:`Đã xóa thành công ${U.length} mục`}),k(!1),c(new Set)}catch(R){console.error("Error deleting files:",R),L({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{_(!1)}},Tx=async(I,R)=>{ne(!0);try{const U=I.key;let ee;I.isFolder?ee=U.split("/").slice(0,-2).join("/")+"/":ee=U.substring(0,U.lastIndexOf("/")+1);const se=ee+R+(I.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:U,newPath:se}),Be.current=!0,await ke(),L({title:"Đã đổi tên",description:`Đã đổi tên thành công "${I.name}" thành "${R}"`}),q(null),X("")}catch(U){console.error("Error renaming item:",U),L({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{ne(!1)}},xd=async I=>{de(R=>new Set([...R,...I]));try{const R=await oe.post(`${t}/api/download`,{paths:I},{responseType:"blob"}),U=window.URL.createObjectURL(R.data),ee=document.createElement("a");ee.href=U;const se=R.headers["Content-Disposition"]||R.headers["content-disposition"],le=se==null?void 0:se.match(/filename="(.+)"/),xe=le?decodeURIComponent(le[1]):"download.zip";ee.setAttribute("download",xe),document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),window.URL.revokeObjectURL(U),L({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${I.length} mục${I.length>1,""}`})}catch(R){console.error("Error downloading files:",R),L({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{de(R=>{const U=new Set(R);return I.forEach(ee=>U.delete(ee)),U})}},Cd=f?f.replace(n,"").split("/").filter(Boolean):[],Px=()=>Array.from(u).map(I=>{var R;for(const U in be){const ee=(R=be[U])==null?void 0:R.find(se=>se.key===I);if(ee)return ee}return null}).filter(I=>I!==null),Sd=D.useMemo(()=>{const I=[{id:"select",header:()=>{const R=Yb(be,f),U=R.length>0&&R.every(se=>u.has(se)),ee=R.some(se=>u.has(se));return l.jsx(jo,{checked:U?!0:ee?"indeterminate":!1,onCheckedChange:se=>{if(se){const le=ct.reduce((xe,bt,hi)=>(xe[hi]=!0,xe),{});eo(le)}else eo({})},"aria-label":"Chọn tất cả"})},cell:({row:R})=>{const U=R.original,se=U.isFolder?Zr(U.key):u.has(U.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(jo,{checked:se==="partial"?"indeterminate":se==="all",onCheckedChange:le=>{const xe={...qt};le?xe[R.index]=!0:delete xe[R.index],eo(xe)},"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,ee=U.key.substring(0,U.key.lastIndexOf("/"))||"/",se=i.trim()!==""&&ee!==f,le=ee.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&&Qr(U.key)},children:[U.isFolder?l.jsx(no,{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(no,{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:()=>{Qr("")},children:"/"}),le.map((xe,bt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Qr(le.slice(0,bt+1).join("/")+"/")},children:xe}),bt<le.length-1&&l.jsx("span",{children:"/"})]},bt))]})]})]})}}];return r||I.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:R,row:U})=>{const ee=R();return l.jsx("span",{children:U.original.isFolder?"-":$g(ee)})}},{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(ie,{variant:"ghost",size:"icon",onClick:()=>xd([R.original.key]),className:"h-8 w-8 p-0",disabled:ae.has(R.original.key),children:ae.has(R.original.key)?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):l.jsx(vi,{className:"h-4 w-4"})}),l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{q(R.original),X(R.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Id,{className:"h-4 w-4"})}),l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>x(R.original),className:"h-8 w-8 p-0",children:l.jsx(yi,{className:"h-4 w-4"})})]})}),I},[u,ct,qt,ae,r]),gi=Oi({data:ct,columns:Sd,state:{rowSelection:qt},enableRowSelection:!0,onRowSelectionChange:eo,getCoreRowModel:Fi()}),Ax=async I=>{if(jr(I)){It(!0);try{const R=await oe.get(`${t}/api/read-text`,{params:{path:I.key}});Se(R.data.content)}catch(R){console.error("Error loading file content:",R),L({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{It(!1)}}},_x=async(I,R)=>{Te(!0);try{await oe.post(`${t}/api/modify-text`,{path:I.key,content:R}),L({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Be.current=!0,await ke(),q(null),Se(""),Me("rename")}catch(U){console.error("Error saving file content:",U),L({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Te(!1)}};D.useEffect(()=>{M&&jr(M)&&(Ax(M),Me("rename"))},[M]);const Fx=async(I,R)=>{var U;if(z){L({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:ee}=await oe.post(`${t}/api/crawl`,{url:I,limit:R,prefix:f});if(ee.id){ge({id:ee.id,url:I,limit:R,prefix:f,taskId:((U=ee.task)==null?void 0:U.id)||""});const se=localStorage.getItem(Qu),le=se?JSON.parse(se):[];le.some(xe=>xe.id===ee.id)||(le.unshift({url:I,id:ee.id,limit:R,prefix:f,timestamp:Date.now()}),le.length>20&&(le.length=20),localStorage.setItem(Qu,JSON.stringify(le))),L({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${I} với giới hạn ${R}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),yt(!1),je(""),mn("1")}}catch(ee){console.error("Error crawling website:",ee),L({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Vn(!1)}},Ox=async()=>{try{if(!(z!=null&&z.id))return;ge(null),localStorage.removeItem(pn),L({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${z.url}`})}catch(I){console.error("Error stopping job:",I),L({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(_a,{className:"s3-explr-breadcrumb",children:l.jsxs(Fa,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Vo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Bo,{onClick:()=>{p(""),g(""),Be.current=!0,setTimeout(()=>{ke()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Cd.map((I,R)=>l.jsxs(l.Fragment,{children:[l.jsx(Oa,{className:"s3-explr-breadcrumb-separator"},`sep-${R}`),l.jsx(Vo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Bo,{onClick:()=>Qr(n+Cd.slice(0,R+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:I})},`item-${I}`)]}))]})}),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(qb,{ref:$,onChange:I=>a(I)})}),l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{p(f),Be.current=!0,ke()},disabled:Bn,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Pd,{className:`h-4 w-4 s3-explr-refresh-icon ${Bn?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[u.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>xd(Array.from(u)),disabled:Array.from(u).some(I=>ae.has(I)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(I=>ae.has(I))?l.jsx(Ce,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(vi,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(Ut,{open:O,onOpenChange:k,children:[l.jsx(hr,{asChild:!0,children:l.jsxs(ie,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(yi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(At,{className:"s3-explr-dialog-content",children:[l.jsxs(_t,{className:"s3-explr-dialog-header",children:[l.jsx(Ft,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(mr,{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(ie,{variant:"outline",onClick:()=>k(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:Nx,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 đã chọn"})]})]})]})]}),l.jsxs(Ut,{open:v,onOpenChange:h,children:[l.jsx(hr,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!f,children:[l.jsx(Od,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(At,{className:"s3-explr-dialog-content",children:[l.jsx(_t,{className:"s3-explr-dialog-header",children:l.jsx(Ft,{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(jt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(Ot,{disabled:b,id:"name",value:y,onChange:I=>w(I.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(ie,{onClick:()=>{y.trim()&&Sx(y,f)},disabled:b,className:"s3-explr-create-btn",children:[b&&l.jsx(Ce,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),b?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const I=document.createElement("input");I.type="file",I.multiple=!0,I.onchange=R=>{const U=R.target.files;U&&bd(U,f,"files")},I.click()},disabled:F!==null||!!s&&!f,children:F==="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(_d,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const I=document.createElement("input");I.type="file",I.multiple=!0,I.webkitdirectory=!0,I.onchange=R=>{const U=R.target.files;U&&bd(U,f,"folder")},I.click()},disabled:F!==null||!!s&&!f,children:F==="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(no,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),z?l.jsx(Lu,{delayDuration:0,children:l.jsxs(Ru,{children:[l.jsx(Vu,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ie,{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"}),z.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",z.status.completed,"/",z.status.total,") - ",Math.floor(Q/60),":",String(Q%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>void Ox(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(Rd,{className:"h-4 w-4"})]})]})}),z.status&&l.jsx(Qs,{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 ",z.url]}),l.jsxs("p",{children:["Tiến độ: ",z.status.completed,"/",z.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(Q/60),":",String(Q%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",z.status.status==="scraping"?"Đang thu thập":z.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Ut,{open:hn,onOpenChange:yt,children:[l.jsx(hr,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!f,children:[l.jsx(kd,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(At,{className:"s3-explr-dialog-content",children:[l.jsxs(_t,{className:"s3-explr-dialog-header",children:[l.jsx(Ft,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(mr,{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(jt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(Ot,{id:"websiteUrl",value:wt,onChange:I=>je(I.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(jt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(Ot,{id:"crawlLimit",value:Lt,onChange:I=>{const R=I.target.value;/^\d*$/.test(R)&&mn(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(ie,{variant:"outline",onClick:()=>{yt(!1),je(""),mn("1")},disabled:Rt,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{onClick:()=>{wt.trim()&&Fx(wt.trim(),parseInt(Lt)||1)},disabled:Rt||!wt.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:!!E,onOpenChange:I=>!I&&x(null),children:l.jsxs(At,{className:"s3-explr-dialog-content",children:[l.jsxs(_t,{className:"s3-explr-dialog-header",children:[l.jsx(Ft,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(mr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",E==null?void 0:E.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>x(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:()=>Ex(E),disabled:A,className:"s3-explr-confirm-delete-btn",children:A?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:!!M,onOpenChange:I=>{I||(q(null),X(""),Se(""),Me("rename"))},children:l.jsxs(At,{className:"s3-explr-dialog-content max-w-2xl",children:[l.jsx(_t,{className:"s3-explr-dialog-header",children:l.jsx(Ft,{className:"s3-explr-dialog-title",children:M!=null&&M.isFolder?"Đổi tên thư mục":jr(M)?"Quản lý tập tin":"Đổi tên tập tin"})}),M&&!M.isFolder&&jr(M)?l.jsxs(cv,{value:Qe,onValueChange:I=>Me(I),children:[l.jsxs(hc,{className:"grid w-full grid-cols-2",children:[l.jsx(ys,{value:"rename",children:"Đổi tên"}),l.jsx(ys,{value:"edit",children:"Sửa nội dung"})]}),l.jsx(ws,{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(jt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Ot,{id:"newName",value:W,onChange:I=>X(I.target.value),placeholder:"Nhập tên mới",disabled:K,className:"s3-explr-input"})]})})}),l.jsx(ws,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:Ue?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(jt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Sr,{id:"content",value:De,onChange:I=>Se(I.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:we})]})})})]}):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(jt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Ot,{id:"newName",value:W,onChange:I=>X(I.target.value),placeholder:"Nhập tên mới",disabled:K,className:"s3-explr-input"})]})}),l.jsxs(Nn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{q(null),X(""),Se("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Qe==="edit"?l.jsx(ie,{onClick:()=>M&&_x(M,De),disabled:we||Ue,className:"s3-explr-save-btn",children:we?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(ie,{onClick:()=>{W.trim()&&M&&Tx(M,W.trim())},disabled:K||!W.trim()||W.trim()===(M==null?void 0:M.name),className:"s3-explr-rename-btn",children:K?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"})]})]})})]})]}),zn&&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(vr,{className:"s3-explr-table",children:[l.jsx(yr,{className:"s3-explr-table-header",children:gi.getHeaderGroups().map(I=>l.jsx(Xe,{className:"hover:bg-transparent s3-explr-header-row",children:I.headers.map(R=>l.jsx(nt,{className:"s3-explr-header-cell",children:R.isPlaceholder?null:qn(R.column.columnDef.header,R.getContext())},R.id))},I.id))}),l.jsx(wr,{className:"s3-explr-table-body",children:gi.getRowModel().rows.length===0?l.jsx(Xe,{className:"s3-explr-empty-row",children:l.jsx(Fe,{colSpan:Sd.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:Bn?"Đ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"})})}):gi.getRowModel().rows.map(I=>l.jsx(Xe,{className:"h-12 s3-explr-row",children:I.getVisibleCells().map(R=>l.jsx(Fe,{className:"align-middle s3-explr-cell",children:qn(R.column.columnDef.cell,R.getContext())},R.id))},I.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(ie,{variant:"default",onClick:()=>o(Px()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Hc,{})]})});var kn=e=>e.type==="checkbox",Gt=e=>e instanceof Date,Ae=e=>e==null;const ed=e=>typeof e=="object";var pe=e=>!Ae(e)&&!Array.isArray(e)&&ed(e)&&!Gt(e),Qb=e=>pe(e)&&e.target?kn(e.target)?e.target.checked:e.target.value:e,ex=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,tx=(e,t)=>e.has(ex(t)),nx=e=>{const t=e.constructor&&e.constructor.prototype;return pe(t)&&t.hasOwnProperty("isPrototypeOf")},ti=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function He(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(!(ti&&(e instanceof Blob||r))&&(n||pe(e)))if(t=n?[]:{},!n&&!nx(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=He(e[o]));else return e;return t}var Wr=e=>Array.isArray(e)?e.filter(Boolean):[],fe=e=>e===void 0,j=(e,t,n)=>{if(!t||!pe(e))return n;const r=Wr(t.split(/[,[\].]+?/)).reduce((o,s)=>Ae(o)?o:o[s],e);return fe(r)||r===e?fe(e[t])?n:e[t]:r},it=e=>typeof e=="boolean",ni=e=>/^\w*$/.test(e),td=e=>Wr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(e,t,n)=>{let r=-1;const o=ni(t)?[t]:td(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=pe(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 nd={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ze={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},mt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};D.createContext(null);var rx=(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]!==Ze.all&&(t._proxyFormState[i]=!r||Ze.all),e[i]}});return o},Oe=e=>pe(e)&&!Object.keys(e).length,ox=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Oe(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===Ze.all)},Gr=e=>Array.isArray(e)?e:[e];function sx(e){const t=D.useRef(e);t.current=e,D.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var at=e=>typeof e=="string",ix=(e,t,n,r,o)=>at(e)?(r&&t.watch.add(e),j(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),j(n,s))):(r&&(t.watchAll=!0),n),ax=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},rd=e=>({isOnSubmit:!e||e===Ze.onSubmit,isOnBlur:e===Ze.onBlur,isOnChange:e===Ze.onChange,isOnAll:e===Ze.all,isOnTouch:e===Ze.onTouched}),od=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const $n=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=j(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($n(a,t))break}else if(pe(a)&&$n(a,t))break}}};var lx=(e,t,n)=>{const r=Gr(j(e,n));return ue(r,"root",t[n]),ue(e,n,r),e},ri=e=>e.type==="file",lt=e=>typeof e=="function",qr=e=>{if(!ti)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Kr=e=>at(e),oi=e=>e.type==="radio",Xr=e=>e instanceof RegExp;const sd={value:!1,isValid:!1},id={value:!0,isValid:!0};var ad=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&&!fe(e[0].attributes.value)?fe(e[0].value)||e[0].value===""?id:{value:e[0].value,isValid:!0}:id:sd}return sd};const ld={isValid:!1,value:null};var cd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ld):ld;function ud(e,t,n="validate"){if(Kr(e)||Array.isArray(e)&&e.every(Kr)||it(e)&&!e)return{type:n,message:Kr(e)?e:"",ref:t}}var gn=e=>pe(e)&&!Xr(e)?e:{value:e,message:""},dd=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,b=j(t,v);if(!y||w)return{};const S=i?i[0]:s,E=$=>{r&&S.reportValidity&&(S.setCustomValidity(it($)?"":$||""),S.reportValidity())},x={},P=oi(s),_=kn(s),O=P||_,k=(h||ri(s))&&fe(s.value)&&fe(b)||qr(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,F=ax.bind(null,v,n,x),G=($,L,M,q=mt.maxLength,W=mt.minLength)=>{const X=$?L:M;x[v]={type:$?q:W,message:X,ref:s,...F($?q:W,X)}};if(o?!Array.isArray(b)||!b.length:a&&(!O&&(k||Ae(b))||it(b)&&!b||_&&!ad(i).isValid||P&&!cd(i).isValid)){const{value:$,message:L}=Kr(a)?{value:!!a,message:a}:gn(a);if($&&(x[v]={type:mt.required,message:L,ref:S,...F(mt.required,L)},!n))return E(L),x}if(!k&&(!Ae(f)||!Ae(g))){let $,L;const M=gn(g),q=gn(f);if(!Ae(b)&&!isNaN(b)){const W=s.valueAsNumber||b&&+b;Ae(M.value)||($=W>M.value),Ae(q.value)||(L=W<q.value)}else{const W=s.valueAsDate||new Date(b),X=ae=>new Date(new Date().toDateString()+" "+ae),K=s.type=="time",ne=s.type=="week";at(M.value)&&b&&($=K?X(b)>X(M.value):ne?b>M.value:W>new Date(M.value)),at(q.value)&&b&&(L=K?X(b)<X(q.value):ne?b<q.value:W<new Date(q.value))}if(($||L)&&(G(!!$,M.message,q.message,mt.max,mt.min),!n))return E(x[v].message),x}if((u||c)&&!k&&(at(b)||o&&Array.isArray(b))){const $=gn(u),L=gn(c),M=!Ae($.value)&&b.length>+$.value,q=!Ae(L.value)&&b.length<+L.value;if((M||q)&&(G(M,$.message,L.message),!n))return E(x[v].message),x}if(m&&!k&&at(b)){const{value:$,message:L}=gn(m);if(Xr($)&&!b.match($)&&(x[v]={type:mt.pattern,message:L,ref:s,...F(mt.pattern,L)},!n))return E(L),x}if(p){if(lt(p)){const $=await p(b,t),L=ud($,S);if(L&&(x[v]={...L,...F(mt.validate,L.message)},!n))return E(L.message),x}else if(pe(p)){let $={};for(const L in p){if(!Oe($)&&!n)break;const M=ud(await p[L](b,t),S,L);M&&($={...M,...F(L,M.message)},E(M.message),n&&(x[v]=$))}if(!Oe($)&&(x[v]={ref:S,...$},!n))return x}}return E(!0),x};function cx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=fe(e)?r++:e[t[r++]];return e}function ux(e){for(const t in e)if(e.hasOwnProperty(t)&&!fe(e[t]))return!1;return!0}function ye(e,t){const n=Array.isArray(t)?t:ni(t)?[t]:td(t),r=n.length===1?e:cx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(pe(r)&&Oe(r)||Array.isArray(r)&&ux(r))&&ye(e,n.slice(0,-1)),e}var si=()=>{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=[]}}},ii=e=>Ae(e)||!ed(e);function $t(e,t){if(ii(e)||ii(t))return e===t;if(Gt(e)&&Gt(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(Gt(s)&&Gt(i)||pe(s)&&pe(i)||Array.isArray(s)&&Array.isArray(i)?!$t(s,i):s!==i)return!1}}return!0}var fd=e=>e.type==="select-multiple",dx=e=>oi(e)||kn(e),ai=e=>qr(e)&&e.isConnected,pd=e=>{for(const t in e)if(lt(e[t]))return!0;return!1};function Yr(e,t={}){const n=Array.isArray(e);if(pe(e)||n)for(const r in e)Array.isArray(e[r])||pe(e[r])&&!pd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Yr(e[r],t[r])):Ae(e[r])||(t[r]=!0);return t}function gd(e,t,n){const r=Array.isArray(e);if(pe(e)||r)for(const o in e)Array.isArray(e[o])||pe(e[o])&&!pd(e[o])?fe(t)||ii(n[o])?n[o]=Array.isArray(e[o])?Yr(e[o],[]):{...Yr(e[o])}:gd(e[o],Ae(t)?{}:t[o],n[o]):n[o]=!$t(e[o],t[o]);return n}var In=(e,t)=>gd(e,t,Yr(t)),hd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>fe(e)?e:t?e===""?NaN:e&&+e:n&&at(e)?new Date(e):r?r(e):e;function li(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ri(t)?t.files:oi(t)?cd(e.refs).value:fd(t)?[...t.selectedOptions].map(({value:n})=>n):kn(t)?ad(e.refs).value:hd(fe(t.value)?e.ref.value:t.value,e)}var fx=(e,t,n,r)=>{const o={};for(const s of e){const i=j(t,s);i&&ue(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Ln=e=>fe(e)?e:Xr(e)?e.source:pe(e)?Xr(e.value)?e.value.source:e.value:e;const md="AsyncFunction";var px=e=>!!e&&!!e.validate&&!!(lt(e.validate)&&e.validate.constructor.name===md||pe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===md)),gx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function vd(e,t,n){const r=j(e,n);if(r||ni(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=j(t,s),a=j(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 hx=(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,mx=(e,t)=>!Wr(j(e,t)).length&&ye(e,t);const vx={mode:Ze.onSubmit,reValidateMode:Ze.onChange,shouldFocusError:!0};function yx(e={}){let t={...vx,...e},n={submitCount:0,isDirty:!1,isLoading:lt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=pe(t.defaultValues)||pe(t.values)?He(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:He(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:si(),array:si(),state:si()},m=rd(t.mode),p=rd(t.reValidateMode),v=t.criteriaMode===Ze.all,h=C=>N=>{clearTimeout(c),c=setTimeout(C,N)},y=async C=>{if(!t.disabled&&(f.isValid||C)){const N=t.resolver?Oe((await O()).errors):await F(r,!0);N!==n.isValid&&g.state.next({isValid:N})}},w=(C,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((C||Array.from(a.mount)).forEach(A=>{A&&(N?ue(n.validatingFields,A,N):ye(n.validatingFields,A))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Oe(n.validatingFields)}))},b=(C,N=[],A,H,B=!0,V=!0)=>{if(H&&A&&!t.disabled){if(i.action=!0,V&&Array.isArray(j(r,C))){const z=A(j(r,C),H.argA,H.argB);B&&ue(r,C,z)}if(V&&Array.isArray(j(n.errors,C))){const z=A(j(n.errors,C),H.argA,H.argB);B&&ue(n.errors,C,z),mx(n.errors,C)}if(f.touchedFields&&V&&Array.isArray(j(n.touchedFields,C))){const z=A(j(n.touchedFields,C),H.argA,H.argB);B&&ue(n.touchedFields,C,z)}f.dirtyFields&&(n.dirtyFields=In(o,s)),g.state.next({name:C,isDirty:$(C,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ue(s,C,N)},S=(C,N)=>{ue(n.errors,C,N),g.state.next({errors:n.errors})},E=C=>{n.errors=C,g.state.next({errors:n.errors,isValid:!1})},x=(C,N,A,H)=>{const B=j(r,C);if(B){const V=j(s,C,fe(A)?j(o,C):A);fe(V)||H&&H.defaultChecked||N?ue(s,C,N?V:li(B._f)):q(C,V),i.mount&&y()}},P=(C,N,A,H,B)=>{let V=!1,z=!1;const Q={name:C};if(!t.disabled){const ge=!!(j(r,C)&&j(r,C)._f&&j(r,C)._f.disabled);if(!A||H){f.isDirty&&(z=n.isDirty,n.isDirty=Q.isDirty=$(),V=z!==Q.isDirty);const me=ge||$t(j(o,C),N);z=!!(!ge&&j(n.dirtyFields,C)),me||ge?ye(n.dirtyFields,C):ue(n.dirtyFields,C,!0),Q.dirtyFields=n.dirtyFields,V=V||f.dirtyFields&&z!==!me}if(A){const me=j(n.touchedFields,C);me||(ue(n.touchedFields,C,A),Q.touchedFields=n.touchedFields,V=V||f.touchedFields&&me!==A)}V&&B&&g.state.next(Q)}return V?Q:{}},_=(C,N,A,H)=>{const B=j(n.errors,C),V=f.isValid&&it(N)&&n.isValid!==N;if(t.delayError&&A?(u=h(()=>S(C,A)),u(t.delayError)):(clearTimeout(c),u=null,A?ue(n.errors,C,A):ye(n.errors,C)),(A?!$t(B,A):B)||!Oe(H)||V){const z={...H,...V&&it(N)?{isValid:N}:{},errors:n.errors,name:C};n={...n,...z},g.state.next(z)}},O=async C=>{w(C,!0);const N=await t.resolver(s,t.context,fx(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(C),N},k=async C=>{const{errors:N}=await O(C);if(C)for(const A of C){const H=j(N,A);H?ue(n.errors,A,H):ye(n.errors,A)}else n.errors=N;return N},F=async(C,N,A={valid:!0})=>{for(const H in C){const B=C[H];if(B){const{_f:V,...z}=B;if(V){const Q=a.array.has(V.name),ge=B._f&&px(B._f);ge&&f.validatingFields&&w([H],!0);const me=await dd(B,s,v,t.shouldUseNativeValidation&&!N,Q);if(ge&&f.validatingFields&&w([H]),me[V.name]&&(A.valid=!1,N))break;!N&&(j(me,V.name)?Q?lx(n.errors,me,V.name):ue(n.errors,V.name,me[V.name]):ye(n.errors,V.name))}!Oe(z)&&await F(z,N,A)}}return A.valid},G=()=>{for(const C of a.unMount){const N=j(r,C);N&&(N._f.refs?N._f.refs.every(A=>!ai(A)):!ai(N._f.ref))&&we(C)}a.unMount=new Set},$=(C,N)=>!t.disabled&&(C&&N&&ue(s,C,N),!$t(de(),o)),L=(C,N,A)=>ix(C,a,{...i.mount?s:fe(N)?o:at(C)?{[C]:N}:N},A,N),M=C=>Wr(j(i.mount?s:o,C,t.shouldUnregister?j(o,C,[]):[])),q=(C,N,A={})=>{const H=j(r,C);let B=N;if(H){const V=H._f;V&&(!V.disabled&&ue(s,C,hd(N,V)),B=qr(V.ref)&&Ae(N)?"":N,fd(V.ref)?[...V.ref.options].forEach(z=>z.selected=B.includes(z.value)):V.refs?kn(V.ref)?V.refs.length>1?V.refs.forEach(z=>(!z.defaultChecked||!z.disabled)&&(z.checked=Array.isArray(B)?!!B.find(Q=>Q===z.value):B===z.value)):V.refs[0]&&(V.refs[0].checked=!!B):V.refs.forEach(z=>z.checked=z.value===B):ri(V.ref)?V.ref.value="":(V.ref.value=B,V.ref.type||g.values.next({name:C,values:{...s}})))}(A.shouldDirty||A.shouldTouch)&&P(C,B,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&ae(C)},W=(C,N,A)=>{for(const H in N){const B=N[H],V=`${C}.${H}`,z=j(r,V);(a.array.has(C)||pe(B)||z&&!z._f)&&!Gt(B)?W(V,B,A):q(V,B,A)}},X=(C,N,A={})=>{const H=j(r,C),B=a.array.has(C),V=He(N);ue(s,C,V),B?(g.array.next({name:C,values:{...s}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&g.state.next({name:C,dirtyFields:In(o,s),isDirty:$(C,V)})):H&&!H._f&&!Ae(V)?W(C,V,A):q(C,V,A),od(C,a)&&g.state.next({...n}),g.values.next({name:i.mount?C:void 0,values:{...s}})},K=async C=>{i.mount=!0;const N=C.target;let A=N.name,H=!0;const B=j(r,A),V=()=>N.type?li(B._f):Qb(C),z=Q=>{H=Number.isNaN(Q)||Gt(Q)&&isNaN(Q.getTime())||$t(Q,j(s,A,Q))};if(B){let Q,ge;const me=V(),be=C.type===nd.BLUR||C.type===nd.FOCUS_OUT,Bn=!gx(B._f)&&!t.resolver&&!j(n.errors,A)&&!B._f.deps||hx(be,j(n.touchedFields,A),n.isSubmitted,p,m),zn=od(A,a,be);ue(s,A,me),be?(B._f.onBlur&&B._f.onBlur(C),u&&u(0)):B._f.onChange&&B._f.onChange(C);const ke=P(A,me,be,!1),Jr=!Oe(ke)||zn;if(!be&&g.values.next({name:A,type:C.type,values:{...s}}),Bn)return f.isValid&&(t.mode==="onBlur"?be&&y():y()),Jr&&g.state.next({name:A,...zn?{}:ke});if(!be&&zn&&g.state.next({...n}),t.resolver){const{errors:ct}=await O([A]);if(z(me),H){const qt=vd(n.errors,r,A),Zr=vd(ct,r,qt.name||A);Q=Zr.error,A=Zr.name,ge=Oe(ct)}}else w([A],!0),Q=(await dd(B,s,v,t.shouldUseNativeValidation))[A],w([A]),z(me),H&&(Q?ge=!1:f.isValid&&(ge=await F(r,!0)));H&&(B._f.deps&&ae(B._f.deps),_(A,ge,Q,ke))}},ne=(C,N)=>{if(j(n.errors,N)&&C.focus)return C.focus(),1},ae=async(C,N={})=>{let A,H;const B=Gr(C);if(t.resolver){const V=await k(fe(C)?C:B);A=Oe(V),H=C?!B.some(z=>j(V,z)):A}else C?(H=(await Promise.all(B.map(async V=>{const z=j(r,V);return await F(z&&z._f?{[V]:z}:z)}))).every(Boolean),!(!H&&!n.isValid)&&y()):H=A=await F(r);return g.state.next({...!at(C)||f.isValid&&A!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:A}:{},errors:n.errors}),N.shouldFocus&&!H&&$n(r,ne,C?B:a.mount),H},de=C=>{const N={...i.mount?s:o};return fe(C)?N:at(C)?j(N,C):C.map(A=>j(N,A))},De=(C,N)=>({invalid:!!j((N||n).errors,C),isDirty:!!j((N||n).dirtyFields,C),error:j((N||n).errors,C),isValidating:!!j(n.validatingFields,C),isTouched:!!j((N||n).touchedFields,C)}),Se=C=>{C&&Gr(C).forEach(N=>ye(n.errors,N)),g.state.next({errors:C?n.errors:{}})},Ue=(C,N,A)=>{const H=(j(r,C,{_f:{}})._f||{}).ref,B=j(n.errors,C)||{},{ref:V,message:z,type:Q,...ge}=B;ue(n.errors,C,{...ge,...N,ref:H}),g.state.next({name:C,errors:n.errors,isValid:!1}),A&&A.shouldFocus&&H&&H.focus&&H.focus()},It=(C,N)=>lt(C)?g.values.subscribe({next:A=>C(L(void 0,N),A)}):L(C,N,!0),we=(C,N={})=>{for(const A of C?Gr(C):a.mount)a.mount.delete(A),a.array.delete(A),N.keepValue||(ye(r,A),ye(s,A)),!N.keepError&&ye(n.errors,A),!N.keepDirty&&ye(n.dirtyFields,A),!N.keepTouched&&ye(n.touchedFields,A),!N.keepIsValidating&&ye(n.validatingFields,A),!t.shouldUnregister&&!N.keepDefaultValue&&ye(o,A);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:$()}:{}}),!N.keepIsValid&&y()},Te=({disabled:C,name:N,field:A,fields:H,value:B})=>{if(it(C)&&i.mount||C){const V=C?void 0:fe(B)?li(A?A._f:j(H,N)._f):B;(C||!C&&!fe(V))&&ue(s,N,V),P(N,V,!1,!1,!0)}},Qe=(C,N={})=>{let A=j(r,C);const H=it(N.disabled)||it(t.disabled);return ue(r,C,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:C}},name:C,mount:!0,...N}}),a.mount.add(C),A?Te({field:A,disabled:it(N.disabled)?N.disabled:t.disabled,name:C,value:N.value}):x(C,!0,N.value),{...H?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Ln(N.min),max:Ln(N.max),minLength:Ln(N.minLength),maxLength:Ln(N.maxLength),pattern:Ln(N.pattern)}:{},name:C,onChange:K,onBlur:K,ref:B=>{if(B){Qe(C,N),A=j(r,C);const V=fe(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,z=dx(V),Q=A._f.refs||[];if(z?Q.find(ge=>ge===V):V===A._f.ref)return;ue(r,C,{_f:{...A._f,...z?{refs:[...Q.filter(ai),V,...Array.isArray(j(o,C))?[{}]:[]],ref:{type:V.type,name:C}}:{ref:V}}}),x(C,!1,void 0,V)}else A=j(r,C,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(tx(a.array,C)&&i.action)&&a.unMount.add(C)}}},Me=()=>t.shouldFocusError&&$n(r,ne,a.mount),hn=C=>{it(C)&&(g.state.next({disabled:C}),$n(r,(N,A)=>{const H=j(r,A);H&&(N.disabled=H._f.disabled||C,Array.isArray(H._f.refs)&&H._f.refs.forEach(B=>{B.disabled=H._f.disabled||C}))},0,!1))},yt=(C,N)=>async A=>{let H;if(A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist()),t.disabled){N&&await N({...n.errors},A);return}let B=He(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:V,values:z}=await O();n.errors=V,B=z}else await F(r);if(ye(n.errors,"root"),Oe(n.errors)){g.state.next({errors:{}});try{await C(B,A)}catch(V){H=V}}else N&&await N({...n.errors},A),Me(),setTimeout(Me);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Oe(n.errors)&&!H,submitCount:n.submitCount+1,errors:n.errors}),H)throw H},wt=(C,N={})=>{j(r,C)&&(fe(N.defaultValue)?X(C,He(j(o,C))):(X(C,N.defaultValue),ue(o,C,He(N.defaultValue))),N.keepTouched||ye(n.touchedFields,C),N.keepDirty||(ye(n.dirtyFields,C),n.isDirty=N.defaultValue?$(C,He(j(o,C))):$()),N.keepError||(ye(n.errors,C),f.isValid&&y()),g.state.next({...n}))},je=(C,N={})=>{const A=C?He(C):o,H=He(A),B=Oe(C),V=B?o:H;if(N.keepDefaultValues||(o=A),!N.keepValues){if(N.keepDirtyValues){const z=new Set([...a.mount,...Object.keys(In(o,s))]);for(const Q of Array.from(z))j(n.dirtyFields,Q)?ue(V,Q,j(s,Q)):X(Q,j(V,Q))}else{if(ti&&fe(C))for(const z of a.mount){const Q=j(r,z);if(Q&&Q._f){const ge=Array.isArray(Q._f.refs)?Q._f.refs[0]:Q._f.ref;if(qr(ge)){const me=ge.closest("form");if(me){me.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?He(o):{}:He(V),g.array.next({values:{...V}}),g.values.next({values:{...V}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!t.shouldUnregister,g.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:B?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!$t(C,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:B?{}:N.keepDirtyValues?N.keepDefaultValues&&s?In(o,s):n.dirtyFields:N.keepDefaultValues&&C?In(o,C):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Lt=(C,N)=>je(lt(C)?C(s):C,N);return{control:{register:Qe,unregister:we,getFieldState:De,handleSubmit:yt,setError:Ue,_executeSchema:O,_getWatch:L,_getDirty:$,_updateValid:y,_removeUnmounted:G,_updateFieldArray:b,_updateDisabledField:Te,_getFieldArray:M,_reset:je,_resetDefaultValues:()=>lt(t.defaultValues)&&t.defaultValues().then(C=>{Lt(C,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:hn,_subjects:g,_proxyFormState:f,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(C){i=C},get _defaultValues(){return o},get _names(){return a},set _names(C){a=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:ae,register:Qe,handleSubmit:yt,watch:It,setValue:X,getValues:de,reset:Lt,resetField:wt,clearErrors:Se,unregister:we,setError:Ue,setFocus:(C,N={})=>{const A=j(r,C),H=A&&A._f;if(H){const B=H.refs?H.refs[0]:H.ref;B.focus&&(B.focus(),N.shouldSelect&<(B.select)&&B.select())}},getFieldState:De}}function wx(e={}){const t=D.useRef(),n=D.useRef(),[r,o]=D.useState({isDirty:!1,isValidating:!1,isLoading:lt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:lt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...yx(e),formState:r});const s=t.current.control;return s._options=e,sx({subject:s._subjects.state,next:i=>{ox(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),D.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),D.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),D.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]),D.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),D.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()}),D.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),D.useMemo(()=>({...t.current,formState:rx(r,s)}),[r,s])}const yd=({className:e,children:t,content:n,side:r})=>{const[o,s]=D.useState(!1);return l.jsx(Lu,{delayDuration:0,children:l.jsxs(Ru,{open:o,children:[l.jsx(Vu,{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(Qs,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},ci=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:Z("mx-auto flex w-full justify-center",e),...t});ci.displayName="Pagination";const ui=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:Z("flex flex-row items-center gap-1",e),...t}));ui.displayName="PaginationContent";const vt=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("",e),...t}));vt.displayName="PaginationItem";const Rn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:Z(ka({variant:t?"outline":"ghost",size:n}),e),...r});Rn.displayName="PaginationLink";const di=({className:e,...t})=>l.jsxs(Rn,{"aria-label":"Go to previous page",size:"default",className:Z("gap-1 pl-2.5",e),...t,children:[l.jsx(Yp,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});di.displayName="PaginationPrevious";const fi=({className:e,...t})=>l.jsxs(Rn,{"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(va,{className:"h-4 w-4"})]});fi.displayName="PaginationNext";const pi=({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(Jp,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});pi.displayName="PaginationEllipsis";const bx=(e,t)=>{const[n,r]=D.useState(e);return D.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},xx=({apiBaseUrl:e="http://localhost:3002"})=>{var P,_;const[t,n]=D.useState([]),[r,o]=D.useState(!1),[s,i]=D.useState([]),[a,u]=D.useState(1),[c,f]=D.useState(1),[g,m]=D.useState(null),[p,v]=D.useState(""),h=bx(p,500),y=O=>{const k=O.match(/\d{6}/);if(!k)return{month:"",year:""};const F=k[0],G=F.substring(0,2),$=F.substring(2);return{month:G,year:$}},w=O=>O.map(F=>{let G=(F==null?void 0:F.month)||"",$=(F==null?void 0:F.year)||"";if((!G||!$)&&(F!=null&&F.file_name)){const L=y(F.file_name);G=G||L.month,$=$||L.year}return{id:F==null?void 0:F.id,prefix:(F==null?void 0:F.prefix)||"",model:(F==null?void 0:F.model)||"",fileName:(F==null?void 0:F.file_name)||"",code:(F==null?void 0:F.stock_id)||"",month:G,year:$,content:(F==null?void 0:F.text_summary)||"",status:(F==null?void 0:F.status)||"",note:(F==null?void 0:F.note)||"",lastUpdate:F==null?void 0:F.updated_at,stock_id:F==null?void 0:F.stock_id}}),b=O=>{if(!(O!=null&&O.data))return[];const k=w(O==null?void 0:O.data);n(k),f(O.pagination.totalPages)},S=async(O=1,k=15)=>{m(O),o(!0);try{const F=await oe.get(`${e}/api/latest-summaries`,{params:{page:O,limit:k,search:p}});(F==null?void 0:F.status)===200?b(F.data):console.error(F)}catch(F){console.error("Error fetching data:",F)}finally{m(null),o(!1)}};D.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=D.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:k})=>l.jsx("span",{className:"flex flex-col",children:k.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:k})=>{const F=k.original.month,G=k.original.year;return l.jsx("span",{className:"flex flex-col",children:`${F.toString().padStart(2,"0")}/${G}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:k})=>{const F=k.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:F})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:k})=>{const G=k.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${G?"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:G?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:k})=>l.jsx(yd,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:k.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:k.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:k})=>{const F=new Date(k.original.lastUpdate),G=F.getDate(),$=F.getMonth()+1,L=`ngày ${G} tháng ${$}`;return l.jsx("span",{className:"flex flex-col",children:L})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:k})=>{const[F,G]=D.useState(!1),[$,L]=D.useState(!1),[M,q]=D.useState(!1),{handleSubmit:W,register:X,reset:K}=wx(),ne=k.original.id,ae=k.getValue("status"),de=k.getValue("content"),[De,Se]=D.useState(!1),Ue=async()=>{try{Se(!0);const we=ae==="unpublish"?"published":"unpublish",Te=await oe.patch(`${e}/api/toggle-publish/${ne}`,{id:ne,typeAction:"update",status:ae,idInput:ne,stock_id:k.original.stock_id,prefix:k.original.prefix,model:k.original.model,summary_result:k.original.content,note:k.original.note});Te.status===200?n(Qe=>Qe.map(Me=>Me.id===ne?{...Me,status:we}:Me)):console.error("Failed to toggle publish status:",Te)}catch(we){console.error("Error toggling publish status:",we)}finally{Se(!1)}},It=async we=>{G(!0);try{const Te=await oe.patch(`${e}/api/update-summary`,{note:we.note,text_summary:we.content,id:ne});Te.status===200?(await S(a),L(!1)):console.error("Failed to update summary:",Te)}catch(Te){console.error("Error updating summary:",Te)}return G(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>q(!0),className:"px-2 py-0.5 h-7",children:l.jsx(Zp,{className:"h-4 w-4"})}),l.jsx(Ut,{open:M,onOpenChange:q,children:l.jsxs(At,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(_t,{children:l.jsx(Ft,{children:"Nội dung chi tiết"})}),l.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:l.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:de})})]})}),l.jsxs(Ut,{open:$,onOpenChange:we=>{L(we),we?K({content:k.original.content,note:k.original.note}):K()},children:[l.jsx(hr,{asChild:!0,children:l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>L(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(At,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(_t,{className:"flex flex-col gap-3",children:[l.jsx(Ft,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:W(It),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:k.original.answer||"",rows:10,...X("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(Sr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.note||"",rows:1,...X("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ie,{disabled:F,type:"submit",variant:"default",children:F?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ie,{variant:"outline",size:"sm",onClick:Ue,disabled:De,className:"w-[70px] px-2 py-0.5 h-7",children:De?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):ae==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Oi({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:yf(),getCoreRowModel:Fi()});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.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(Ot,{placeholder:"Tìm kiếm theo mã...",value:p,onChange:O=>v(O.target.value),className:"pr-8"}),p&&l.jsx(ie,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>v(""),children:l.jsx(ko,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(vr,{className:"s3-explr-table",children:[l.jsx(yr,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(O=>l.jsx(Xe,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map(k=>l.jsx(nt,{className:"s3-explr-header-cell",children:k.isPlaceholder?null:qn(k.column.columnDef.header,k.getContext())},k.id))},O.id))}),l.jsx(wr,{className:"s3-explr-table-body",children:r?l.jsx(Xe,{children:l.jsx(Fe,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(P=x.getRowModel().rows)!=null&&P.length?(_=x.getRowModel().rows)==null?void 0:_.map(O=>l.jsx(Xe,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map(k=>l.jsx(Fe,{className:"align-middle s3-explr-cell",children:qn(k.column.columnDef.cell,k.getContext())},k.id))},O.id)):l.jsx(Xe,{children:l.jsx(Fe,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(ci,{children:l.jsxs(ui,{children:[l.jsx(vt,{children:l.jsx(di,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,k)=>k+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,k,F)=>l.jsxs(l.Fragment,{children:[k>0&&F[k-1]!==O-1&&l.jsx(vt,{children:l.jsx(pi,{})},O+"..."),l.jsx(vt,{children:l.jsx(Rn,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===O?l.jsx(Ce,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(vt,{children:l.jsx(fi,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},wd=10,Cx=D.memo(({apiBaseUrl:e="http://localhost:3002"})=>{const[t,n]=D.useState(1),[r,o]=D.useState([]),[s,i]=D.useState({total:0,page:1,limit:wd,totalPages:1}),[a,u]=D.useState(!0),[c,f]=D.useState(null),[g,m]=D.useState(new Set),{toast:p}=Ds(),[v,h]=D.useState(!1),y=async x=>{try{f(x);const P=await oe.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:wd.toString()}});o(P.data.data),i(P.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};D.useEffect(()=>{y(t)},[t,e]);const w=async x=>{m(P=>new Set(P).add(x.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:x}),p({title:"Job Restarted",description:`Job ${x} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${x}. Please try again.`})}finally{m(P=>{const _=new Set(P);return _.delete(x.toString()),_})}},b=async()=>{h(!0),n(1),await y(1),h(!1)},S=x=>new Date(x).toLocaleString(),E=x=>{if(x=parseFloat(x),x<60)return`${x.toFixed(2)}s`;const P=Math.floor(x/60),_=(x%60).toFixed(0);return`${P}m ${_}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(Kp,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(ie,{variant:"outline",size:"icon",onClick:b,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(vr,{children:[l.jsx(yr,{children:l.jsxs(Xe,{children:[l.jsx(nt,{children:"ID"}),l.jsx(nt,{children:"Tên Công Việc"}),l.jsx(nt,{children:"Thời Gian Bắt Đầu"}),l.jsx(nt,{children:"Thời Gian Cập Nhật"}),l.jsx(nt,{children:"Thời Gian Thực Thi"}),l.jsx(nt,{children:"Trạng Thái"}),l.jsx(nt,{children:"Thao Tác"})]})}),l.jsx(wr,{children:a&&r.length===0?l.jsx(Xe,{children:l.jsx(Fe,{colSpan:7,className:"text-center py-4",children:l.jsx(Ce,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var P,_;return l.jsxs(Xe,{children:[l.jsx(Fe,{className:"!w-[100px]",children:x.id}),l.jsx(Fe,{className:"font-medium",children:(P=x.job_name)==null?void 0:P.replace("Upload file","Summary")}),l.jsx(Fe,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(Fe,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(Fe,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(Fe,{className:"!w-[200px]",children:l.jsx(yd,{content:x.status==="fail"&&x.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:x.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]
|
|
137
|
-
${
|
|
141
|
+
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},xm="DialogDescriptionWarning",Cm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kl(xm).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},Sm=Cl,Em=El,Nm=Tl,Ll=Pl,Rl=Al,Vl=Fl,Bl=Dl,Tm=Il;const Ut=Sm,vr=Em,Pm=Nm,zl=d.forwardRef(({className:e,...t},n)=>l.jsx(Ll,{ref:n,className:Q("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}));zl.displayName=Ll.displayName;const Ft=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Pm,{children:[l.jsx(zl,{}),l.jsxs(Rl,{ref:r,className:Q("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(Tm,{className:Q("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($o,{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"})]})]})]}));Ft.displayName=Rl.displayName;const Ot=({className:e,...t})=>l.jsx("div",{className:Q("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ot.displayName="DialogHeader";const Tn=({className:e,...t})=>l.jsx("div",{className:Q("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Tn.displayName="DialogFooter";const Dt=d.forwardRef(({className:e,...t},n)=>l.jsx(Vl,{ref:n,className:Q("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));Dt.displayName=Vl.displayName;const yr=d.forwardRef(({className:e,...t},n)=>l.jsx(Bl,{ref:n,className:Q("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));yr.displayName=Bl.displayName;const Mt=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Q("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}));Mt.displayName="Input";var Am="Label",Hl=d.forwardRef((e,t)=>l.jsx(be.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())}}));Hl.displayName=Am;var Ul=Hl;const _m=Uo("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"}}),jt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Ul,{ref:o,className:Q(_m({variant:t,size:n}),e),...r}));jt.displayName=Ul.displayName;const wr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:Q("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:Q("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));wr.displayName="Table";const br=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:Q("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));br.displayName="TableHeader";const xr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:Q("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));xr.displayName="TableBody";const Fm=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:Q("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Fm.displayName="TableFooter";const Ye=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:Q("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Ye.displayName="TableRow";const st=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:Q("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}));st.displayName="TableHead";const Oe=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:Q("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Oe.displayName="TableCell";const Om=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:Q("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));Om.displayName="TableCaption";function cs(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 an(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 us(...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 ds(...e){return d.useCallback(us(...e),e)}var fs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Mm);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(ps,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ps,{...r,ref:t,children:n})});fs.displayName="Slot";var ps=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=$m(n);return d.cloneElement(n,{...Im(r,n.props),ref:t?us(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ps.displayName="SlotClone";var Dm=({children:e})=>l.jsx(l.Fragment,{children:e});function Mm(e){return d.isValidElement(e)&&e.type===Dm}function Im(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 $m(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 km(e){const t=e+"CollectionProvider",[n,r]=Pt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=ds(v,w.collectionRef);return l.jsx(fs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=D.useRef(null),S=ds(v,b),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(fs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,C)=>w.indexOf(E.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var Wl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Rm);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})});Wl.displayName="Slot";var gs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Bm(n);return d.cloneElement(n,{...Vm(r,n.props),ref:t?us(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});gs.displayName="SlotClone";var Lm=({children:e})=>l.jsx(l.Fragment,{children:e});function Rm(e){return d.isValidElement(e)&&e.type===Lm}function Vm(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 Bm(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 zm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Gl=zm.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Wl: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}},{}),Hm=d.createContext(void 0);function ql(e){const t=d.useContext(Hm);return e||t||"ltr"}var hs="rovingFocusGroup.onEntryFocus",Um={bubbles:!1,cancelable:!0},Cr="RovingFocusGroup",[ms,Kl,jm]=km(Cr),[Wm,Xl]=Pt(Cr,[jm]),[Gm,qm]=Wm(Cr),Jl=d.forwardRef((e,t)=>l.jsx(ms.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(ms.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Km,{...e,ref:t})})}));Jl.displayName=Cr;var Km=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=ds(t,m),v=ql(s),[h=null,y]=Qt({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=Pe(c),E=Kl(n),C=d.useRef(!1),[P,_]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(hs,S),()=>O.removeEventListener(hs,S)},[S]),l.jsx(Gm,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,onItemFocus:d.useCallback(O=>y(O),[y]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>_(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>_(O=>O-1),[]),children:l.jsx(Gl.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:an(e.onMouseDown,()=>{C.current=!0}),onFocus:an(e.onFocus,O=>{const $=!C.current;if(O.target===O.currentTarget&&$&&!w){const F=new CustomEvent(hs,Um);if(O.currentTarget.dispatchEvent(F),!F.defaultPrevented){const G=E().filter(U=>U.focusable),k=G.find(U=>U.active),R=G.find(U=>U.id===h),q=[k,R,...G].filter(Boolean).map(U=>U.ref.current);Ql(q,f)}}C.current=!1}),onBlur:an(e.onBlur,()=>b(!1))})})}),Yl="RovingFocusGroupItem",Zl=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=tn(),u=s||a,c=qm(Yl,n),f=c.currentTabStopId===u,g=Kl(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(ms.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Gl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:an(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:an(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:an(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=Ym(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(b=>b.focusable).map(b=>b.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const b=w.indexOf(v.currentTarget);w=c.loop?Zm(w,b+1):w.slice(b+1)}setTimeout(()=>Ql(w))}})})})});Zl.displayName=Yl;var Xm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jm(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ym(e,t,n){const r=Jm(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Xm[r]}function Ql(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Zm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Qm=Jl,ev=Zl;function ec(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ec(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():ec(e[o],null)}}}}function nv(...e){return d.useCallback(tv(...e),e)}function rv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var tc=e=>{const{present:t,children:n}=e,r=ov(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=nv(r.ref,sv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};tc.displayName="Presence";function ov(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=rv(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]),Ve(()=>{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]),Ve(()=>{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 sv(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 nc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=nc(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():nc(e[o],null)}}}}var rc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(lv);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(vs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(vs,{...r,ref:t,children:n})});rc.displayName="Slot";var vs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=uv(n);return d.cloneElement(n,{...cv(r,n.props),ref:t?iv(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});vs.displayName="SlotClone";var av=({children:e})=>l.jsx(l.Fragment,{children:e});function lv(e){return d.isValidElement(e)&&e.type===av}function cv(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 uv(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 dv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Er=dv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?rc: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}},{}),ys="Tabs",[fv,iC]=Pt(ys,[Xl]),oc=Xl(),[pv,ws]=fv(ys),sc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=ql(a),[g,m]=Qt({prop:r,onChange:o,defaultProp:s});return l.jsx(pv,{scope:n,baseId:tn(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(Er.div,{dir:f,"data-orientation":i,...c,ref:t})})});sc.displayName=ys;var ic="TabsList",ac=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=ws(ic,n),i=oc(n);return l.jsx(Qm,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Er.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});ac.displayName=ic;var lc="TabsTrigger",cc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=ws(lc,n),a=oc(n),u=fc(i.baseId,r),c=pc(i.baseId,r),f=r===i.value;return l.jsx(ev,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(Er.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:cs(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:cs(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:cs(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});cc.displayName=lc;var uc="TabsContent",dc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=ws(uc,n),u=fc(a.baseId,r),c=pc(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(tc,{present:o||f,children:({present:m})=>l.jsx(Er.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})})});dc.displayName=uc;function fc(e,t){return`${e}-trigger-${t}`}function pc(e,t){return`${e}-content-${t}`}var gv=sc,gc=ac,hc=cc,mc=dc;const hv=gv,vc=d.forwardRef(({className:e,...t},n)=>l.jsx(gc,{ref:n,className:Q("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));vc.displayName=gc.displayName;const Nr=d.forwardRef(({className:e,...t},n)=>l.jsx(hc,{ref:n,className:Q("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}));Nr.displayName=hc.displayName;const Tr=d.forwardRef(({className:e,...t},n)=>l.jsx(mc,{ref:n,className:Q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Tr.displayName=mc.displayName;const Pn=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Q("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}));Pn.displayName="Textarea";function mv(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,vv(o,...t)]}function vv(...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 bs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(wv);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(xs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(xs,{...r,ref:t,children:n})});bs.displayName="Slot";var xs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=xv(n);return d.cloneElement(n,{...bv(r,n.props),ref:t?ar(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});xs.displayName="SlotClone";var yv=({children:e})=>l.jsx(l.Fragment,{children:e});function wv(e){return d.isValidElement(e)&&e.type===yv}function bv(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 xv(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 Cv(e){const t=e+"CollectionProvider",[n,r]=mv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=He(v,w.collectionRef);return l.jsx(bs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=D.useRef(null),S=He(v,b),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(bs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,C)=>w.indexOf(E.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var Sv="VisuallyHidden",Cs=d.forwardRef((e,t)=>l.jsx(be.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}}));Cs.displayName=Sv;var Ss="ToastProvider",[Es,Ev,Nv]=Cv("Toast"),[yc,aC]=Pt("Toast",[Nv]),[Tv,Pr]=yc(Ss),wc=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 \`${Ss}\`. Expected non-empty \`string\`.`),l.jsx(Es.Provider,{scope:t,children:l.jsx(Tv,{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})})};wc.displayName=Ss;var bc="ToastViewport",Pv=["F8"],Ns="toast.viewportPause",Ts="toast.viewportResume",xc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Pv,label:o="Notifications ({hotkey})",...s}=e,i=Pr(bc,n),a=Ev(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=He(t,g,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;d.useEffect(()=>{const y=w=>{var S;r.length!==0&&r.every(E=>w[E]||w.code===E)&&((S=g.current)==null||S.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 b=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Ns);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Ts);w.dispatchEvent(P),i.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&S()},C=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",E),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",C),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",C),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[v,i.isClosePausedRef]);const h=d.useCallback(({tabbingDirection:y})=>{const b=a().map(S=>{const E=S.ref.current,C=[E,...Bv(E)];return y==="forwards"?C:C.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=b=>{var C,P,_;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const O=document.activeElement,$=b.shiftKey;if(b.target===y&&$){(C=c.current)==null||C.focus();return}const k=h({tabbingDirection:$?"backwards":"forwards"}),R=k.findIndex(I=>I===O);_s(k.slice(R+1))?b.preventDefault():$?(P=c.current)==null||P.focus():(_=f.current)==null||_.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(mh,{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=h({tabbingDirection:"forwards"});_s(y)}}),l.jsx(Es.Slot,{scope:n,children:l.jsx(be.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(Ps,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});_s(y)}})]})});xc.displayName=bc;var Cc="ToastFocusProxy",Ps=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Pr(Cc,n);return l.jsx(Cs,{"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=Cc;var Ar="Toast",Av="toast.swipeStart",_v="toast.swipeMove",Fv="toast.swipeCancel",Ov="toast.swipeEnd",Sc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=Qt({prop:r,defaultProp:o,onChange:s});return l.jsx(en,{present:n||a,children:l.jsx(Iv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Pe(e.onPause),onResume:Pe(e.onResume),onSwipeStart:ye(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ye(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:ye(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:ye(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)})})})});Sc.displayName=Ar;var[Dv,Mv]=yc(Ar,{onClose(){}}),Iv=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=Pr(Ar,n),[y,w]=d.useState(null),b=He(t,I=>w(I)),S=d.useRef(null),E=d.useRef(null),C=o||h.duration,P=d.useRef(0),_=d.useRef(C),O=d.useRef(0),{onToastAdd:$,onToastRemove:F}=h,G=Pe(()=>{var q;(y==null?void 0:y.contains(document.activeElement))&&((q=h.viewport)==null||q.focus()),i()}),k=d.useCallback(I=>{!I||I===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(G,I))},[G]);d.useEffect(()=>{const I=h.viewport;if(I){const q=()=>{k(_.current),c==null||c()},U=()=>{const J=new Date().getTime()-P.current;_.current=_.current-J,window.clearTimeout(O.current),u==null||u()};return I.addEventListener(Ns,U),I.addEventListener(Ts,q),()=>{I.removeEventListener(Ns,U),I.removeEventListener(Ts,q)}}},[h.viewport,C,u,c,k]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&k(C)},[s,C,h.isClosePausedRef,k]),d.useEffect(()=>($(),()=>F()),[$,F]);const R=d.useMemo(()=>y?Fc(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[R&&l.jsx($v,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),l.jsx(Dv,{scope:n,onClose:G,children:jn.createPortal(l.jsx(Es.ItemSlot,{scope:n,children:l.jsx(hh,{asChild:!0,onEscapeKeyDown:ye(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||G(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(be.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":h.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ye(e.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:ye(e.onPointerDown,I=>{I.button===0&&(S.current={x:I.clientX,y:I.clientY})}),onPointerMove:ye(e.onPointerMove,I=>{if(!S.current)return;const q=I.clientX-S.current.x,U=I.clientY-S.current.y,J=!!E.current,K=["left","right"].includes(h.swipeDirection),ee=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,ce=K?ee(0,q):0,fe=K?0:ee(0,U),Ce=I.pointerType==="touch"?10:2,Ie={x:ce,y:fe},je={originalEvent:I,delta:Ie};J?(E.current=Ie,_r(_v,g,je,{discrete:!1})):Oc(Ie,h.swipeDirection,Ce)?(E.current=Ie,_r(Av,f,je,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(q)>Ce||Math.abs(U)>Ce)&&(S.current=null)}),onPointerUp:ye(e.onPointerUp,I=>{const q=E.current,U=I.target;if(U.hasPointerCapture(I.pointerId)&&U.releasePointerCapture(I.pointerId),E.current=null,S.current=null,q){const J=I.currentTarget,K={originalEvent:I,delta:q};Oc(q,h.swipeDirection,h.swipeThreshold)?_r(Ov,p,K,{discrete:!0}):_r(Fv,m,K,{discrete:!0}),J.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),$v=e=>{const{__scopeToast:t,children:n,...r}=e,o=Pr(Ar,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Rv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(Yo,{asChild:!0,children:l.jsx(Cs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},kv="ToastTitle",Ec=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(be.div,{...r,ref:t})});Ec.displayName=kv;var Lv="ToastDescription",Nc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(be.div,{...r,ref:t})});Nc.displayName=Lv;var Tc="ToastAction",Pc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(_c,{altText:n,asChild:!0,children:l.jsx(As,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Tc}\`. Expected non-empty \`string\`.`),null)});Pc.displayName=Tc;var Ac="ToastClose",As=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Mv(Ac,n);return l.jsx(_c,{asChild:!0,children:l.jsx(be.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,o.onClose)})})});As.displayName=Ac;var _c=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(be.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Fc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Vv(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(...Fc(r))}}),t}function _r(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?Va(o,s):o.dispatchEvent(s)}var Oc=(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 Rv(e=()=>{}){const t=Pe(e);Ve(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Vv(e){return e.nodeType===e.ELEMENT_NODE}function Bv(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 _s(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var zv=wc,Dc=xc,Mc=Sc,Ic=Ec,$c=Nc,kc=Pc,Lc=As;const Hv=zv,Rc=d.forwardRef(({className:e,...t},n)=>l.jsx(Dc,{ref:n,className:Q("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}));Rc.displayName=Dc.displayName;const Uv=Uo("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"}}),Vc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Mc,{ref:r,className:Q(Uv({variant:t}),e),...n}));Vc.displayName=Mc.displayName;const jv=d.forwardRef(({className:e,...t},n)=>l.jsx(kc,{ref:n,className:Q("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}));jv.displayName=kc.displayName;const Bc=d.forwardRef(({className:e,...t},n)=>l.jsx(Lc,{ref:n,className:Q("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($o,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Bc.displayName=Lc.displayName;const zc=d.forwardRef(({className:e,...t},n)=>l.jsx(Ic,{ref:n,className:Q("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));zc.displayName=Ic.displayName;const Hc=d.forwardRef(({className:e,...t},n)=>l.jsx($c,{ref:n,className:Q("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Hc.displayName=$c.displayName;const Wv=1,Gv=1e6;let Fs=0;function qv(){return Fs=(Fs+1)%Number.MAX_SAFE_INTEGER,Fs.toString()}const Os=new Map,Uc=e=>{if(Os.has(e))return;const t=setTimeout(()=>{Os.delete(e),An({type:"REMOVE_TOAST",toastId:e})},Gv);Os.set(e,t)},Kv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Wv)};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?Uc(n):e.toasts.forEach(r=>{Uc(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)}}},Fr=[];let Or={toasts:[]};function An(e){Or=Kv(Or,e),Fr.forEach(t=>{t(Or)})}function Xv({...e}){const t=qv(),n=o=>An({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>An({type:"DISMISS_TOAST",toastId:t});return An({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Ds(){const[e,t]=d.useState(Or);return d.useEffect(()=>(Fr.push(t),()=>{const n=Fr.indexOf(t);n>-1&&Fr.splice(n,1)}),[e]),{...e,toast:Xv,dismiss:n=>An({type:"DISMISS_TOAST",toastId:n})}}function jc(){const{toasts:e}=Ds();return l.jsxs(Hv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(Vc,{...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(zc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Hc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Bc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(Rc,{className:"s3-explr-ui-toast-viewport"})]})}function vt(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 Wc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Jv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Wc(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():Wc(e[o],null)}}}}function _n(...e){return d.useCallback(Jv(...e),e)}var Yv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fn=Yv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Jt: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 Zv(e,t){e&&jn.flushSync(()=>e.dispatchEvent(t))}var Qv="DismissableLayer",Ms="dismissableLayer.update",ey="dismissableLayer.pointerDownOutside",ty="dismissableLayer.focusOutside",Gc,qc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kc=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),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=_n(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),b=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,C=oy(_=>{const O=_.target,$=[...c.branches].some(F=>F.contains(O));!E||$||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=sy(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return Wa(_=>{b===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Gc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Xc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Gc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Xc())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(Ms,_),()=>document.removeEventListener(Ms,_)},[]),l.jsx(Fn.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:vt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:vt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:vt(e.onPointerDownCapture,C.onPointerDownCapture)})});Kc.displayName=Qv;var ny="DismissableLayerBranch",ry=d.forwardRef((e,t)=>{const n=d.useContext(qc),r=d.useRef(null),o=_n(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Fn.div,{...e,ref:o})});ry.displayName=ny;function oy(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Jc(ey,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 sy(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Jc(ty,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 Xc(){const e=new CustomEvent(Ms);document.dispatchEvent(e)}function Jc(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?Zv(o,s):o.dispatchEvent(s)}const iy=["top","right","bottom","left"],It=Math.min,Be=Math.max,Dr=Math.round,Mr=Math.floor,it=e=>({x:e,y:e}),ay={left:"right",right:"left",bottom:"top",top:"bottom"},ly={start:"end",end:"start"};function Is(e,t,n){return Be(e,It(t,n))}function yt(e,t){return typeof e=="function"?e(t):e}function wt(e){return e.split("-")[0]}function ln(e){return e.split("-")[1]}function $s(e){return e==="x"?"y":"x"}function ks(e){return e==="y"?"height":"width"}function $t(e){return["top","bottom"].includes(wt(e))?"y":"x"}function Ls(e){return $s($t(e))}function cy(e,t,n){n===void 0&&(n=!1);const r=ln(e),o=Ls(e),s=ks(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ir(i)),[i,Ir(i)]}function uy(e){const t=Ir(e);return[Rs(e),t,Rs(t)]}function Rs(e){return e.replace(/start|end/g,t=>ly[t])}function dy(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 fy(e,t,n,r){const o=ln(e);let s=dy(wt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Rs)))),s}function Ir(e){return e.replace(/left|right|bottom|top/g,t=>ay[t])}function py(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yc(e){return typeof e!="number"?py(e):{top:e,right:e,bottom:e,left:e}}function $r(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 Zc(e,t,n){let{reference:r,floating:o}=e;const s=$t(t),i=Ls(t),a=ks(i),u=wt(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(ln(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const gy=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}=Zc(c,r,u),m=r,p={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:w}=a[h],{x:b,y:S,data:E,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=b??f,g=S??g,p={...p,[y]:{...p[y],...E}},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}=Zc(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function On(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}=yt(t,e),v=Yc(p),y=a[m?g==="floating"?"reference":"floating":g],w=$r(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})),b=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},C=$r(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:u}):b);return{top:(w.top-C.top+v.top)/E.y,bottom:(C.bottom-w.bottom+v.bottom)/E.y,left:(w.left-C.left+v.left)/E.x,right:(C.right-w.right+v.right)/E.x}}const hy=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}=yt(e,t)||{};if(c==null)return{};const g=Yc(f),m={x:n,y:r},p=Ls(o),v=ks(p),h=await i.getDimensions(c),y=p==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[p]-m[p]-s.floating[v],C=m[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let _=P?P[S]:0;(!_||!await(i.isElement==null?void 0:i.isElement(P)))&&(_=a.floating[S]||s.floating[v]);const O=E/2-C/2,$=_/2-h[v]/2-1,F=It(g[w],$),G=It(g[b],$),k=F,R=_-h[v]-G,I=_/2-h[v]/2+O,q=Is(k,I,R),U=!u.arrow&&ln(o)!=null&&I!==q&&s.reference[v]/2-(I<k?F:G)-h[v]/2<0,J=U?I<k?I-k:I-R:0;return{[p]:m[p]+J,data:{[p]:q,centerOffset:I-q-J,...U&&{alignmentOffset:J}},reset:U}}}),my=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}=yt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=wt(o),b=$t(a),S=wt(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=m||(S||!h?[Ir(a)]:uy(a)),P=v!=="none";!m&&P&&C.push(...fy(a,h,v,E));const _=[a,...C],O=await On(t,y),$=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&$.push(O[w]),g){const I=cy(o,i,E);$.push(O[I[0]],O[I[1]])}if(F=[...F,{placement:o,overflows:$}],!$.every(I=>I<=0)){var G,k;const I=(((G=s.flip)==null?void 0:G.index)||0)+1,q=_[I];if(q)return{data:{index:I,overflows:F},reset:{placement:q}};let U=(k=F.filter(J=>J.overflows[0]<=0).sort((J,K)=>J.overflows[1]-K.overflows[1])[0])==null?void 0:k.placement;if(!U)switch(p){case"bestFit":{var R;const J=(R=F.filter(K=>{if(P){const ee=$t(K.placement);return ee===b||ee==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(ee=>ee>0).reduce((ee,ce)=>ee+ce,0)]).sort((K,ee)=>K[1]-ee[1])[0])==null?void 0:R[0];J&&(U=J);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Qc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eu(e){return iy.some(t=>e[t]>=0)}const vy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=yt(e,t);switch(r){case"referenceHidden":{const s=await On(t,{...o,elementContext:"reference"}),i=Qc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:eu(i)}}}case"escaped":{const s=await On(t,{...o,altBoundary:!0}),i=Qc(s,n.floating);return{data:{escapedOffsets:i,escaped:eu(i)}}}default:return{}}}}};async function yy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=wt(n),a=ln(n),u=$t(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=yt(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 wy=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 yy(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}}}}},by=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:b}=y;return{x:w,y:b}}},...u}=yt(e,t),c={x:n,y:r},f=await On(t,u),g=$t(wt(o)),m=$s(g);let p=c[m],v=c[g];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=p+f[y],S=p-f[w];p=Is(b,p,S)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=v+f[y],S=v-f[w];v=Is(b,v,S)}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}}}}}},xy=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}=yt(e,t),f={x:n,y:r},g=$t(o),m=$s(g);let p=f[m],v=f[g];const h=yt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const S=m==="y"?"height":"width",E=s.reference[m]-s.floating[S]+y.mainAxis,C=s.reference[m]+s.reference[S]-y.mainAxis;p<E?p=E:p>C&&(p=C)}if(c){var w,b;const S=m==="y"?"width":"height",E=["top","left"].includes(wt(o)),C=s.reference[g]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),P=s.reference[g]+s.reference[S]+(E?0:((b=i.offset)==null?void 0:b[g])||0)-(E?y.crossAxis:0);v<C?v=C:v>P&&(v=P)}return{[m]:p,[g]:v}}}},Cy=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}=yt(e,t),f=await On(t,c),g=wt(o),m=ln(o),p=$t(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 b=h-f.top-f.bottom,S=v-f.left-f.right,E=It(h-f[y],b),C=It(v-f[w],S),P=!t.middlewareData.shift;let _=E,O=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=b),P&&!m){const F=Be(f.left,0),G=Be(f.right,0),k=Be(f.top,0),R=Be(f.bottom,0);p?O=v-2*(F!==0||G!==0?F+G:Be(f.left,f.right)):_=h-2*(k!==0||R!==0?k+R:Be(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:_});const $=await i.getDimensions(a.floating);return v!==$.width||h!==$.height?{reset:{rects:!0}}:{}}}};function kr(){return typeof window<"u"}function cn(e){return tu(e)?(e.nodeName||"").toLowerCase():"#document"}function ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function at(e){var t;return(t=(tu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tu(e){return kr()?e instanceof Node||e instanceof ze(e).Node:!1}function Ze(e){return kr()?e instanceof Element||e instanceof ze(e).Element:!1}function lt(e){return kr()?e instanceof HTMLElement||e instanceof ze(e).HTMLElement:!1}function nu(e){return!kr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot}function Dn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Sy(e){return["table","td","th"].includes(cn(e))}function Lr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vs(e){const t=Bs(),n=Ze(e)?Qe(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 Ey(e){let t=kt(e);for(;lt(t)&&!un(t);){if(Vs(t))return t;if(Lr(t))return null;t=kt(t)}return null}function Bs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function un(e){return["html","body","#document"].includes(cn(e))}function Qe(e){return ze(e).getComputedStyle(e)}function Rr(e){return Ze(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(cn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nu(e)&&e.host||at(e);return nu(t)?t.host:t}function ru(e){const t=kt(e);return un(t)?e.ownerDocument?e.ownerDocument.body:e.body:lt(t)&&Dn(t)?t:ru(t)}function Mn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ru(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ze(o);if(s){const a=zs(i);return t.concat(i,i.visualViewport||[],Dn(o)?o:[],a&&n?Mn(a):[])}return t.concat(o,Mn(o,[],n))}function zs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ou(e){const t=Qe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=lt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Dr(n)!==s||Dr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Hs(e){return Ze(e)?e:e.contextElement}function dn(e){const t=Hs(e);if(!lt(t))return it(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ou(t);let i=(s?Dr(n.width):n.width)/r,a=(s?Dr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Ny=it(0);function su(e){const t=ze(e);return!Bs()||!t.visualViewport?Ny:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ty(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ze(e)?!1:t}function Wt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Hs(e);let i=it(1);t&&(r?Ze(r)&&(i=dn(r)):i=dn(e));const a=Ty(s,n,r)?su(s):it(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=ze(s),p=r&&Ze(r)?ze(r):r;let v=m,h=zs(v);for(;h&&r&&p!==v;){const y=dn(h),w=h.getBoundingClientRect(),b=Qe(h),S=w.left+(h.clientLeft+parseFloat(b.paddingLeft))*y.x,E=w.top+(h.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=S,c+=E,v=ze(h),h=zs(v)}}return $r({width:f,height:g,x:u,y:c})}function Us(e,t){const n=Rr(e).scrollLeft;return t?t.left+n:Wt(at(e)).left+n}function iu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Us(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Py(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=at(r),a=t?Lr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=it(1);const f=it(0),g=lt(r);if((g||!g&&!s)&&((cn(r)!=="body"||Dn(i))&&(u=Rr(r)),lt(r))){const p=Wt(r);c=dn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?iu(i,u,!0):it(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 Ay(e){return Array.from(e.getClientRects())}function _y(e){const t=at(e),n=Rr(e),r=e.ownerDocument.body,o=Be(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Be(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Us(e);const a=-n.scrollTop;return Qe(r).direction==="rtl"&&(i+=Be(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Fy(e,t){const n=ze(e),r=at(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=Bs();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function Oy(e,t){const n=Wt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=lt(e)?dn(e):it(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 au(e,t,n){let r;if(t==="viewport")r=Fy(e,n);else if(t==="document")r=_y(at(e));else if(Ze(t))r=Oy(t,n);else{const o=su(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return $r(r)}function lu(e,t){const n=kt(e);return n===t||!Ze(n)||un(n)?!1:Qe(n).position==="fixed"||lu(n,t)}function Dy(e,t){const n=t.get(e);if(n)return n;let r=Mn(e,[],!1).filter(a=>Ze(a)&&cn(a)!=="body"),o=null;const s=Qe(e).position==="fixed";let i=s?kt(e):e;for(;Ze(i)&&!un(i);){const a=Qe(i),u=Vs(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Dn(i)&&!u&&lu(e,i))?r=r.filter(f=>f!==i):o=a,i=kt(i)}return t.set(e,r),r}function My(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Lr(t)?[]:Dy(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=au(t,f,o);return c.top=Be(g.top,c.top),c.right=It(g.right,c.right),c.bottom=It(g.bottom,c.bottom),c.left=Be(g.left,c.left),c},au(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Iy(e){const{width:t,height:n}=ou(e);return{width:t,height:n}}function $y(e,t,n){const r=lt(t),o=at(t),s=n==="fixed",i=Wt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=it(0);if(r||!r&&!s)if((cn(t)!=="body"||Dn(o))&&(a=Rr(t)),r){const m=Wt(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Us(o));const c=o&&!r&&!s?iu(o,a):it(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 js(e){return Qe(e).position==="static"}function cu(e,t){if(!lt(e)||Qe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return at(e)===n&&(n=n.ownerDocument.body),n}function uu(e,t){const n=ze(e);if(Lr(e))return n;if(!lt(e)){let o=kt(e);for(;o&&!un(o);){if(Ze(o)&&!js(o))return o;o=kt(o)}return n}let r=cu(e,t);for(;r&&Sy(r)&&js(r);)r=cu(r,t);return r&&un(r)&&js(r)&&!Vs(r)?n:r||Ey(e)||n}const ky=async function(e){const t=this.getOffsetParent||uu,n=this.getDimensions,r=await n(e.floating);return{reference:$y(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ly(e){return Qe(e).direction==="rtl"}const Ry={convertOffsetParentRelativeRectToViewportRelativeRect:Py,getDocumentElement:at,getClippingRect:My,getOffsetParent:uu,getElementRects:ky,getClientRects:Ay,getDimensions:Iy,getScale:dn,isElement:Ze,isRTL:Ly};function Vy(e,t){let n=null,r;const o=at(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=Mr(f),v=Mr(o.clientWidth-(c+g)),h=Mr(o.clientHeight-(f+m)),y=Mr(c),b={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Be(0,It(1,u))||1};let S=!0;function E(C){const P=C[0].intersectionRatio;if(P!==u){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return i(!0),s}function By(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=Hs(e),f=o||s?[...c?Mn(c):[],...Mn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?Vy(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?Wt(e):null;u&&y();function y(){const w=Wt(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(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const zy=wy,Hy=by,Uy=my,jy=Cy,Wy=vy,du=hy,Gy=xy,qy=(e,t,n)=>{const r=new Map,o={platform:Ry,...n},s={...o.platform,_c:r};return gy(e,t,{...o,platform:s})};var Vr=typeof document<"u"?D.useLayoutEffect:D.useEffect;function Br(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(!Br(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)&&!Br(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function fu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pu(e,t){const n=fu(e);return Math.round(t*n)/n}function Ws(e){const t=d.useRef(e);return Vr(()=>{t.current=e}),t}function Ky(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);Br(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),b=d.useCallback(K=>{K!==P.current&&(P.current=K,h(K))},[]),S=d.useCallback(K=>{K!==_.current&&(_.current=K,w(K))},[]),E=s||v,C=i||y,P=d.useRef(null),_=d.useRef(null),O=d.useRef(f),$=u!=null,F=Ws(u),G=Ws(o),k=Ws(c),R=d.useCallback(()=>{if(!P.current||!_.current)return;const K={placement:t,strategy:n,middleware:m};G.current&&(K.platform=G.current),qy(P.current,_.current,K).then(ee=>{const ce={...ee,isPositioned:k.current!==!1};I.current&&!Br(O.current,ce)&&(O.current=ce,jn.flushSync(()=>{g(ce)}))})},[m,t,n,G,k]);Vr(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(K=>({...K,isPositioned:!1})))},[c]);const I=d.useRef(!1);Vr(()=>(I.current=!0,()=>{I.current=!1}),[]),Vr(()=>{if(E&&(P.current=E),C&&(_.current=C),E&&C){if(F.current)return F.current(E,C,R);R()}},[E,C,R,F,$]);const q=d.useMemo(()=>({reference:P,floating:_,setReference:b,setFloating:S}),[b,S]),U=d.useMemo(()=>({reference:E,floating:C}),[E,C]),J=d.useMemo(()=>{const K={position:n,left:0,top:0};if(!U.floating)return K;const ee=pu(U.floating,f.x),ce=pu(U.floating,f.y);return a?{...K,transform:"translate("+ee+"px, "+ce+"px)",...fu(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:ce}},[n,a,U.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:R,refs:q,elements:U,floatingStyles:J}),[f,R,q,U,J])}const Xy=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?du({element:r.current,padding:o}).fn(n):{}:r?du({element:r,padding:o}).fn(n):{}}}},Jy=(e,t)=>({...zy(e),options:[e,t]}),Yy=(e,t)=>({...Hy(e),options:[e,t]}),Zy=(e,t)=>({...Gy(e),options:[e,t]}),Qy=(e,t)=>({...Uy(e),options:[e,t]}),ew=(e,t)=>({...jy(e),options:[e,t]}),tw=(e,t)=>({...Wy(e),options:[e,t]}),nw=(e,t)=>({...Xy(e),options:[e,t]});var rw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ow=rw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Jt: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}},{}),sw="Arrow",gu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(ow.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"})})});gu.displayName=sw;var iw=gu;function hu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function aw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=hu(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():hu(e[o],null)}}}}function mu(...e){return d.useCallback(aw(...e),e)}var lw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],vu=lw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Jt: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}},{}),Gs="Popper",[yu,wu]=Pt(Gs),[cw,bu]=yu(Gs),xu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(cw,{scope:t,anchor:r,onAnchorChange:o,children:n})};xu.displayName=Gs;var Cu="PopperAnchor",Su=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=bu(Cu,n),i=d.useRef(null),a=mu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(vu.div,{...o,ref:a})});Su.displayName=Cu;var qs="PopperContent",[uw,dw]=yu(qs),Eu=d.forwardRef((e,t)=>{var Ne,Te,$e,Rt,tt,hn;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=bu(qs,n),[w,b]=d.useState(null),S=mu(t,Ge=>b(Ge)),[E,C]=d.useState(null),P=La(E),_=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,$=r+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(c)?c:[c],k=G.length>0,R={padding:F,boundary:G.filter(pw),altBoundary:k},{refs:I,floatingStyles:q,placement:U,isPositioned:J,middlewareData:K}=Ky({strategy:"fixed",placement:$,whileElementsMounted:(...Ge)=>By(...Ge,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[Jy({mainAxis:o+O,alignmentAxis:i}),u&&Yy({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Zy():void 0,...R}),u&&Qy({...R}),ew({...R,apply:({elements:Ge,rects:ft,availableWidth:mn,availableHeight:Hn})=>{const{width:vn,height:x}=ft.reference,N=Ge.floating.style;N.setProperty("--radix-popper-available-width",`${mn}px`),N.setProperty("--radix-popper-available-height",`${Hn}px`),N.setProperty("--radix-popper-anchor-width",`${vn}px`),N.setProperty("--radix-popper-anchor-height",`${x}px`)}}),E&&nw({element:E,padding:a}),gw({arrowWidth:_,arrowHeight:O}),m&&tw({strategy:"referenceHidden",...R})]}),[ee,ce]=Pu(U),fe=Pe(v);Ve(()=>{J&&(fe==null||fe())},[J,fe]);const Ce=(Ne=K.arrow)==null?void 0:Ne.x,Ie=(Te=K.arrow)==null?void 0:Te.y,je=(($e=K.arrow)==null?void 0:$e.centerOffset)!==0,[We,we]=d.useState();return Ve(()=>{w&&we(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:J?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:We,"--radix-popper-transform-origin":[(Rt=K.transformOrigin)==null?void 0:Rt.x,(tt=K.transformOrigin)==null?void 0:tt.y].join(" "),...((hn=K.hide)==null?void 0:hn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(uw,{scope:n,placedSide:ee,onArrowChange:C,arrowX:Ce,arrowY:Ie,shouldHideArrow:je,children:l.jsx(vu.div,{"data-side":ee,"data-align":ce,...h,ref:S,style:{...h.style,animation:J?void 0:"none"}})})})});Eu.displayName=qs;var Nu="PopperArrow",fw={top:"bottom",right:"left",bottom:"top",left:"right"},Tu=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=dw(Nu,r),i=fw[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(iw,{...o,ref:n,style:{...o.style,display:"block"}})})});Tu.displayName=Nu;function pw(e){return e!==null}var gw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,b;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]=Pu(n),g={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((b=o.arrow)==null?void 0:b.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 Pu(e){const[t,n="center"]=e.split("-");return[t,n]}var hw=xu,mw=Su,vw=Eu,yw=Tu,ww="Portal",Au=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Ve(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?no.createPortal(l.jsx(Fn.div,{...r,ref:t}),i):null});Au.displayName=ww;function bw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Ks=e=>{const{present:t,children:n}=e,r=xw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=_n(r.ref,Cw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Ks.displayName="Presence";function xw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=bw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=zr(r.current);s.current=a==="mounted"?c:"none"},[a]),Ve(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=zr(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]),Ve(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=zr(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=zr(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 zr(e){return(e==null?void 0:e.animationName)||"none"}function Cw(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 Sw="VisuallyHidden",_u=d.forwardRef((e,t)=>l.jsx(Fn.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}}));_u.displayName=Sw;var Ew=_u,[Hr,lC]=Pt("Tooltip",[wu]),Ur=wu(),Fu="TooltipProvider",Nw=700,Xs="tooltip.open",[Tw,Js]=Hr(Fu),Ou=e=>{const{__scopeTooltip:t,delayDuration:n=Nw,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(Tw,{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})};Ou.displayName=Fu;var jr="Tooltip",[Pw,In]=Hr(jr),Du=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Js(jr,e.__scopeTooltip),c=Ur(t),[f,g]=d.useState(null),m=tn(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=Qt({prop:r,defaultProp:o,onChange:_=>{_?(u.onOpen(),document.dispatchEvent(new CustomEvent(Xs))):u.onClose(),s==null||s(_)}}),S=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),C=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),P=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},h)},[h,b]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(hw,{...c,children:l.jsx(Pw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?P():E()},[u.isOpenDelayed,P,E]),onTriggerLeave:d.useCallback(()=>{v?C():(window.clearTimeout(p.current),p.current=0)},[C,v]),onOpen:E,onClose:C,disableHoverableContent:v,children:n})})};Du.displayName=jr;var Ys="TooltipTrigger",Mu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=In(Ys,n),s=Js(Ys,n),i=Ur(n),a=d.useRef(null),u=_n(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(mw,{asChild:!0,...i,children:l.jsx(Fn.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:vt(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:vt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:vt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:vt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:vt(e.onBlur,o.onClose),onClick:vt(e.onClick,o.onClose)})})});Mu.displayName=Ys;var Zs="TooltipPortal",[Aw,_w]=Hr(Zs,{forceMount:void 0}),Iu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=In(Zs,t);return l.jsx(Aw,{scope:t,forceMount:n,children:l.jsx(Ks,{present:n||s.open,children:l.jsx(Au,{asChild:!0,container:o,children:r})})})};Iu.displayName=Zs;var fn="TooltipContent",$u=d.forwardRef((e,t)=>{const n=_w(fn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=In(fn,e.__scopeTooltip);return l.jsx(Ks,{present:r||i.open,children:i.disableHoverableContent?l.jsx(ku,{side:o,...s,ref:t}):l.jsx(Fw,{side:o,...s,ref:t})})}),Fw=d.forwardRef((e,t)=>{const n=In(fn,e.__scopeTooltip),r=Js(fn,e.__scopeTooltip),o=d.useRef(null),s=_n(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},b=Iw(w,y.getBoundingClientRect()),S=$w(w,b),E=kw(h.getBoundingClientRect()),C=Rw([...S,...E]);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},b=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),S=!Lw(w,i);b?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(ku,{...e,ref:s})}),[Ow,Dw]=Hr(jr,{isInside:!1}),ku=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=In(fn,n),c=Ur(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(Xs,f),()=>document.removeEventListener(Xs,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(Kc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(vw,{"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(xa,{children:r}),l.jsx(Ow,{scope:n,isInside:!0,children:l.jsx(Ew,{id:u.contentId,role:"tooltip",children:o||r})})]})})});$u.displayName=fn;var Lu="TooltipArrow",Mw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ur(n);return Dw(Lu,n).isInside?null:l.jsx(yw,{...o,...r,ref:t})});Mw.displayName=Lu;function Iw(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 $w(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 Lw(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 Rw(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),Vw(t)}function Vw(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 Bw=Ou,zw=Du,Hw=Mu,Uw=Iu,Ru=$u;const Vu=Bw,Bu=zw,zu=Hw,Qs=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Uw,{children:l.jsx(Ru,{ref:r,sideOffset:t,className:Q("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})}));Qs.displayName=Ru.displayName;function jw({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 Ww=d.forwardRef(jw);var Gw=function(e){return function(t,n){var r=D.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Hu=function(e){return typeof e=="function"},Uu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const qw=Gw(D.useEffect);function ju(e){var t=D.useRef(e);return t.current=e,t}var Kw=function(e){Uu&&(Hu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=ju(e);D.useEffect(function(){return function(){t.current()}},[])},Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Wu=Jw,Yw=typeof Wr=="object"&&Wr&&Wr.Object===Object&&Wr,Zw=Yw,Qw=Zw,eb=typeof self=="object"&&self&&self.Object===Object&&self,tb=Qw||eb||Function("return this")(),Gu=tb,nb=Gu,rb=function(){return nb.Date.now()},ob=rb,sb=/\s/;function ib(e){for(var t=e.length;t--&&sb.test(e.charAt(t)););return t}var ab=ib,lb=ab,cb=/^\s+/;function ub(e){return e&&e.slice(0,lb(e)+1).replace(cb,"")}var db=ub,fb=Gu,pb=fb.Symbol,qu=pb,Ku=qu,Xu=Object.prototype,gb=Xu.hasOwnProperty,hb=Xu.toString,$n=Ku?Ku.toStringTag:void 0;function mb(e){var t=gb.call(e,$n),n=e[$n];try{e[$n]=void 0;var r=!0}catch{}var o=hb.call(e);return r&&(t?e[$n]=n:delete e[$n]),o}var vb=mb,yb=Object.prototype,wb=yb.toString;function bb(e){return wb.call(e)}var xb=bb,Ju=qu,Cb=vb,Sb=xb,Eb="[object Null]",Nb="[object Undefined]",Yu=Ju?Ju.toStringTag:void 0;function Tb(e){return e==null?e===void 0?Nb:Eb:Yu&&Yu in Object(e)?Cb(e):Sb(e)}var Pb=Tb;function Ab(e){return e!=null&&typeof e=="object"}var _b=Ab,Fb=Pb,Ob=_b,Db="[object Symbol]";function Mb(e){return typeof e=="symbol"||Ob(e)&&Fb(e)==Db}var Ib=Mb,$b=db,Zu=Wu,kb=Ib,Qu=NaN,Lb=/^[-+]0x[0-9a-f]+$/i,Rb=/^0b[01]+$/i,Vb=/^0o[0-7]+$/i,Bb=parseInt;function zb(e){if(typeof e=="number")return e;if(kb(e))return Qu;if(Zu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Zu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$b(e);var n=Rb.test(e);return n||Vb.test(e)?Bb(e.slice(2),n?2:8):Lb.test(e)?Qu:+e}var Hb=zb,Ub=Wu,ei=ob,ed=Hb,jb="Expected a function",Wb=Math.max,Gb=Math.min;function qb(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(jb);t=ed(t)||0,Ub(n)&&(f=!!n.leading,g="maxWait"in n,s=g?Wb(ed(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(P){var _=r,O=o;return r=o=void 0,c=P,i=e.apply(O,_),i}function v(P){return c=P,a=setTimeout(w,t),f?p(P):i}function h(P){var _=P-u,O=P-c,$=t-_;return g?Gb($,s-O):$}function y(P){var _=P-u,O=P-c;return u===void 0||_>=t||_<0||g&&O>=s}function w(){var P=ei();if(y(P))return b(P);a=setTimeout(w,h(P))}function b(P){return a=void 0,m&&r?p(P):(r=o=void 0,i)}function S(){a!==void 0&&clearTimeout(a),c=0,r=u=o=a=void 0}function E(){return a===void 0?i:b(ei())}function C(){var P=ei(),_=y(P);if(r=arguments,o=this,u=P,_){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=S,C.flush=E,C}var Kb=qb;const Xb=Xw(Kb);function Jb(){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}Jb()||(global.Date=Date);function Yb(e,t){var n;Uu&&(Hu(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=D.useMemo(function(){return Xb(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,il([],sl(i),!1))},o,t)},[]);return Kw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function Zb(e,t,n){var r=sl(D.useState({}),2),o=r[0],s=r[1],i=Yb(function(){s({})},n).run;D.useEffect(function(){return i()},t),qw(e,[o])}const Qb=D.forwardRef(({onChange:e},t)=>{const n=D.useRef(null),[r,o]=D.useState("");return D.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),Zb(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(Mt,{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(Ww,{className:"h-5 w-5"})})]})}),De={current:!1},td="crawl:jobs",pn="crawl:current_job",ex=e=>{const[t,n]=D.useState(null),[r,o]=D.useState(0);return D.useEffect(()=>{const s=localStorage.getItem(pn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),D.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]),D.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await ie.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(pn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(pn)},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(pn,JSON.stringify(s)):localStorage.removeItem(pn)}}},tx=(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},Gr=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},nx=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Gr(e,o.key))}),n},rx=(e,t,n=[])=>{const[r,o]=D.useState({}),[s,i]=D.useState(!1),[a,u]=D.useState(null),c=D.useRef(t);D.useEffect(()=>{c.current=t},[t]);const f=async()=>{i(!0);try{const g=!De.current;De.current&&(De.current=!1);const m=await ie.get(`${e}/api/files`,{params:{cache:g,displayPrefixes:JSON.stringify(n),prefix:c.current},timeout:3e5});o(m.data),u(null)}catch(g){u(g instanceof Error?g:new Error("Failed to fetch files"))}finally{i(!1)}};return D.useEffect(()=>{f()},[]),{data:r,isLoading:s,error:a,refetch:f}},kn=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||"")},ox=D.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3002",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var Td;const[i,a]=D.useState(""),[u,c]=D.useState(new Set),[f,g]=D.useState(n),[m,p]=D.useState(null),[v,h]=D.useState(!1),[y,w]=D.useState(""),[b,S]=D.useState(!1),[E,C]=D.useState(null),[P,_]=D.useState(!1),[O,$]=D.useState(!1),[F,G]=D.useState(null),k=D.useRef(null),{toast:R}=Ds(),[I,q]=D.useState(null),[U,J]=D.useState(null),[K,ee]=D.useState(""),[ce,fe]=D.useState(!1),[Ce,Ie]=D.useState(new Set),[je,We]=D.useState(""),[we,Ne]=D.useState(!1),[Te,$e]=D.useState(!1),[Rt,tt]=D.useState("rename"),[hn,Ge]=D.useState(!1),[ft,mn]=D.useState(""),[Hn,vn]=D.useState("1"),[x,N]=D.useState(!1),[A,z]=D.useState(!1),[B,V]=D.useState(!1),[X,oe]=D.useState(!1),{currentJob:te,elapsedTime:pe,setCurrentJob:pt}=ex(t),gi=m||n,{data:_e,isLoading:qt,error:hi,refetch:ke}=rx(t,gi,s);D.useEffect(()=>{te!=null&&te.status&&(te.status.status==="completed"?(R({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${te.url} với ${te.status.completed} trang`}),De.current=!0,ke()):te.status.status==="failed"&&R({title:"Thu thập website thất bại",description:`Không thể thu thập ${te.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Td=te==null?void 0:te.status)==null?void 0:Td.status]);const Qr=D.useMemo(()=>_e[f]||[],[_e,f]),gt=D.useMemo(()=>i?tx(_e,i,f):Qr,[Qr,i,f,_e]),Un=D.useMemo(()=>{const M={};return gt.forEach((L,H)=>{u.has(L.key)&&(M[H]=!0)}),M},[u,gt]),_x=M=>{const L=Gr(_e,M);if(L.length===0)return u.has(M)?"all":"none";const H=L.filter(W=>u.has(W)).length;return H===0?"none":H===L.length?"all":"partial"},eo=M=>{oe(!0),p(M),g(M)};D.useEffect(()=>{X&&(De.current=!0,ke().finally(()=>oe(!1)))},[X]);const Fx=async(M,L)=>{S(!0);try{const H=`${L}${M}/`;if((await ie.post(`${t}/api/create-folder`,{prefix:H})).status!==200){R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}De.current=!0,await ke(),R({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${M}"`}),w(""),h(!1)}catch(H){console.error("Error creating folder:",H),R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{S(!1)}},Cd=async(M,L,H)=>{G(H),z(!0);try{if(sg(M,R))return;let W=localStorage.getItem("dataLogin"),se;try{W&&(W=JSON.parse(W),se=W.user)}catch{W=null}const ae=new FormData;ae.append("prefix",L),Array.from(M).forEach(he=>ae.append("files",he)),se!=null&&se.id&&(console.log("🚀 ~ uploadFiles ~ user:",se),ae.append("metadata",JSON.stringify({creator:se.username,creatorId:se.id,DataSource:"Tệp tải lên"}))),await ie.post(`${t}/api/upload`,ae,{headers:{"Content-Type":"multipart/form-data"}}),p(L),De.current=!0,await ke()}catch(W){console.error("Lỗi tải lên:",W)}finally{G(null),z(!1)}},Ox=async M=>{var L;V(!0);try{await ie.delete(`${t}/api/files`,{data:{paths:[M.key]}});const H=((L=M.key)==null?void 0:L.replace(/^(.*?)(\/.*)?$/,(W,se,ae)=>!ae||ae==="/"?"":se+"/"))||"";p(H),De.current=!0,R({title:"Đã xóa tập tin",description:`Đã xóa thành công "${M.name}"`}),C(null)}catch(H){console.error("Error deleting file:",H),R({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{V(!1),await ke()}},to=M=>{const L=new Set(u),H=typeof M=="function"?M(Un):M;new Set(Object.keys(Un).map(Number)).forEach(se=>{const ae=gt[se];ae&&(H[se]||(L.delete(ae.key),ae.isFolder&&Gr(_e,ae.key).forEach(he=>L.delete(he))))}),Object.entries(H).forEach(([se,ae])=>{const he=parseInt(se),Ct=gt[he];Ct&&ae&&(L.add(Ct.key),Ct.isFolder&&Gr(_e,Ct.key).forEach(vi=>L.add(vi)))}),c(L)},Dx=async()=>{var M;_(!0);try{const L=Array.from(u),H=L.map(se=>Object.values(_e).flat().find(ae=>ae.key===se)).filter(se=>se!==void 0);if(H.length===0){R({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await ie.delete(`${t}/api/files`,{data:{paths:L}});const W=((M=H[0])==null?void 0:M.key.replace(/^(.*?)(\/.*)?$/,(se,ae,he)=>!he||he==="/"?"":ae+"/"))||"";p(W),De.current=!0,ke(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công ${H.length} mục`}),$(!1),c(new Set)}catch(L){console.error("Error deleting files:",L),R({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{_(!1)}},Mx=async(M,L)=>{fe(!0);try{const H=M.key;let W;M.isFolder?W=H.split("/").slice(0,-2).join("/")+"/":W=H.substring(0,H.lastIndexOf("/")+1);const se=W+L+(M.isFolder?"/":"");await ie.post(`${t}/api/rename`,{oldPath:H,newPath:se}),De.current=!0,await ke(),R({title:"Đã đổi tên",description:`Đã đổi tên thành công "${M.name}" thành "${L}"`}),q(null),ee(""),J(null)}catch(H){console.error("Error renaming item:",H),R({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{fe(!1)}},Sd=async M=>{Ie(L=>new Set([...L,...M]));try{const L=await ie.post(`${t}/api/download`,{paths:M},{responseType:"blob"}),H=window.URL.createObjectURL(L.data),W=document.createElement("a");W.href=H;const se=L.headers["Content-Disposition"]||L.headers["content-disposition"],ae=se==null?void 0:se.match(/filename="(.+)"/),he=ae?decodeURIComponent(ae[1]):"download.zip";W.setAttribute("download",he),document.body.appendChild(W),W.click(),document.body.removeChild(W),window.URL.revokeObjectURL(H),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(L){console.error("Error downloading files:",L),R({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Ie(L=>{const H=new Set(L);return M.forEach(W=>H.delete(W)),H})}},Ed=f?f.replace(n,"").split("/").filter(Boolean):[],Ix=()=>Array.from(u).map(M=>{var L;for(const H in _e){const W=(L=_e[H])==null?void 0:L.find(se=>se.key===M);if(W)return W}return null}).filter(M=>M!==null),Nd=D.useMemo(()=>{const M=[{id:"select",header:()=>{const L=nx(_e,f),H=L.length>0&&L.every(se=>u.has(se)),W=L.some(se=>u.has(se));return l.jsx(Go,{checked:H?!0:W?"indeterminate":!1,onCheckedChange:se=>{if(se){const ae=gt.reduce((he,Ct,vi)=>(he[vi]=!0,he),{});to(ae)}else to({})},"aria-label":"Chọn tất cả"})},cell:({row:L})=>{const H=L.original,se=H.isFolder?_x(H.key):u.has(H.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(Go,{checked:se==="partial"?"indeterminate":se==="all",onCheckedChange:ae=>{const he={...Un};ae?he[L.index]=!0:delete he[L.index],to(he)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:L})=>{const H=L.original,W=H.key.substring(0,H.key.lastIndexOf("/"))||"/",se=i.trim()!==""&&W!==f,ae=W.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${H.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{H.isFolder&&eo(H.key)},children:[H.isFolder?l.jsx(ro,{className:"h-5 w-5 text-blue-500"}):null,H.name]}),se&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(ro,{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:()=>{eo("")},children:"/"}),ae.map((he,Ct)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{eo(ae.slice(0,Ct+1).join("/")+"/")},children:he}),Ct<ae.length-1&&l.jsx("span",{children:"/"})]},Ct))]})]})]})}}];return r||M.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:L,row:H})=>{const W=L();return l.jsx("span",{children:H.original.isFolder?"-":zg(W)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:L})=>{const H=L.original.lastModified;return l.jsx("span",{children:H.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:L})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>Sd([L.original.key]),className:"h-8 w-8 p-0",disabled:Ce.has(L.original.key),children:Ce.has(L.original.key)?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):l.jsx(wi,{className:"h-4 w-4"})}),l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>{q(L.original),ee(L.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Rd,{className:"h-4 w-4"})}),l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>C(L.original),className:"h-8 w-8 p-0",children:l.jsx(bi,{className:"h-4 w-4"})})]})}),M},[u,gt,Un,Ce,r]),mi=Mi({data:gt,columns:Nd,state:{rowSelection:Un},enableRowSelection:!0,onRowSelectionChange:to,getCoreRowModel:Di()}),$x=async M=>{var L,H;Ne(!0);try{if(kn(M)){const W=await ie.get(`${t}/api/read-text`,{params:{path:M.key}});We(W.data.content)}try{const W=await ie.get(`${t}/api/read-json`,{params:{path:M.key+".metadata.json"}});return console.log("🚀 ~ loadFileContent ~ responseMetadata:",W),J(((H=(L=W==null?void 0:W.data)==null?void 0:L.content)==null?void 0:H.metadataAttributes)||null)}catch{return J("Lỗi phân tích siêu dữ liệu")}}catch(W){console.error("Error loading file content:",W),R({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{Ne(!1)}},kx=async(M,L)=>{$e(!0);try{await ie.post(`${t}/api/modify-text`,{path:M.key,content:L}),R({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),De.current=!0,await ke(),q(null),We(""),tt("rename")}catch(H){console.error("Error saving file content:",H),R({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{$e(!1)}},Lx=async M=>{$e(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",U),await ie.post(`${t}/api/modify-json`,{path:M.key+".metadata.json",content:{metadataAttributes:U}}),R({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),De.current=!0,await ke(),q(null),We(""),tt("rename")}catch(L){console.error("Error saving file content:",L),R({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{$e(!1)}};D.useEffect(()=>{I&&($x(I),tt("rename"))},[I]);const Rx=async(M,L)=>{var H;if(te){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}N(!0);try{const{data:W}=await ie.post(`${t}/api/crawl`,{url:M,limit:L,prefix:f});if(W.id){pt({id:W.id,url:M,limit:L,prefix:f,taskId:((H=W.task)==null?void 0:H.id)||""});const se=localStorage.getItem(td),ae=se?JSON.parse(se):[];ae.some(he=>he.id===W.id)||(ae.unshift({url:M,id:W.id,limit:L,prefix:f,timestamp:Date.now()}),ae.length>20&&(ae.length=20),localStorage.setItem(td,JSON.stringify(ae))),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 ${L}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),Ge(!1),mn(""),vn("1")}}catch(W){console.error("Error crawling website:",W),R({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{N(!1)}},Vx=async()=>{try{if(!(te!=null&&te.id))return;pt(null),localStorage.removeItem(pn),R({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${te.url}`})}catch(M){console.error("Error stopping job:",M),R({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(Oa,{className:"s3-explr-breadcrumb",children:l.jsxs(Da,{className:"s3-explr-breadcrumb-list",children:[l.jsx(zo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Ho,{onClick:()=>{p(""),g(""),De.current=!0,setTimeout(()=>{ke()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Ed.map((M,L)=>l.jsxs(l.Fragment,{children:[l.jsx(Ma,{className:"s3-explr-breadcrumb-separator"},`sep-${L}`),l.jsx(zo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Ho,{onClick:()=>eo(n+Ed.slice(0,L+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(Qb,{ref:k,onChange:M=>a(M)})}),l.jsxs(le,{variant:"outline",size:"sm",onClick:()=>{p(f),De.current=!0,ke()},disabled:qt,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(_d,{className:`h-4 w-4 s3-explr-refresh-icon ${qt?"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:()=>Sd(Array.from(u)),disabled:Array.from(u).some(M=>Ce.has(M)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(M=>Ce.has(M))?l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(wi,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(Ut,{open:O,onOpenChange:$,children:[l.jsx(vr,{asChild:!0,children:l.jsxs(le,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(bi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(Ft,{className:"s3-explr-dialog-content",children:[l.jsxs(Ot,{className:"s3-explr-dialog-header",children:[l.jsx(Dt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(yr,{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(Tn,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>$(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{variant:"destructive",onClick:Dx,disabled:P,className:"s3-explr-confirm-delete-btn",children:P?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(Ut,{open:v,onOpenChange:h,children:[l.jsx(vr,{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(Md,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(Ft,{className:"s3-explr-dialog-content",children:[l.jsx(Ot,{className:"s3-explr-dialog-header",children:l.jsx(Dt,{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(jt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(Mt,{disabled:b,id:"name",value:y,onChange:M=>w(M.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(le,{onClick:()=>{y.trim()&&Fx(y,f)},disabled:b,className:"s3-explr-create-btn",children:[b&&l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),b?"Đ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=L=>{const H=L.target.files;H&&Cd(H,f,"files")},M.click()},disabled:F!==null||!!s&&!f,children:F==="files"?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Od,{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=L=>{const H=L.target.files;H&&Cd(H,f,"folder")},M.click()},disabled:F!==null||!!s&&!f,children:F==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(ro,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),te?l.jsx(Vu,{delayDuration:0,children:l.jsxs(Bu,{children:[l.jsx(zu,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(ve,{className:"h-4 w-4 animate-spin s3-explr-loader"}),te.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",te.status.completed,"/",te.status.total,") - ",Math.floor(pe/60),":",String(pe%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(le,{variant:"destructive",size:"sm",onClick:()=>void Vx(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(Bd,{className:"h-4 w-4"})]})]})}),te.status&&l.jsx(Qs,{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 ",te.url]}),l.jsxs("p",{children:["Tiến độ: ",te.status.completed,"/",te.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(pe/60),":",String(pe%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",te.status.status==="scraping"?"Đang thu thập":te.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Ut,{open:hn,onOpenChange:Ge,children:[l.jsx(vr,{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(kd,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(Ft,{className:"s3-explr-dialog-content",children:[l.jsxs(Ot,{className:"s3-explr-dialog-header",children:[l.jsx(Dt,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(yr,{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(jt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(Mt,{id:"websiteUrl",value:ft,onChange:M=>mn(M.target.value),placeholder:"https://example.com",type:"url",disabled:x,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(jt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(Mt,{id:"crawlLimit",value:Hn,onChange:M=>{const L=M.target.value;/^\d*$/.test(L)&&vn(L)},placeholder:"1",type:"text",disabled:x,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(Tn,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>{Ge(!1),mn(""),vn("1")},disabled:x,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{onClick:()=>{ft.trim()&&Rx(ft.trim(),parseInt(Hn)||1)},disabled:x||!ft.trim(),className:"s3-explr-crawl-btn",children:x?l.jsxs(l.Fragment,{children:[l.jsx(ve,{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:!!E,onOpenChange:M=>!M&&C(null),children:l.jsxs(Ft,{className:"s3-explr-dialog-content",children:[l.jsxs(Ot,{className:"s3-explr-dialog-header",children:[l.jsx(Dt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(yr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",E==null?void 0:E.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(Tn,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>C(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{variant:"destructive",onClick:()=>Ox(E),disabled:B,className:"s3-explr-confirm-delete-btn",children:B?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(Ut,{open:!!I,onOpenChange:M=>{M||(q(null),J(null),ee(""),We(""),tt("rename"))},children:l.jsxs(Ft,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(Ot,{className:"s3-explr-dialog-header",children:l.jsx(Dt,{className:"s3-explr-dialog-title",children:I!=null&&I.isFolder?"Đổi tên thư mục":kn(I)?"Quản lý tập tin":"Đổi tên tập tin"})}),I&&!I.isFolder&&l.jsxs(hv,{value:Rt,onValueChange:M=>tt(M),children:[l.jsxs(vc,{"aria-checked":!kn(I),className:"grid w-full grid-cols-3 aria-checked:grid-cols-2",children:[l.jsx(Nr,{value:"rename",children:"Đổi tên"}),kn(I)&&l.jsx(Nr,{value:"edit",children:"Sửa nội dung"}),l.jsx(Nr,{value:"edit-metadata",children:"Sửa metadata file"})]}),l.jsx(Tr,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[l.jsx(jt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Mt,{id:"newName",value:K,onChange:M=>ee(M.target.value),placeholder:"Nhập tên mới",disabled:ce,className:"s3-explr-input"})]})})}),kn(I)&&l.jsx(Tr,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:we?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ve,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:[l.jsx(jt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Pn,{id:"content",value:je,onChange:M=>We(M.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Te})]})})}),l.jsx(Tr,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:we?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ve,{className:"h-6 w-6 animate-spin"})}):l.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:U&&typeof U=="object"&&Object.entries(U).map(([M,L])=>l.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[l.jsxs(jt,{htmlFor:M,className:"s3-explr-label flex items-center gap-1",children:[rg[M]||M,ko(M)&&l.jsx(tg,{className:"h-[12px] w-[12px] text-red-500"})]}),og(M)?l.jsx(Pn,{id:M,value:typeof L=="string"?L:JSON.stringify(L),onChange:H=>{const W={...U,[M]:H.target.value};J(W)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Te||ko(M)}):l.jsx(Mt,{id:M,value:typeof L=="string"?L:JSON.stringify(L),onChange:H=>{const W={...U,[M]:H.target.value};J(W)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:Te||ko(M)})]},M))})})})]}),l.jsxs(Tn,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>{q(null),J(null),ee(""),We("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Rt==="edit"?l.jsx(le,{onClick:()=>I&&kx(I,je),disabled:Te||we,className:"s3-explr-save-btn",children:Te?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):Rt==="edit-metadata"?l.jsx(le,{onClick:()=>U&&typeof U=="object"&&I&&Lx(I),disabled:Te||we,className:"s3-explr-save-btn",children:Te?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(le,{onClick:()=>{K.trim()&&I&&Mx(I,K.trim())},disabled:ce||!K.trim()||K.trim()===(I==null?void 0:I.name),className:"s3-explr-rename-btn",children:ce?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})})]})]}),hi&&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(wr,{className:"s3-explr-table",children:[l.jsx(br,{className:"s3-explr-table-header",children:mi.getHeaderGroups().map(M=>l.jsx(Ye,{className:"hover:bg-transparent s3-explr-header-row",children:M.headers.map(L=>l.jsx(st,{className:"s3-explr-header-cell",children:L.isPlaceholder?null:Xn(L.column.columnDef.header,L.getContext())},L.id))},M.id))}),l.jsx(xr,{className:"s3-explr-table-body",children:mi.getRowModel().rows.length===0?l.jsx(Ye,{className:"s3-explr-empty-row",children:l.jsx(Oe,{colSpan:Nd.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:qt?"Đ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"})})}):mi.getRowModel().rows.map(M=>l.jsx(Ye,{className:"h-12 s3-explr-row",children:M.getVisibleCells().map(L=>l.jsx(Oe,{className:"align-middle s3-explr-cell",children:Xn(L.column.columnDef.cell,L.getContext())},L.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(Ix()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(jc,{})]})});var Ln=e=>e.type==="checkbox",Gt=e=>e instanceof Date,Ae=e=>e==null;const nd=e=>typeof e=="object";var me=e=>!Ae(e)&&!Array.isArray(e)&&nd(e)&&!Gt(e),sx=e=>me(e)&&e.target?Ln(e.target)?e.target.checked:e.target.value:e,ix=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ax=(e,t)=>e.has(ix(t)),lx=e=>{const t=e.constructor&&e.constructor.prototype;return me(t)&&t.hasOwnProperty("isPrototypeOf")},ti=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ue(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(!(ti&&(e instanceof Blob||r))&&(n||me(e)))if(t=n?[]:{},!n&&!lx(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Ue(e[o]));else return e;return t}var qr=e=>Array.isArray(e)?e.filter(Boolean):[],ge=e=>e===void 0,j=(e,t,n)=>{if(!t||!me(e))return n;const r=qr(t.split(/[,[\].]+?/)).reduce((o,s)=>Ae(o)?o:o[s],e);return ge(r)||r===e?ge(e[t])?n:e[t]:r},ct=e=>typeof e=="boolean",ni=e=>/^\w*$/.test(e),rd=e=>qr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),de=(e,t,n)=>{let r=-1;const o=ni(t)?[t]:rd(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 od={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},et={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},bt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};D.createContext(null);var cx=(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]!==et.all&&(t._proxyFormState[i]=!r||et.all),e[i]}});return o},Me=e=>me(e)&&!Object.keys(e).length,ux=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Me(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===et.all)},Kr=e=>Array.isArray(e)?e:[e];function dx(e){const t=D.useRef(e);t.current=e,D.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var ut=e=>typeof e=="string",fx=(e,t,n,r,o)=>ut(e)?(r&&t.watch.add(e),j(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),j(n,s))):(r&&(t.watchAll=!0),n),px=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},sd=e=>({isOnSubmit:!e||e===et.onSubmit,isOnBlur:e===et.onBlur,isOnChange:e===et.onChange,isOnAll:e===et.all,isOnTouch:e===et.onTouched}),id=(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=j(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 gx=(e,t,n)=>{const r=Kr(j(e,n));return de(r,"root",t[n]),de(e,n,r),e},ri=e=>e.type==="file",dt=e=>typeof e=="function",Xr=e=>{if(!ti)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Jr=e=>ut(e),oi=e=>e.type==="radio",Yr=e=>e instanceof RegExp;const ad={value:!1,isValid:!1},ld={value:!0,isValid:!0};var cd=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===""?ld:{value:e[0].value,isValid:!0}:ld:ad}return ad};const ud={isValid:!1,value:null};var dd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ud):ud;function fd(e,t,n="validate"){if(Jr(e)||Array.isArray(e)&&e.every(Jr)||ct(e)&&!e)return{type:n,message:Jr(e)?e:"",ref:t}}var gn=e=>me(e)&&!Yr(e)?e:{value:e,message:""},pd=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,b=j(t,v);if(!y||w)return{};const S=i?i[0]:s,E=k=>{r&&S.reportValidity&&(S.setCustomValidity(ct(k)?"":k||""),S.reportValidity())},C={},P=oi(s),_=Ln(s),O=P||_,$=(h||ri(s))&&ge(s.value)&&ge(b)||Xr(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,F=px.bind(null,v,n,C),G=(k,R,I,q=bt.maxLength,U=bt.minLength)=>{const J=k?R:I;C[v]={type:k?q:U,message:J,ref:s,...F(k?q:U,J)}};if(o?!Array.isArray(b)||!b.length:a&&(!O&&($||Ae(b))||ct(b)&&!b||_&&!cd(i).isValid||P&&!dd(i).isValid)){const{value:k,message:R}=Jr(a)?{value:!!a,message:a}:gn(a);if(k&&(C[v]={type:bt.required,message:R,ref:S,...F(bt.required,R)},!n))return E(R),C}if(!$&&(!Ae(f)||!Ae(g))){let k,R;const I=gn(g),q=gn(f);if(!Ae(b)&&!isNaN(b)){const U=s.valueAsNumber||b&&+b;Ae(I.value)||(k=U>I.value),Ae(q.value)||(R=U<q.value)}else{const U=s.valueAsDate||new Date(b),J=ce=>new Date(new Date().toDateString()+" "+ce),K=s.type=="time",ee=s.type=="week";ut(I.value)&&b&&(k=K?J(b)>J(I.value):ee?b>I.value:U>new Date(I.value)),ut(q.value)&&b&&(R=K?J(b)<J(q.value):ee?b<q.value:U<new Date(q.value))}if((k||R)&&(G(!!k,I.message,q.message,bt.max,bt.min),!n))return E(C[v].message),C}if((u||c)&&!$&&(ut(b)||o&&Array.isArray(b))){const k=gn(u),R=gn(c),I=!Ae(k.value)&&b.length>+k.value,q=!Ae(R.value)&&b.length<+R.value;if((I||q)&&(G(I,k.message,R.message),!n))return E(C[v].message),C}if(m&&!$&&ut(b)){const{value:k,message:R}=gn(m);if(Yr(k)&&!b.match(k)&&(C[v]={type:bt.pattern,message:R,ref:s,...F(bt.pattern,R)},!n))return E(R),C}if(p){if(dt(p)){const k=await p(b,t),R=fd(k,S);if(R&&(C[v]={...R,...F(bt.validate,R.message)},!n))return E(R.message),C}else if(me(p)){let k={};for(const R in p){if(!Me(k)&&!n)break;const I=fd(await p[R](b,t),S,R);I&&(k={...I,...F(R,I.message)},E(I.message),n&&(C[v]=k))}if(!Me(k)&&(C[v]={ref:S,...k},!n))return C}}return E(!0),C};function hx(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 mx(e){for(const t in e)if(e.hasOwnProperty(t)&&!ge(e[t]))return!1;return!0}function xe(e,t){const n=Array.isArray(t)?t:ni(t)?[t]:rd(t),r=n.length===1?e:hx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(me(r)&&Me(r)||Array.isArray(r)&&mx(r))&&xe(e,n.slice(0,-1)),e}var si=()=>{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=[]}}},ii=e=>Ae(e)||!nd(e);function Lt(e,t){if(ii(e)||ii(t))return e===t;if(Gt(e)&&Gt(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(Gt(s)&&Gt(i)||me(s)&&me(i)||Array.isArray(s)&&Array.isArray(i)?!Lt(s,i):s!==i)return!1}}return!0}var gd=e=>e.type==="select-multiple",vx=e=>oi(e)||Ln(e),ai=e=>Xr(e)&&e.isConnected,hd=e=>{for(const t in e)if(dt(e[t]))return!0;return!1};function Zr(e,t={}){const n=Array.isArray(e);if(me(e)||n)for(const r in e)Array.isArray(e[r])||me(e[r])&&!hd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Zr(e[r],t[r])):Ae(e[r])||(t[r]=!0);return t}function md(e,t,n){const r=Array.isArray(e);if(me(e)||r)for(const o in e)Array.isArray(e[o])||me(e[o])&&!hd(e[o])?ge(t)||ii(n[o])?n[o]=Array.isArray(e[o])?Zr(e[o],[]):{...Zr(e[o])}:md(e[o],Ae(t)?{}:t[o],n[o]):n[o]=!Lt(e[o],t[o]);return n}var Vn=(e,t)=>md(e,t,Zr(t)),vd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ge(e)?e:t?e===""?NaN:e&&+e:n&&ut(e)?new Date(e):r?r(e):e;function li(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ri(t)?t.files:oi(t)?dd(e.refs).value:gd(t)?[...t.selectedOptions].map(({value:n})=>n):Ln(t)?cd(e.refs).value:vd(ge(t.value)?e.ref.value:t.value,e)}var yx=(e,t,n,r)=>{const o={};for(const s of e){const i=j(t,s);i&&de(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Bn=e=>ge(e)?e:Yr(e)?e.source:me(e)?Yr(e.value)?e.value.source:e.value:e;const yd="AsyncFunction";var wx=e=>!!e&&!!e.validate&&!!(dt(e.validate)&&e.validate.constructor.name===yd||me(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===yd)),bx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function wd(e,t,n){const r=j(e,n);if(r||ni(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=j(t,s),a=j(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 xx=(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,Cx=(e,t)=>!qr(j(e,t)).length&&xe(e,t);const Sx={mode:et.onSubmit,reValidateMode:et.onChange,shouldFocusError:!0};function Ex(e={}){let t={...Sx,...e},n={submitCount:0,isDirty:!1,isLoading:dt(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)?Ue(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ue(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:si(),array:si(),state:si()},m=sd(t.mode),p=sd(t.reValidateMode),v=t.criteriaMode===et.all,h=x=>N=>{clearTimeout(c),c=setTimeout(x,N)},y=async x=>{if(!t.disabled&&(f.isValid||x)){const N=t.resolver?Me((await O()).errors):await F(r,!0);N!==n.isValid&&g.state.next({isValid:N})}},w=(x,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((x||Array.from(a.mount)).forEach(A=>{A&&(N?de(n.validatingFields,A,N):xe(n.validatingFields,A))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Me(n.validatingFields)}))},b=(x,N=[],A,z,B=!0,V=!0)=>{if(z&&A&&!t.disabled){if(i.action=!0,V&&Array.isArray(j(r,x))){const X=A(j(r,x),z.argA,z.argB);B&&de(r,x,X)}if(V&&Array.isArray(j(n.errors,x))){const X=A(j(n.errors,x),z.argA,z.argB);B&&de(n.errors,x,X),Cx(n.errors,x)}if(f.touchedFields&&V&&Array.isArray(j(n.touchedFields,x))){const X=A(j(n.touchedFields,x),z.argA,z.argB);B&&de(n.touchedFields,x,X)}f.dirtyFields&&(n.dirtyFields=Vn(o,s)),g.state.next({name:x,isDirty:k(x,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else de(s,x,N)},S=(x,N)=>{de(n.errors,x,N),g.state.next({errors:n.errors})},E=x=>{n.errors=x,g.state.next({errors:n.errors,isValid:!1})},C=(x,N,A,z)=>{const B=j(r,x);if(B){const V=j(s,x,ge(A)?j(o,x):A);ge(V)||z&&z.defaultChecked||N?de(s,x,N?V:li(B._f)):q(x,V),i.mount&&y()}},P=(x,N,A,z,B)=>{let V=!1,X=!1;const oe={name:x};if(!t.disabled){const te=!!(j(r,x)&&j(r,x)._f&&j(r,x)._f.disabled);if(!A||z){f.isDirty&&(X=n.isDirty,n.isDirty=oe.isDirty=k(),V=X!==oe.isDirty);const pe=te||Lt(j(o,x),N);X=!!(!te&&j(n.dirtyFields,x)),pe||te?xe(n.dirtyFields,x):de(n.dirtyFields,x,!0),oe.dirtyFields=n.dirtyFields,V=V||f.dirtyFields&&X!==!pe}if(A){const pe=j(n.touchedFields,x);pe||(de(n.touchedFields,x,A),oe.touchedFields=n.touchedFields,V=V||f.touchedFields&&pe!==A)}V&&B&&g.state.next(oe)}return V?oe:{}},_=(x,N,A,z)=>{const B=j(n.errors,x),V=f.isValid&&ct(N)&&n.isValid!==N;if(t.delayError&&A?(u=h(()=>S(x,A)),u(t.delayError)):(clearTimeout(c),u=null,A?de(n.errors,x,A):xe(n.errors,x)),(A?!Lt(B,A):B)||!Me(z)||V){const X={...z,...V&&ct(N)?{isValid:N}:{},errors:n.errors,name:x};n={...n,...X},g.state.next(X)}},O=async x=>{w(x,!0);const N=await t.resolver(s,t.context,yx(x||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(x),N},$=async x=>{const{errors:N}=await O(x);if(x)for(const A of x){const z=j(N,A);z?de(n.errors,A,z):xe(n.errors,A)}else n.errors=N;return N},F=async(x,N,A={valid:!0})=>{for(const z in x){const B=x[z];if(B){const{_f:V,...X}=B;if(V){const oe=a.array.has(V.name),te=B._f&&wx(B._f);te&&f.validatingFields&&w([z],!0);const pe=await pd(B,s,v,t.shouldUseNativeValidation&&!N,oe);if(te&&f.validatingFields&&w([z]),pe[V.name]&&(A.valid=!1,N))break;!N&&(j(pe,V.name)?oe?gx(n.errors,pe,V.name):de(n.errors,V.name,pe[V.name]):xe(n.errors,V.name))}!Me(X)&&await F(X,N,A)}}return A.valid},G=()=>{for(const x of a.unMount){const N=j(r,x);N&&(N._f.refs?N._f.refs.every(A=>!ai(A)):!ai(N._f.ref))&&we(x)}a.unMount=new Set},k=(x,N)=>!t.disabled&&(x&&N&&de(s,x,N),!Lt(fe(),o)),R=(x,N,A)=>fx(x,a,{...i.mount?s:ge(N)?o:ut(x)?{[x]:N}:N},A,N),I=x=>qr(j(i.mount?s:o,x,t.shouldUnregister?j(o,x,[]):[])),q=(x,N,A={})=>{const z=j(r,x);let B=N;if(z){const V=z._f;V&&(!V.disabled&&de(s,x,vd(N,V)),B=Xr(V.ref)&&Ae(N)?"":N,gd(V.ref)?[...V.ref.options].forEach(X=>X.selected=B.includes(X.value)):V.refs?Ln(V.ref)?V.refs.length>1?V.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(B)?!!B.find(oe=>oe===X.value):B===X.value)):V.refs[0]&&(V.refs[0].checked=!!B):V.refs.forEach(X=>X.checked=X.value===B):ri(V.ref)?V.ref.value="":(V.ref.value=B,V.ref.type||g.values.next({name:x,values:{...s}})))}(A.shouldDirty||A.shouldTouch)&&P(x,B,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&ce(x)},U=(x,N,A)=>{for(const z in N){const B=N[z],V=`${x}.${z}`,X=j(r,V);(a.array.has(x)||me(B)||X&&!X._f)&&!Gt(B)?U(V,B,A):q(V,B,A)}},J=(x,N,A={})=>{const z=j(r,x),B=a.array.has(x),V=Ue(N);de(s,x,V),B?(g.array.next({name:x,values:{...s}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&g.state.next({name:x,dirtyFields:Vn(o,s),isDirty:k(x,V)})):z&&!z._f&&!Ae(V)?U(x,V,A):q(x,V,A),id(x,a)&&g.state.next({...n}),g.values.next({name:i.mount?x:void 0,values:{...s}})},K=async x=>{i.mount=!0;const N=x.target;let A=N.name,z=!0;const B=j(r,A),V=()=>N.type?li(B._f):sx(x),X=oe=>{z=Number.isNaN(oe)||Gt(oe)&&isNaN(oe.getTime())||Lt(oe,j(s,A,oe))};if(B){let oe,te;const pe=V(),pt=x.type===od.BLUR||x.type===od.FOCUS_OUT,gi=!bx(B._f)&&!t.resolver&&!j(n.errors,A)&&!B._f.deps||xx(pt,j(n.touchedFields,A),n.isSubmitted,p,m),_e=id(A,a,pt);de(s,A,pe),pt?(B._f.onBlur&&B._f.onBlur(x),u&&u(0)):B._f.onChange&&B._f.onChange(x);const qt=P(A,pe,pt,!1),hi=!Me(qt)||_e;if(!pt&&g.values.next({name:A,type:x.type,values:{...s}}),gi)return f.isValid&&(t.mode==="onBlur"?pt&&y():y()),hi&&g.state.next({name:A,..._e?{}:qt});if(!pt&&_e&&g.state.next({...n}),t.resolver){const{errors:ke}=await O([A]);if(X(pe),z){const Qr=wd(n.errors,r,A),gt=wd(ke,r,Qr.name||A);oe=gt.error,A=gt.name,te=Me(ke)}}else w([A],!0),oe=(await pd(B,s,v,t.shouldUseNativeValidation))[A],w([A]),X(pe),z&&(oe?te=!1:f.isValid&&(te=await F(r,!0)));z&&(B._f.deps&&ce(B._f.deps),_(A,te,oe,qt))}},ee=(x,N)=>{if(j(n.errors,N)&&x.focus)return x.focus(),1},ce=async(x,N={})=>{let A,z;const B=Kr(x);if(t.resolver){const V=await $(ge(x)?x:B);A=Me(V),z=x?!B.some(X=>j(V,X)):A}else x?(z=(await Promise.all(B.map(async V=>{const X=j(r,V);return await F(X&&X._f?{[V]:X}:X)}))).every(Boolean),!(!z&&!n.isValid)&&y()):z=A=await F(r);return g.state.next({...!ut(x)||f.isValid&&A!==n.isValid?{}:{name:x},...t.resolver||!x?{isValid:A}:{},errors:n.errors}),N.shouldFocus&&!z&&Rn(r,ee,x?B:a.mount),z},fe=x=>{const N={...i.mount?s:o};return ge(x)?N:ut(x)?j(N,x):x.map(A=>j(N,A))},Ce=(x,N)=>({invalid:!!j((N||n).errors,x),isDirty:!!j((N||n).dirtyFields,x),error:j((N||n).errors,x),isValidating:!!j(n.validatingFields,x),isTouched:!!j((N||n).touchedFields,x)}),Ie=x=>{x&&Kr(x).forEach(N=>xe(n.errors,N)),g.state.next({errors:x?n.errors:{}})},je=(x,N,A)=>{const z=(j(r,x,{_f:{}})._f||{}).ref,B=j(n.errors,x)||{},{ref:V,message:X,type:oe,...te}=B;de(n.errors,x,{...te,...N,ref:z}),g.state.next({name:x,errors:n.errors,isValid:!1}),A&&A.shouldFocus&&z&&z.focus&&z.focus()},We=(x,N)=>dt(x)?g.values.subscribe({next:A=>x(R(void 0,N),A)}):R(x,N,!0),we=(x,N={})=>{for(const A of x?Kr(x):a.mount)a.mount.delete(A),a.array.delete(A),N.keepValue||(xe(r,A),xe(s,A)),!N.keepError&&xe(n.errors,A),!N.keepDirty&&xe(n.dirtyFields,A),!N.keepTouched&&xe(n.touchedFields,A),!N.keepIsValidating&&xe(n.validatingFields,A),!t.shouldUnregister&&!N.keepDefaultValue&&xe(o,A);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:k()}:{}}),!N.keepIsValid&&y()},Ne=({disabled:x,name:N,field:A,fields:z,value:B})=>{if(ct(x)&&i.mount||x){const V=x?void 0:ge(B)?li(A?A._f:j(z,N)._f):B;(x||!x&&!ge(V))&&de(s,N,V),P(N,V,!1,!1,!0)}},Te=(x,N={})=>{let A=j(r,x);const z=ct(N.disabled)||ct(t.disabled);return de(r,x,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:x}},name:x,mount:!0,...N}}),a.mount.add(x),A?Ne({field:A,disabled:ct(N.disabled)?N.disabled:t.disabled,name:x,value:N.value}):C(x,!0,N.value),{...z?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Bn(N.min),max:Bn(N.max),minLength:Bn(N.minLength),maxLength:Bn(N.maxLength),pattern:Bn(N.pattern)}:{},name:x,onChange:K,onBlur:K,ref:B=>{if(B){Te(x,N),A=j(r,x);const V=ge(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,X=vx(V),oe=A._f.refs||[];if(X?oe.find(te=>te===V):V===A._f.ref)return;de(r,x,{_f:{...A._f,...X?{refs:[...oe.filter(ai),V,...Array.isArray(j(o,x))?[{}]:[]],ref:{type:V.type,name:x}}:{ref:V}}}),C(x,!1,void 0,V)}else A=j(r,x,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(ax(a.array,x)&&i.action)&&a.unMount.add(x)}}},$e=()=>t.shouldFocusError&&Rn(r,ee,a.mount),Rt=x=>{ct(x)&&(g.state.next({disabled:x}),Rn(r,(N,A)=>{const z=j(r,A);z&&(N.disabled=z._f.disabled||x,Array.isArray(z._f.refs)&&z._f.refs.forEach(B=>{B.disabled=z._f.disabled||x}))},0,!1))},tt=(x,N)=>async A=>{let z;if(A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist()),t.disabled){N&&await N({...n.errors},A);return}let B=Ue(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:V,values:X}=await O();n.errors=V,B=X}else await F(r);if(xe(n.errors,"root"),Me(n.errors)){g.state.next({errors:{}});try{await x(B,A)}catch(V){z=V}}else N&&await N({...n.errors},A),$e(),setTimeout($e);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Me(n.errors)&&!z,submitCount:n.submitCount+1,errors:n.errors}),z)throw z},hn=(x,N={})=>{j(r,x)&&(ge(N.defaultValue)?J(x,Ue(j(o,x))):(J(x,N.defaultValue),de(o,x,Ue(N.defaultValue))),N.keepTouched||xe(n.touchedFields,x),N.keepDirty||(xe(n.dirtyFields,x),n.isDirty=N.defaultValue?k(x,Ue(j(o,x))):k()),N.keepError||(xe(n.errors,x),f.isValid&&y()),g.state.next({...n}))},Ge=(x,N={})=>{const A=x?Ue(x):o,z=Ue(A),B=Me(x),V=B?o:z;if(N.keepDefaultValues||(o=A),!N.keepValues){if(N.keepDirtyValues){const X=new Set([...a.mount,...Object.keys(Vn(o,s))]);for(const oe of Array.from(X))j(n.dirtyFields,oe)?de(V,oe,j(s,oe)):J(oe,j(V,oe))}else{if(ti&&ge(x))for(const X of a.mount){const oe=j(r,X);if(oe&&oe._f){const te=Array.isArray(oe._f.refs)?oe._f.refs[0]:oe._f.ref;if(Xr(te)){const pe=te.closest("form");if(pe){pe.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?Ue(o):{}:Ue(V),g.array.next({values:{...V}}),g.values.next({values:{...V}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!t.shouldUnregister,g.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:B?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!Lt(x,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:B?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Vn(o,s):n.dirtyFields:N.keepDefaultValues&&x?Vn(o,x):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},ft=(x,N)=>Ge(dt(x)?x(s):x,N);return{control:{register:Te,unregister:we,getFieldState:Ce,handleSubmit:tt,setError:je,_executeSchema:O,_getWatch:R,_getDirty:k,_updateValid:y,_removeUnmounted:G,_updateFieldArray:b,_updateDisabledField:Ne,_getFieldArray:I,_reset:Ge,_resetDefaultValues:()=>dt(t.defaultValues)&&t.defaultValues().then(x=>{ft(x,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:x=>{n={...n,...x}},_disableForm:Rt,_subjects:g,_proxyFormState:f,_setErrors:E,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:ce,register:Te,handleSubmit:tt,watch:We,setValue:J,getValues:fe,reset:ft,resetField:hn,clearErrors:Ie,unregister:we,setError:je,setFocus:(x,N={})=>{const A=j(r,x),z=A&&A._f;if(z){const B=z.refs?z.refs[0]:z.ref;B.focus&&(B.focus(),N.shouldSelect&&dt(B.select)&&B.select())}},getFieldState:Ce}}function Nx(e={}){const t=D.useRef(),n=D.useRef(),[r,o]=D.useState({isDirty:!1,isValidating:!1,isLoading:dt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:dt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Ex(e),formState:r});const s=t.current.control;return s._options=e,dx({subject:s._subjects.state,next:i=>{ux(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),D.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),D.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),D.useEffect(()=>{e.values&&!Lt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),D.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),D.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()}),D.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),D.useMemo(()=>({...t.current,formState:cx(r,s)}),[r,s])}const bd=({className:e,children:t,content:n,side:r})=>{const[o,s]=D.useState(!1);return l.jsx(Vu,{delayDuration:0,children:l.jsxs(Bu,{open:o,children:[l.jsx(zu,{asChild:!0,children:l.jsx("button",{type:"button",className:Q("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(Qs,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},ci=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:Q("mx-auto flex w-full justify-center",e),...t});ci.displayName="Pagination";const ui=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:Q("flex flex-row items-center gap-1",e),...t}));ui.displayName="PaginationContent";const xt=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Q("",e),...t}));xt.displayName="PaginationItem";const zn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:Q(ka({variant:t?"outline":"ghost",size:n}),e),...r});zn.displayName="PaginationLink";const di=({className:e,...t})=>l.jsxs(zn,{"aria-label":"Go to previous page",size:"default",className:Q("gap-1 pl-2.5",e),...t,children:[l.jsx(Zp,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});di.displayName="PaginationPrevious";const fi=({className:e,...t})=>l.jsxs(zn,{"aria-label":"Go to next page",size:"default",className:Q("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(wa,{className:"h-4 w-4"})]});fi.displayName="PaginationNext";const pi=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:Q("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(Qp,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});pi.displayName="PaginationEllipsis";const Tx=(e,t)=>{const[n,r]=D.useState(e);return D.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Px=({apiBaseUrl:e="http://localhost:3002"})=>{var P,_;const[t,n]=D.useState([]),[r,o]=D.useState(!1),[s,i]=D.useState([]),[a,u]=D.useState(1),[c,f]=D.useState(1),[g,m]=D.useState(null),[p,v]=D.useState(""),h=Tx(p,500),y=O=>{const $=O.match(/\d{6}/);if(!$)return{month:"",year:""};const F=$[0],G=F.substring(0,2),k=F.substring(2);return{month:G,year:k}},w=O=>O.map(F=>{let G=(F==null?void 0:F.month)||"",k=(F==null?void 0:F.year)||"";if((!G||!k)&&(F!=null&&F.file_name)){const R=y(F.file_name);G=G||R.month,k=k||R.year}return{id:F==null?void 0:F.id,prefix:(F==null?void 0:F.prefix)||"",model:(F==null?void 0:F.model)||"",fileName:(F==null?void 0:F.file_name)||"",code:(F==null?void 0:F.stock_id)||"",month:G,year:k,content:(F==null?void 0:F.text_summary)||"",status:(F==null?void 0:F.status)||"",note:(F==null?void 0:F.note)||"",lastUpdate:F==null?void 0:F.updated_at,stock_id:F==null?void 0:F.stock_id}}),b=O=>{if(!(O!=null&&O.data))return[];const $=w(O==null?void 0:O.data);n($),f(O.pagination.totalPages)},S=async(O=1,$=15)=>{m(O),o(!0);try{const F=await ie.get(`${e}/api/latest-summaries`,{params:{page:O,limit:$,search:p}});(F==null?void 0:F.status)===200?b(F.data):console.error(F)}catch(F){console.error("Error fetching data:",F)}finally{m(null),o(!1)}};D.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=D.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:$})=>l.jsx("span",{className:"flex flex-col",children:$.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:$})=>{const F=$.original.month,G=$.original.year;return l.jsx("span",{className:"flex flex-col",children:`${F.toString().padStart(2,"0")}/${G}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:$})=>{const F=$.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:F})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:$})=>{const G=$.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${G?"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:G?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:$})=>l.jsx(bd,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:$.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:$.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:$})=>{const F=new Date($.original.lastUpdate),G=F.getDate(),k=F.getMonth()+1,R=`ngày ${G} tháng ${k}`;return l.jsx("span",{className:"flex flex-col",children:R})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:$})=>{const[F,G]=D.useState(!1),[k,R]=D.useState(!1),[I,q]=D.useState(!1),{handleSubmit:U,register:J,reset:K}=Nx(),ee=$.original.id,ce=$.getValue("status"),fe=$.getValue("content"),[Ce,Ie]=D.useState(!1),je=async()=>{try{Ie(!0);const we=ce==="unpublish"?"published":"unpublish",Ne=await ie.patch(`${e}/api/toggle-publish/${ee}`,{id:ee,typeAction:"update",status:ce,idInput:ee,stock_id:$.original.stock_id,prefix:$.original.prefix,model:$.original.model,summary_result:$.original.content,note:$.original.note});Ne.status===200?n(Te=>Te.map($e=>$e.id===ee?{...$e,status:we}:$e)):console.error("Failed to toggle publish status:",Ne)}catch(we){console.error("Error toggling publish status:",we)}finally{Ie(!1)}},We=async we=>{G(!0);try{const Ne=await ie.patch(`${e}/api/update-summary`,{note:we.note,text_summary:we.content,id:ee});Ne.status===200?(await S(a),R(!1)):console.error("Failed to update summary:",Ne)}catch(Ne){console.error("Error updating summary:",Ne)}return G(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(le,{variant:"outline",size:"sm",onClick:()=>q(!0),className:"px-2 py-0.5 h-7",children:l.jsx(eg,{className:"h-4 w-4"})}),l.jsx(Ut,{open:I,onOpenChange:q,children:l.jsxs(Ft,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(Ot,{children:l.jsx(Dt,{children:"Nội dung chi tiết"})}),l.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:l.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:fe})})]})}),l.jsxs(Ut,{open:k,onOpenChange:we=>{R(we),we?K({content:$.original.content,note:$.original.note}):K()},children:[l.jsx(vr,{asChild:!0,children:l.jsx(le,{variant:"outline",size:"sm",onClick:()=>R(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(Ft,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(Ot,{className:"flex flex-col gap-3",children:[l.jsx(Dt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:U(We),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(Pn,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:$.original.answer||"",rows:10,...J("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(Pn,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:$.original.note||"",rows:1,...J("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(le,{disabled:F,type:"submit",variant:"default",children:F?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(le,{variant:"outline",size:"sm",onClick:je,disabled:Ce,className:"w-[70px] px-2 py-0.5 h-7",children:Ce?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):ce==="unpublish"?"Publish":"Unpublish"})]})}}],[]),C=Mi({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:bf(),getCoreRowModel:Di()});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.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(Mt,{placeholder:"Tìm kiếm theo mã...",value:p,onChange:O=>v(O.target.value),className:"pr-8"}),p&&l.jsx(le,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>v(""),children:l.jsx($o,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(wr,{className:"s3-explr-table",children:[l.jsx(br,{className:"s3-explr-table-header",children:C.getHeaderGroups().map(O=>l.jsx(Ye,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map($=>l.jsx(st,{className:"s3-explr-header-cell",children:$.isPlaceholder?null:Xn($.column.columnDef.header,$.getContext())},$.id))},O.id))}),l.jsx(xr,{className:"s3-explr-table-body",children:r?l.jsx(Ye,{children:l.jsx(Oe,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(P=C.getRowModel().rows)!=null&&P.length?(_=C.getRowModel().rows)==null?void 0:_.map(O=>l.jsx(Ye,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map($=>l.jsx(Oe,{className:"align-middle s3-explr-cell",children:Xn($.column.columnDef.cell,$.getContext())},$.id))},O.id)):l.jsx(Ye,{children:l.jsx(Oe,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(ci,{children:l.jsxs(ui,{children:[l.jsx(xt,{children:l.jsx(di,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,$)=>$+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,$,F)=>l.jsxs(l.Fragment,{children:[$>0&&F[$-1]!==O-1&&l.jsx(xt,{children:l.jsx(pi,{})},O+"..."),l.jsx(xt,{children:l.jsx(zn,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===O?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(xt,{children:l.jsx(fi,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},xd=10,Ax=D.memo(({apiBaseUrl:e="http://localhost:3002"})=>{const[t,n]=D.useState(1),[r,o]=D.useState([]),[s,i]=D.useState({total:0,page:1,limit:xd,totalPages:1}),[a,u]=D.useState(!0),[c,f]=D.useState(null),[g,m]=D.useState(new Set),{toast:p}=Ds(),[v,h]=D.useState(!1),y=async C=>{try{f(C);const P=await ie.get(`${e}/api/jobs`,{params:{page:C.toString(),limit:xd.toString()}});o(P.data.data),i(P.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};D.useEffect(()=>{y(t)},[t,e]);const w=async C=>{m(P=>new Set(P).add(C.toString()));try{await ie.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(P=>{const _=new Set(P);return _.delete(C.toString()),_})}},b=async()=>{h(!0),n(1),await y(1),h(!1)},S=C=>new Date(C).toLocaleString(),E=C=>{if(C=parseFloat(C),C<60)return`${C.toFixed(2)}s`;const P=Math.floor(C/60),_=(C%60).toFixed(0);return`${P}m ${_}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(Jp,{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:b,disabled:v||a,className:"ml-2",children:l.jsx(ng,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(wr,{children:[l.jsx(br,{children:l.jsxs(Ye,{children:[l.jsx(st,{children:"ID"}),l.jsx(st,{children:"Tên Công Việc"}),l.jsx(st,{children:"Thời Gian Bắt Đầu"}),l.jsx(st,{children:"Thời Gian Cập Nhật"}),l.jsx(st,{children:"Thời Gian Thực Thi"}),l.jsx(st,{children:"Trạng Thái"}),l.jsx(st,{children:"Thao Tác"})]})}),l.jsx(xr,{children:a&&r.length===0?l.jsx(Ye,{children:l.jsx(Oe,{colSpan:7,className:"text-center py-4",children:l.jsx(ve,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(C=>{var P,_;return l.jsxs(Ye,{children:[l.jsx(Oe,{className:"!w-[100px]",children:C.id}),l.jsx(Oe,{className:"font-medium",children:(P=C.job_name)==null?void 0:P.replace("Upload file","Summary")}),l.jsx(Oe,{className:"!w-[200px]",children:S(C.created_at)}),l.jsx(Oe,{className:"!w-[200px]",children:S(C.updated_at)}),l.jsx(Oe,{className:"!w-[150px]",children:E(C.execution_time_seconds)}),l.jsx(Oe,{className:"!w-[200px]",children:l.jsx(bd,{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]
|
|
142
|
+
${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":(_=C.status)==null?void 0:_.toUpperCase()})})}),l.jsx(Oe,{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(ve,{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(ci,{children:l.jsxs(ui,{children:[l.jsx(xt,{children:l.jsx(di,{onClick:()=>n(C=>Math.max(1,C-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(C,P)=>P+1).filter(C=>C===1||C===s.totalPages||Math.abs(C-t)<=1).map((C,P,_)=>l.jsxs(l.Fragment,{children:[P>0&&_[P-1]!==C-1&&l.jsx(xt,{children:l.jsx(pi,{})},C+"..."),l.jsx(xt,{children:l.jsx(zn,{onClick:()=>n(C),isActive:t===C,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===C?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):C})},C)]})),l.jsx(xt,{children:l.jsx(fi,{onClick:()=>n(C=>Math.min(s.totalPages,C+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(jc,{})]})});qe.Job=Ax,qe.S3Explorer=ox,qe.Summary=Px,Object.defineProperty(qe,Symbol.toStringTag,{value:"Module"})});
|
|
138
143
|
//# sourceMappingURL=s3-explorer.umd.cjs.map
|