dccxx-s3-explorer 1.0.27 → 1.0.29

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.
@@ -1,4 +1,4 @@
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);/**
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,A,fo){"use strict";function Si(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=Si(A),Jn=Si(fo);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.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const Ei=d.forwardRef(Fd);function Od({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 Dd=d.forwardRef(Od);function Md({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 Id=d.forwardRef(Md);function kd({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 $d=d.forwardRef(kd);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:"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 po=d.forwardRef(Ld);function Rd({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 Vd=d.forwardRef(Rd);function Bd({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 zd=d.forwardRef(Bd);function Hd({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 Ud=d.forwardRef(Hd);function jd({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 Ni=d.forwardRef(jd);/**
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 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`,`
10
+ */function Tt(e,t){return typeof e=="function"?e(t):e}function ke(e,t){return n=>{t.setState(r=>({...r,[e]:Tt(n,r[e])}))}}function Yn(e){return e instanceof Function}function Wd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Gd(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 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()))}/**
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 qd(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 Kd(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 Ti(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 Xd={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 Zn(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))),Zn(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 Zn(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 Zn(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 Zn(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=Ti(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)=>Ti(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 go=(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:()=>Gd(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=>qd(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},Jd={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()}}},Pi=(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))};Pi.autoRemove=e=>Ke(e);const Ai=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ai.autoRemove=e=>Ke(e);const _i=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};_i.autoRemove=e=>Ke(e);const Fi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Fi.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Oi=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Oi.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Di=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Di.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Mi=(e,t,n)=>e.getValue(t)===n;Mi.autoRemove=e=>Ke(e);const Ii=(e,t,n)=>e.getValue(t)==n;Ii.autoRemove=e=>Ke(e);const ho=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};ho.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]},ho.autoRemove=e=>Ke(e)||Ke(e[0])&&Ke(e[1]);const pt={includesString:Pi,includesStringSensitive:Ai,equalsString:_i,arrIncludes:Fi,arrIncludesAll:Oi,arrIncludesSome:Di,equals:Mi,weakEquals:Ii,inNumberRange:ho};function Ke(e){return e==null||e===""}const Yd={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ke("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"?pt.includesString:typeof r=="number"?pt.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?pt.equals:Array.isArray(r)?pt.arrIncludes:pt.weakEquals},e.getFilterFn=()=>{var n,r;return Yn(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:pt[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=Tt(n,s?s.value:void 0);if(ki(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=Tt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(ki(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 ki(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const mo={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(!Wd(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},Zd={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:ke("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 mo.sum;if(Object.prototype.toString.call(r)==="[object Date]")return mo.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Yn(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:mo[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 Qd(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 ef={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ke("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Y(n=>[Nn(t,n)],n=>n.findIndex(r=>r.id===e.id),Z(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Nn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Nn(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 Qd(s,n,r)},Z(e.options,"debugTable","_getOrderColumnsFn"))}},vo=()=>({left:[],right:[]}),tf={getInitialState:e=>({columnPinning:vo(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ke("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?vo():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:vo())},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},yo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),nf={getDefaultColumnDef:()=>Qn,getInitialState:e=>({columnSizing:{},columnSizingInfo:yo(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ke("columnSizing",e),onColumnSizingInfoChange:ke("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,Nn(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,Nn(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(),wo(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=wo(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,F=(b-((E=S==null?void 0:S.startOffset)!=null?E:0))*P,O=Math.max(F/((C=S==null?void 0:S.startSize)!=null?C:0),-.999999);return S.columnSizingStart.forEach(I=>{let[D,q]=I;c[D]=Math.round(Math.max(q+q*O,0)*100)/100}),{...S,deltaOffset:F,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=rf()?{passive:!1}:!1;wo(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?yo():(n=e.initialState.columnSizingInfo)!=null?n:yo())},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 er=null;function rf(){if(typeof er=="boolean")return er;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 er=e,er}function wo(e){return e.type==="touchstart"}const of={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ke("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 Nn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const sf={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()}}},af={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:ke("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=()=>pt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Yn(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:pt[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},lf={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ke("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()}}}},bo=0,xo=10,Co=()=>({pageIndex:bo,pageSize:xo}),cf={getInitialState:e=>({...e,pagination:{...Co(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:ke("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=>Tt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Co():(o=e.initialState.pagination)!=null?o:Co())},e.setPageIndex=r=>{e.setPagination(o=>{let s=Tt(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?bo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:bo)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?xo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:xo)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,Tt(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=Tt(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}}},So=()=>({top:[],bottom:[]}),uf={getInitialState:e=>({rowPinning:So(),...e}),getDefaultOptions:e=>({onRowPinningChange:ke("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?So():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:So())},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"))}},df={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ke("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=>{Eo(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?No(e,n):{rows:[],flatRows:[],rowsById:{}},Z(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?No(e,n):{rows:[],flatRows:[],rowsById:{}},Z(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?No(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 Eo(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return To(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Po(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Po(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Eo=(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=>Eo(e,a.id,n,r,o))};function No(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=To(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 To(e,t){var n;return(n=t[e.id])!=null?n:!1}function Po(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(To(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=Po(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Ao=/([0-9]+)/gm,ff=(e,t,n)=>$i(Pt(e.getValue(n)).toLowerCase(),Pt(t.getValue(n)).toLowerCase()),pf=(e,t,n)=>$i(Pt(e.getValue(n)),Pt(t.getValue(n))),gf=(e,t,n)=>_o(Pt(e.getValue(n)).toLowerCase(),Pt(t.getValue(n)).toLowerCase()),hf=(e,t,n)=>_o(Pt(e.getValue(n)),Pt(t.getValue(n))),mf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},vf=(e,t,n)=>_o(e.getValue(n),t.getValue(n));function _o(e,t){return e===t?0:e>t?1:-1}function Pt(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(Ao).filter(Boolean),r=t.split(Ao).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 Tn={alphanumeric:ff,alphanumericCaseSensitive:pf,text:gf,textCaseSensitive:hf,datetime:mf,basic:vf},yf=[Xd,of,ef,tf,Jd,Yd,sf,af,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ke("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 Tn.datetime;if(typeof s=="string"&&(r=!0,s.split(Ao).length>1))return Tn.alphanumeric}return r?Tn.text:Tn.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 Yn(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:Tn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(p=>p.id===e.id),u=i==null?void 0:i.findIndex(p=>p.id===e.id);let c=[],f,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?f="toggle":f="add":i!=null&&i.length&&u!==i.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var m;c=[...i,{id:e.id,desc:g}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(p=>p.id===e.id?{...p,desc:g}:p):f==="remove"?c=i.filter(p=>p.id!==e.id):c=[{id:e.id,desc:g}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Zd,lf,cf,uf,df,nf];function wf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...yf,...(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=Tt(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=Kd(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 Li(){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=go(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 bf(e,t,n){return n.options.filterFromLeafRows?xf(e,t,n):Cf(e,t,n)}function xf(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=go(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 Cf(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=go(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 Sf(){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 bf(t.rows,g,e)},Z(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
14
14
  * react-table
15
15
  *
16
16
  * Copyright (c) TanStack
@@ -19,87 +19,92 @@
19
19
  * LICENSE.md file in the root directory of this source tree.
20
20
  *
21
21
  * @license MIT
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;/**
22
+ */function tr(e,t){return e?Ef(e)?d.createElement(e,t):e:null}function Ef(e){return Nf(e)||typeof e=="function"||Tf(e)}function Nf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Tf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ri(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:wf(t)})),[r,o]=d.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}function Vi(e,t){return function(){return e.apply(t,arguments)}}const{toString:Pf}=Object.prototype,{getPrototypeOf:Fo}=Object,nr=(e=>t=>{const n=Pf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xe=e=>(e=e.toLowerCase(),t=>nr(t)===e),rr=e=>t=>typeof t===e,{isArray:Zt}=Array,Pn=rr("undefined");function Af(e){return e!==null&&!Pn(e)&&e.constructor!==null&&!Pn(e.constructor)&&$e(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Bi=Xe("ArrayBuffer");function _f(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Bi(e.buffer),t}const Ff=rr("string"),$e=rr("function"),zi=rr("number"),or=e=>e!==null&&typeof e=="object",Of=e=>e===!0||e===!1,sr=e=>{if(nr(e)!=="object")return!1;const t=Fo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Df=Xe("Date"),Mf=Xe("File"),If=Xe("Blob"),kf=Xe("FileList"),$f=e=>or(e)&&$e(e.pipe),Lf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||$e(e.append)&&((t=nr(e))==="formdata"||t==="object"&&$e(e.toString)&&e.toString()==="[object FormData]"))},Rf=Xe("URLSearchParams"),[Vf,Bf,zf,Hf]=["ReadableStream","Request","Response","Headers"].map(Xe),Uf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function An(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Zt(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Hi(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Ut=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ui=e=>!Pn(e)&&e!==Ut;function Oo(){const{caseless:e}=Ui(this)&&this||{},t={},n=(r,o)=>{const s=e&&Hi(t,o)||o;sr(t[s])&&sr(r)?t[s]=Oo(t[s],r):sr(r)?t[s]=Oo({},r):Zt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&An(arguments[r],n);return t}const jf=(e,t,n,{allOwnKeys:r}={})=>(An(t,(o,s)=>{n&&$e(o)?e[s]=Vi(o,n):e[s]=o},{allOwnKeys:r}),e),Wf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Gf=(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)},qf=(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&&Fo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Kf=(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},Xf=e=>{if(!e)return null;if(Zt(e))return e;let t=e.length;if(!zi(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Jf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Fo(Uint8Array)),Yf=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Zf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Qf=Xe("HTMLFormElement"),ep=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),ji=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),tp=Xe("RegExp"),Wi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};An(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},np=e=>{Wi(e,(t,n)=>{if($e(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if($e(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+"'")})}})},rp=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Zt(e)?r(e):r(String(e).split(t)),n},op=()=>{},sp=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Do="abcdefghijklmnopqrstuvwxyz",Gi="0123456789",qi={DIGIT:Gi,ALPHA:Do,ALPHA_DIGIT:Do+Do.toUpperCase()+Gi},ip=(e=16,t=qi.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function ap(e){return!!(e&&$e(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const lp=e=>{const t=new Array(10),n=(r,o)=>{if(or(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Zt(r)?[]:{};return An(r,(i,a)=>{const u=n(i,o+1);!Pn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},cp=Xe("AsyncFunction"),up=e=>e&&(or(e)||$e(e))&&$e(e.then)&&$e(e.catch),Ki=((e,t)=>e?setImmediate:t?((n,r)=>(Ut.addEventListener("message",({source:o,data:s})=>{o===Ut&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Ut.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",$e(Ut.postMessage)),dp=typeof queueMicrotask<"u"?queueMicrotask.bind(Ut):typeof process<"u"&&process.nextTick||Ki,T={isArray:Zt,isArrayBuffer:Bi,isBuffer:Af,isFormData:Lf,isArrayBufferView:_f,isString:Ff,isNumber:zi,isBoolean:Of,isObject:or,isPlainObject:sr,isReadableStream:Vf,isRequest:Bf,isResponse:zf,isHeaders:Hf,isUndefined:Pn,isDate:Df,isFile:Mf,isBlob:If,isRegExp:tp,isFunction:$e,isStream:$f,isURLSearchParams:Rf,isTypedArray:Jf,isFileList:kf,forEach:An,merge:Oo,extend:jf,trim:Uf,stripBOM:Wf,inherits:Gf,toFlatObject:qf,kindOf:nr,kindOfTest:Xe,endsWith:Kf,toArray:Xf,forEachEntry:Yf,matchAll:Zf,isHTMLForm:Qf,hasOwnProperty:ji,hasOwnProp:ji,reduceDescriptors:Wi,freezeMethods:np,toObjectSet:rp,toCamelCase:ep,noop:op,toFiniteNumber:sp,findKey:Hi,global:Ut,isContextDefined:Ui,ALPHABET:qi,generateString:ip,isSpecCompliantForm:ap,toJSONObject:lp,isAsyncFn:cp,isThenable:up,setImmediate:Ki,asap:dp};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 Xi=ne.prototype,Ji={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ji[e]={value:e}}),Object.defineProperties(ne,Ji),Object.defineProperty(Xi,"isAxiosError",{value:!0}),ne.from=(e,t,n,r,o,s)=>{const i=Object.create(Xi);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 fp=null;function Mo(e){return T.isPlainObject(e)||T.isArray(e)}function Yi(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Zi(e,t,n){return e?e.concat(t).map(function(o,s){return o=Yi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function pp(e){return T.isArray(e)&&!e.some(Mo)}const gp=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function ir(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)&&pp(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=Yi(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?Zi([h],E,s):i===null?h:h+"[]",c(S))}),!1}return Mo(v)?!0:(t.append(Zi(y,h,s),c(v)),!1)}const g=[],m=Object.assign(gp,{defaultVisitor:f,convertValue:c,isVisitable:Mo});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 Qi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Io(e,t){this._pairs=[],e&&ir(e,this,t)}const ea=Io.prototype;ea.append=function(t,n){this._pairs.push([t,n])},ea.toString=function(t){const n=t?function(r){return t.call(this,r,Qi)}:Qi;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function hp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ta(e,t,n){if(!t)return e;const r=n&&n.encode||hp;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 Io(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class na{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ra={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Io,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ko=typeof window<"u"&&typeof document<"u",$o=typeof navigator=="object"&&navigator||void 0,vp=ko&&(!$o||["ReactNative","NativeScript","NS"].indexOf($o.product)<0),yp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wp=ko&&window.location.href||"http://localhost",Ee={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ko,hasStandardBrowserEnv:vp,hasStandardBrowserWebWorkerEnv:yp,navigator:$o,origin:wp},Symbol.toStringTag,{value:"Module"})),...mp};function bp(e,t){return ir(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 xp(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Cp(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function oa(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),u=s>=n.length;return i=!i&&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]=Cp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(xp(r),o,n,0)}),n}return null}function Sp(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 _n={transitional:ra,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(oa(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 bp(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ir(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Sp(t)):t}],transformResponse:[function(t){const n=this.transitional||_n.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=>{_n.headers[e]={}});const Ep=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"]),Np=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]&&Ep[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},sa=Symbol("internals");function Fn(e){return e&&String(e).trim().toLowerCase()}function ar(e){return e===!1||e==null?e:T.isArray(e)?e.map(ar):String(e)}function Tp(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 Pp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Lo(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 Ap(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function _p(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=Fn(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]=ar(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())&&!Pp(t))i(Np(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=Fn(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Tp(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=Fn(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Lo(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Fn(i),i){const a=T.findKey(r,i);a&&(!n||Lo(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||Lo(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]=ar(o),delete n[s];return}const a=t?Ap(s):String(s).trim();a!==s&&delete n[s],n[a]=ar(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[sa]=this[sa]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Fn(i);r[a]||(_p(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 Ro(e,t){const n=this||_n,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 ia(e){return!!(e&&e.__CANCEL__)}function Qt(e,t,n){ne.call(this,e??"canceled",ne.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Qt,ne,{__CANCEL__:!0});function aa(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 Fp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Op(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 Dp(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 lr=(e,t,n=3)=>{let r=0;const o=Op(50,250);return Dp(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const g={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(g)},n)},la=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ca=e=>(...t)=>T.asap(()=>e(...t)),Mp=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,Ip=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 kp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function $p(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ua(e,t){return e&&!kp(t)?$p(e,t):t}const da=e=>e instanceof Fe?{...e}:e;function jt(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(da(c),da(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 fa=e=>{const t=jt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Fe.from(i),t.url=ta(ua(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(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&&Mp(t.url))){const c=o&&s&&Ip.read(s);c&&i.set(o,c)}return t},Lp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=fa(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};aa(function(F){n(F),h()},function(F){r(F),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||ra;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]=lr(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=lr(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new Qt(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=Fp(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)})},Rp=(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 Qt(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}},Vp=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},Bp=async function*(e,t){for await(const n of zp(e))yield*Vp(n,t)},zp=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},pa=(e,t,n,r)=>{const o=Bp(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})},cr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ga=cr&&typeof ReadableStream=="function",Hp=cr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ha=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Up=ga&&ha(()=>{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}),ma=64*1024,Vo=ga&&ha(()=>T.isReadableStream(new Response("").body)),ur={stream:Vo&&(e=>e.body)};cr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ur[t]&&(ur[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 jp=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 Hp(e)).byteLength},Wp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??jp(t)},Bo={http:fp,xhr:Lp,fetch:cr&&(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}=fa(e);c=c?(c+"").toLowerCase():"text";let p=Rp([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Up&&n!=="get"&&n!=="head"&&(y=await Wp(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[F,O]=la(y,lr(ca(u)));r=pa(C.body,ma,F,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=Vo&&(c==="stream"||c==="response");if(Vo&&(a||S&&h)){const C={};["status","statusText","headers"].forEach(I=>{C[I]=b[I]});const P=T.toFiniteNumber(b.headers.get("content-length")),[F,O]=a&&la(P,lr(ca(a),!0))||[];b=new Response(pa(b.body,ma,F,()=>{O&&O(),h&&h()}),C)}c=c||"text";let E=await ur[T.findKey(ur,c)||"text"](b,e);return!S&&h&&h(),await new Promise((C,P)=>{aa(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(Bo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const va=e=>`- ${e}`,Gp=e=>T.isFunction(e)||e===null||e===!1,ya={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,!Gp(n)&&(r=Bo[(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(va).join(`
26
+ `):" "+va(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:Bo};function zo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qt(null,e)}function wa(e){return zo(e),e.headers=Fe.from(e.headers),e.data=Ro.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ya.getAdapter(e.adapter||_n.adapter)(e).then(function(r){return zo(e),r.data=Ro.call(e,e.transformResponse,r),r.headers=Fe.from(r.headers),r},function(r){return ia(r)||(zo(e),r&&r.response&&(r.response.data=Ro.call(e,e.transformResponse,r.response),r.response.headers=Fe.from(r.response.headers))),Promise.reject(r)})}const ba="1.7.9",dr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{dr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const xa={};dr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+ba+"] 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&&!xa[i]&&(xa[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}},dr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function qp(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 fr={assertOptions:qp,validators:dr},rt=fr.validators;class Wt{constructor(t){this.defaults=t,this.interceptors={request:new na,response:new na}}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=jt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&fr.assertOptions(r,{silentJSONParsing:rt.transitional(rt.boolean),forcedJSONParsing:rt.transitional(rt.boolean),clarifyTimeoutError:rt.transitional(rt.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:fr.assertOptions(o,{encode:rt.function,serialize:rt.function},!0)),fr.assertOptions(n,{baseUrl:rt.spelling("baseURL"),withXsrfToken:rt.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=[wa.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=wa.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=jt(this.defaults,t);const n=ua(t.baseURL,t.url);return ta(n,t.params,t.paramsSerializer)}}T.forEach(["delete","get","head","options"],function(t){Wt.prototype[t]=function(n,r){return this.request(jt(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(jt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Wt.prototype[t]=n(),Wt.prototype[t+"Form"]=n(!0)});class Ho{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 Qt(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 Ho(function(o){t=o}),cancel:t}}}function Kp(e){return function(n){return e.apply(null,n)}}function Xp(e){return T.isObject(e)&&e.isAxiosError===!0}const Uo={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(Uo).forEach(([e,t])=>{Uo[t]=e});function Ca(e){const t=new Wt(e),n=Vi(Wt.prototype.request,t);return T.extend(n,Wt.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Ca(jt(e,o))},n}const se=Ca(_n);se.Axios=Wt,se.CanceledError=Qt,se.CancelToken=Ho,se.isCancel=ia,se.VERSION=ba,se.toFormData=ir,se.AxiosError=ne,se.Cancel=se.CanceledError,se.all=function(t){return Promise.all(t)},se.spread=Kp,se.isAxiosError=Xp,se.mergeConfig=jt,se.AxiosHeaders=Fe,se.formToJSON=e=>oa(T.isHTMLForm(e)?new FormData(e):e),se.getAdapter=ya.getAdapter,se.HttpStatusCode=Uo,se.default=se;/**
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 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();/**
32
+ */const Jp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sa=(...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 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"};/**
37
+ */var Yp={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 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]]));/**
42
+ */const Zp=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>A.createElement("svg",{ref:u,...Yp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Sa("lucide",o),...a},[...i.map(([c,f])=>A.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 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};/**
47
+ */const Je=(e,t)=>{const n=A.forwardRef(({className:r,...o},s)=>A.createElement(Zp,{ref:s,iconNode:t,className:Sa(`lucide-${Jp(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 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"}]]);/**
52
+ */const Qp=Je("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 Yp=rt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
57
+ */const eg=Je("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 Zp=rt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
62
+ */const tg=Je("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 wa=rt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
67
+ */const Ea=Je("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 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"}]]);/**
72
+ */const ng=Je("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 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"}]]);/**
77
+ */const rg=Je("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 ve=rt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
82
+ */const we=Je("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 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"}]]);/**
87
+ */const og=Je("MoveUpRight",[["path",{d:"M13 5H19V11",key:"1n1gyv"}],["path",{d:"M19 5L5 19",key:"72u4yj"}]]);/**
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 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"}]]);/**
92
+ */const sg=Je("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"}]]);/**
93
93
  * @license lucide-react v0.468.0 - ISC
94
94
  *
95
95
  * This source code is licensed under the ISC license.
96
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,` {
97
+ */const ig=Je("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"}]]);/**
98
+ * @license lucide-react v0.468.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const jo=Je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ag={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"},lg=e=>e==="SummaryOfSuggestedAI"||e==="KeywordAISuggestion"||e==="SuggestedAICategories",Wo=e=>e==="fullPath"||e==="createAt"||e==="creator"||e==="creatorId"||e==="DataSource"||e==="AccessLevel"||e==="category"||e==="fileName",cg=(e,t)=>{if(e.length>30)return t({title:"Lỗi tải lên",description:"Bạn chỉ có thể tải lên tối đa 30 tệp.",variant:"destructive"}),!0;for(let o=0;o<e.length;o++){const s=e[o];if(s&&s.size>20971520)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 20MB.`,variant:"destructive"}),!0}return!1};function Na(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ug(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Na(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():Na(e[o],null)}}}}var en=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(dg);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(Go,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Go,{...r,ref:t,children:n})});en.displayName="Slot";var Go=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=pg(n);return d.cloneElement(n,{...fg(r,n.props),ref:t?ug(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Go.displayName="SlotClone";var Ta=({children:e})=>l.jsx(l.Fragment,{children:e});function dg(e){return d.isValidElement(e)&&e.type===Ta}function fg(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 pg(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 Pa(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=Pa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Aa(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Pa(e))&&(r&&(r+=" "),r+=t);return r}const qo="-",gg=e=>{const t=mg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(qo);return a[0]===""&&a.length!==1&&a.shift(),_a(a,t)||hg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},_a=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?_a(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(qo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Fa=/^\[(.+)\]$/,hg=e=>{if(Fa.test(e)){const t=Fa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},mg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return yg(Object.entries(e.classGroups),n).forEach(([s,i])=>{Ko(i,r,s,t)}),r},Ko=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Oa(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(vg(o)){Ko(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Ko(i,Oa(t,s),n,r)})})},Oa=(e,t)=>{let n=e;return t.split(qo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},vg=e=>e.isThemeGetter,yg=(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,wg=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)}}},Da="!",bg=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(Da),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},xg=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},Cg=e=>({cache:wg(e.cacheSize),parseClassName:bg(e),...gg(e)}),Sg=/\s+/,Eg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Sg);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=xg(f).join(":"),w=g?y+Da: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 Ng(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ma(t))&&(r&&(r+=" "),r+=n);return r}const Ma=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ma(e[r]))&&(n&&(n+=" "),n+=t);return n};function Tg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=Cg(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=Eg(u,n);return o(u,f),f}return function(){return s(Ng.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ia=/^\[(?:([a-z-]+):)?(.+)\]$/i,Pg=/^\d+\/\d+$/,Ag=new Set(["px","full","screen"]),_g=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fg=/\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$/,Og=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Dg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gt=e=>tn(e)||Ag.has(e)||Pg.test(e),At=e=>nn(e,"length",zg),tn=e=>!!e&&!Number.isNaN(Number(e)),Xo=e=>nn(e,"number",tn),On=e=>!!e&&Number.isInteger(Number(e)),Ig=e=>e.endsWith("%")&&tn(e.slice(0,-1)),re=e=>Ia.test(e),_t=e=>_g.test(e),kg=new Set(["length","size","percentage"]),$g=e=>nn(e,kg,ka),Lg=e=>nn(e,"position",ka),Rg=new Set(["image","url"]),Vg=e=>nn(e,Rg,Ug),Bg=e=>nn(e,"",Hg),Dn=()=>!0,nn=(e,t,n)=>{const r=Ia.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},zg=e=>Fg.test(e)&&!Og.test(e),ka=()=>!1,Hg=e=>Dg.test(e),Ug=e=>Mg.test(e),jg=Tg(()=>{const e=de("colors"),t=de("spacing"),n=de("blur"),r=de("brightness"),o=de("borderColor"),s=de("borderRadius"),i=de("borderSpacing"),a=de("borderWidth"),u=de("contrast"),c=de("grayscale"),f=de("hueRotate"),g=de("invert"),m=de("gap"),p=de("gradientColorStops"),v=de("gradientColorStopPositions"),h=de("inset"),y=de("margin"),w=de("opacity"),b=de("padding"),S=de("saturate"),E=de("scale"),C=de("sepia"),P=de("skew"),F=de("space"),O=de("translate"),I=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",re,t],k=()=>[re,t],U=()=>["",gt,At],R=()=>["auto",tn,re],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["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"],G=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",re],le=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[tn,re];return{cacheSize:500,separator:":",theme:{colors:[Dn],spacing:[gt,At],blur:["none","",_t,re],brightness:ue(),borderColor:[e],borderRadius:["none","","full",_t,re],borderSpacing:k(),borderWidth:U(),contrast:ue(),grayscale:Q(),hueRotate:ue(),invert:Q(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[Ig,At],inset:q(),margin:q(),opacity:ue(),padding:k(),saturate:ue(),scale:ue(),sepia:Q(),skew:ue(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[_t]}],"break-after":[{"break-after":le()}],"break-before":[{"break-before":le()}],"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:[...z(),re]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],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",On,re]}],basis:[{basis:q()}],"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:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",On,re]}],"grid-cols":[{"grid-cols":[Dn]}],"col-start-end":[{col:["auto",{span:["full",On,re]},re]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[Dn]}],"row-start-end":[{row:["auto",{span:[On,re]},re]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"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",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"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":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"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:[_t]},_t]}],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",_t,At]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xo]}],"font-family":[{font:[Dn]}],"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",tn,Xo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gt,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:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",gt,At]}],"underline-offset":[{"underline-offset":["auto",gt,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:[...z(),Lg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$g]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Vg]}],"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:[...V(),"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:V()}],"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:["",...V()]}],"outline-offset":[{"outline-offset":[gt,re]}],"outline-w":[{outline:[gt,At]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[gt,At]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_t,Bg]}],"shadow-color":[{shadow:[Dn]}],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",_t,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:ue()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:ue()}],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:[On,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:[gt,At,Xo]}],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 ee(...e){return jg(Aa(e))}const Wg=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:ee("s3-explr-ui-breadcrumb",e),...t}));$a.displayName="Breadcrumb";const La=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:ee("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",e),...t}));La.displayName="BreadcrumbList";const Jo=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ee("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));Jo.displayName="BreadcrumbItem";const Yo=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?en:"a";return l.jsx(o,{ref:r,className:ee("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Yo.displayName="BreadcrumbLink";const Gg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ee("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Gg.displayName="BreadcrumbPage";const Ra=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:ee("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(Ea,{})});Ra.displayName="BreadcrumbSeparator";const Va=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ba=Aa,Zo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ba(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=Va(f)||Va(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 Ba(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},za=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?en:"button";return l.jsx(i,{className:ee(za({variant:t,size:n,className:e})),ref:s,...o})});ie.displayName="Button";function qg(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function pr(...e){return t=>e.forEach(n=>qg(n,t))}function Ue(...e){return d.useCallback(pr(...e),e)}function Kg(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 Ft(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,Xg(o,...t)]}function Xg(...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 be(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 rn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Jg({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 Jg({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 Yg(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 Ha(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 Zg(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var on=e=>{const{present:t,children:n}=e,r=Qg(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Ue(r.ref,eh(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};on.displayName="Presence";function Qg(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Zg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=gr(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=gr(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=gr(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=gr(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 gr(e){return(e==null?void 0:e.animationName)||"none"}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 Ua=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(nh);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(Qo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Qo,{...r,ref:t,children:n})});Ua.displayName="Slot";var Qo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=oh(n);return d.cloneElement(n,{...rh(r,n.props),ref:t?pr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Qo.displayName="SlotClone";var th=({children:e})=>l.jsx(l.Fragment,{children:e});function nh(e){return d.isValidElement(e)&&e.type===th}function rh(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 oh(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 sh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xe=sh.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ua:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ja(e,t){e&&Jn.flushSync(()=>e.dispatchEvent(t))}var es="Checkbox",[ih,cC]=Ft(es),[ah,lh]=ih(es),Wa=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...g}=e,[m,p]=d.useState(null),v=Ue(t,E=>p(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,b]=rn({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(ah,{scope:n,state:w,disabled:a,children:[l.jsx(xe.button,{type:"button",role:"checkbox","aria-checked":Ot(w)?"mixed":w,"aria-required":i,"data-state":Ka(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:be(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:be(e.onClick,E=>{b(C=>Ot(C)?!0:!C),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(ch,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Ot(s)?!1:s})]})});Wa.displayName=es;var Ga="CheckboxIndicator",qa=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=lh(Ga,n);return l.jsx(on,{present:r||Ot(s.state)||s.state===!0,children:l.jsx(xe.span,{"data-state":Ka(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});qa.displayName=Ga;var ch=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=Yg(n),u=Ha(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=Ot(n),p.call(f,Ot(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Ot(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 Ot(e){return e==="indeterminate"}function Ka(e){return Ot(e)?"indeterminate":e?"checked":"unchecked"}var Xa=Wa,uh=qa;const ts=d.forwardRef(({className:e,...t},n)=>l.jsx(Xa,{ref:n,className:ee("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(uh,{className:ee("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(eg,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));ts.displayName=Xa.displayName;var dh=d.useId||(()=>{}),fh=0;function sn(e){const[t,n]=d.useState(dh());return Le(()=>{e||n(r=>r??String(fh++))},[e]),e||(t?`radix-${t}`:"")}function Ja(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 ph="DismissableLayer",ns="dismissableLayer.update",gh="dismissableLayer.pointerDownOutside",hh="dismissableLayer.focusOutside",Ya,Za=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rs=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Za),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Ue(t,F=>g(F)),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=vh(F=>{const O=F.target,I=[...c.branches].some(D=>D.contains(O));!E||I||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},m),P=yh(F=>{const O=F.target;[...c.branches].some(D=>D.contains(O))||(s==null||s(F),i==null||i(F),F.defaultPrevented||a==null||a())},m);return Ja(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ya=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),el(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ya)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),el())},[f,c]),d.useEffect(()=>{const F=()=>p({});return document.addEventListener(ns,F),()=>document.removeEventListener(ns,F)},[]),l.jsx(xe.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,P.onFocusCapture),onBlurCapture:be(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,C.onPointerDownCapture)})});rs.displayName=ph;var mh="DismissableLayerBranch",Qa=d.forwardRef((e,t)=>{const n=d.useContext(Za),r=d.useRef(null),o=Ue(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(xe.div,{...e,ref:o})});Qa.displayName=mh;function vh(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(){tl(gh,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 yh(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&&tl(hh,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 el(){const e=new CustomEvent(ns);document.dispatchEvent(e)}function tl(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ja(o,s):o.dispatchEvent(s)}var wh=rs,bh=Qa,os="focusScope.autoFocusOnMount",ss="focusScope.autoFocusOnUnmount",nl={bubbles:!1,cancelable:!0},xh="FocusScope",rl=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=Ue(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:Dt(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Dt(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Dt(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){il.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(os,nl);a.addEventListener(os,c),a.dispatchEvent(w),w.defaultPrevented||(Ch(Ph(ol(a)),{select:!0}),document.activeElement===h&&Dt(a))}return()=>{a.removeEventListener(os,c),setTimeout(()=>{const w=new CustomEvent(ss,nl);a.addEventListener(ss,f),a.dispatchEvent(w),w.defaultPrevented||Dt(h??document.body,{select:!0}),a.removeEventListener(ss,f),il.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]=Sh(b);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&Dt(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&Dt(E,{select:!0})):w===b&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(xe.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});rl.displayName=xh;function Ch(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Dt(r,{select:t}),document.activeElement!==n)return}function Sh(e){const t=ol(e),n=sl(t,e),r=sl(t.reverse(),e);return[n,r]}function ol(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 sl(e,t){for(const n of e)if(!Eh(n,{upTo:t}))return n}function Eh(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 Nh(e){return e instanceof HTMLInputElement&&"select"in e}function Dt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Nh(e)&&t&&e.select()}}var il=Th();function Th(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=al(e,t),e.unshift(t)},remove(t){var n;e=al(e,t),(n=e[0])==null||n.resume()}}}function al(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ph(e){return e.filter(t=>t.tagName!=="A")}var Ah="Portal",is=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?fo.createPortal(l.jsx(xe.div,{...r,ref:t}),i):null});is.displayName=Ah;var as=0;function _h(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ll()),document.body.insertAdjacentElement("beforeend",e[1]??ll()),as++,()=>{as===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),as--}},[])}function ll(){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 cl(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 ul(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 dl(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 hr="right-scroll-bar-position",mr="width-before-scroll-bar",Fh="with-scroll-bars-hidden",Oh="--removed-body-scroll-bar-size";function ls(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dh(e,t){var n=A.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 Mh=typeof window<"u"?d.useLayoutEffect:d.useEffect,fl=new WeakMap;function Ih(e,t){var n=Dh(null,function(r){return e.forEach(function(o){return ls(o,r)})});return Mh(function(){var r=fl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||ls(a,null)}),s.forEach(function(a){o.has(a)||ls(a,i)})}fl.set(n,e)},[e]),n}function kh(e){return e}function $h(e,t){t===void 0&&(t=kh);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 Lh(e){e===void 0&&(e={});var t=$h(null);return t.options=ot({async:!0,ssr:!1},e),t}var pl=function(e){var t=e.sideCar,n=cl(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))};pl.isSideCarExport=!0;function Rh(e,t){return e.useMedium(t),pl}var gl=Lh(),cs=function(){},vr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:cs,onWheelCapture:cs,onTouchMoveCapture:cs}),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=cl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,C=Ih([n,t]),P=ot(ot({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:gl,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))});vr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vr.classNames={fullWidth:mr,zeroRight:hr};var Vh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Bh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Vh();return t&&e.setAttribute("nonce",t),e}function zh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Uh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Bh())&&(zh(t,n),Hh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jh=function(){var e=Uh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hl=function(){var e=jh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Wh={left:0,top:0,right:0,gap:0},us=function(e){return parseInt(e||"",10)||0},Gh=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[us(n),us(r),us(o)]},qh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Wh;var t=Gh(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])}},Kh=hl(),an="data-scroll-locked",Xh=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
103
+ .`.concat(Fh,` {
99
104
  overflow: hidden `).concat(r,`;
100
105
  padding-right: `).concat(a,"px ").concat(r,`;
101
106
  }
102
- body[`).concat(nn,`] {
107
+ body[`).concat(an,`] {
103
108
  overflow: hidden `).concat(r,`;
104
109
  overscroll-behavior: contain;
105
110
  `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -112,32 +117,32 @@
112
117
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
113
118
  }
114
119
 
115
- .`).concat(cr,` {
120
+ .`).concat(hr,` {
116
121
  right: `).concat(a,"px ").concat(r,`;
117
122
  }
118
123
 
119
- .`).concat(ur,` {
124
+ .`).concat(mr,` {
120
125
  margin-right: `).concat(a,"px ").concat(r,`;
121
126
  }
122
127
 
123
- .`).concat(cr," .").concat(cr,` {
128
+ .`).concat(hr," .").concat(hr,` {
124
129
  right: 0 `).concat(r,`;
125
130
  }
126
131
 
127
- .`).concat(ur," .").concat(ur,` {
132
+ .`).concat(mr," .").concat(mr,` {
128
133
  margin-right: 0 `).concat(r,`;
129
134
  }
130
135
 
131
- body[`).concat(nn,`] {
132
- `).concat(Ph,": ").concat(a,`px;
136
+ body[`).concat(an,`] {
137
+ `).concat(Oh,": ").concat(a,`px;
133
138
  }
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`
139
+ `)},ml=function(){var e=parseInt(document.body.getAttribute(an)||"0",10);return isFinite(e)?e:0},Jh=function(){d.useEffect(function(){return document.body.setAttribute(an,(ml()+1).toString()),function(){var e=ml()-1;e<=0?document.body.removeAttribute(an):document.body.setAttribute(an,e.toString())}},[])},Yh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Jh();var s=d.useMemo(function(){return qh(o)},[o]);return d.createElement(Kh,{styles:Xh(s,!t,o,n?"":"!important")})},ds=!1;if(typeof window<"u")try{var yr=Object.defineProperty({},"passive",{get:function(){return ds=!0,!0}});window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{ds=!1}var ln=ds?{passive:!1}:!1,Zh=function(e){return e.tagName==="TEXTAREA"},vl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Zh(e)&&n[t]==="visible")},Qh=function(e){return vl(e,"overflowY")},em=function(e){return vl(e,"overflowX")},yl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=wl(e,r);if(o){var s=bl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},tm=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},nm=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wl=function(e,t){return e==="v"?Qh(t):em(t)},bl=function(e,t){return e==="v"?tm(t):nm(t)},rm=function(e,t){return e==="h"&&t==="rtl"?-1:1},om=function(e,t,n,r,o){var s=rm(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=bl(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&wl(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},wr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xl=function(e){return[e.deltaX,e.deltaY]},Cl=function(e){return e&&"current"in e?e.current:e},sm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},im=function(e){return`
135
140
  .block-interactivity-`.concat(e,` {pointer-events: none;}
136
141
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
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.
142
+ `)},am=0,cn=[];function lm(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(am++)[0],s=d.useState(hl)[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=dl([e.lockRef.current],(e.shards||[]).map(Cl),!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=wr(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,F=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&F==="h"&&P.type==="range")return!1;var O=yl(F,P);if(!O)return!0;if(O?C=F:(C=F==="v"?"h":"v",O=yl(F,P)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=C),!C)return!0;var I=r.current||C;return om(I,y,h,I==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!cn.length||cn[cn.length-1]!==s)){var w="deltaY"in y?xl(y):wr(y),b=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&sm(C.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(Cl).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:cm(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=wr(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,xl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,wr(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return cn.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,ln),document.addEventListener("touchmove",u,ln),document.addEventListener("touchstart",f,ln),function(){cn=cn.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,ln),document.removeEventListener("touchmove",u,ln),document.removeEventListener("touchstart",f,ln)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:im(o)}):null,p?d.createElement(Yh,{gapMode:e.gapMode}):null)}function cm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const um=Rh(gl,lm);var Sl=d.forwardRef(function(e,t){return d.createElement(vr,ot({},e,{ref:t,sideCar:um}))});Sl.classNames=vr.classNames;var dm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},un=new WeakMap,br=new WeakMap,xr={},fs=0,El=function(e){return e&&(e.host||El(e.parentNode))},fm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=El(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})},pm=function(e,t,n,r){var o=fm(t,Array.isArray(e)?e:[e]);xr[n]||(xr[n]=new WeakMap);var s=xr[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=(un.get(m)||0)+1,y=(s.get(m)||0)+1;un.set(m,h),s.set(m,y),i.push(m),h===1&&v&&br.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(),fs++,function(){i.forEach(function(g){var m=un.get(g)-1,p=s.get(g)-1;un.set(g,m),s.set(g,p),m||(br.has(g)||g.removeAttribute(r),br.delete(g)),p||g.removeAttribute(n)}),fs--,fs||(un=new WeakMap,un=new WeakMap,br=new WeakMap,xr={})}},gm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=dm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),pm(r,o,n,"aria-hidden")):function(){return null}},Nl=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})});Nl.displayName="Slot";var ps=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=ym(n);return d.cloneElement(n,{...vm(r,n.props),ref:t?pr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ps.displayName="SlotClone";var hm=({children:e})=>l.jsx(l.Fragment,{children:e});function mm(e){return d.isValidElement(e)&&e.type===hm}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 ym(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 gs="Dialog",[Tl,uC]=Ft(gs),[wm,Ye]=Tl(gs),Pl=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]=rn({prop:r,defaultProp:o,onChange:s});return l.jsx(wm,{scope:t,triggerRef:a,contentRef:u,contentId:sn(),titleId:sn(),descriptionId:sn(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};Pl.displayName=gs;var Al="DialogTrigger",_l=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(Al,n),s=Ue(t,o.triggerRef);return l.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vs(o.open),...r,ref:s,onClick:be(e.onClick,o.onOpenToggle)})});_l.displayName=Al;var hs="DialogPortal",[bm,Fl]=Tl(hs,{forceMount:void 0}),Ol=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Ye(hs,t);return l.jsx(bm,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(on,{present:n||s.open,children:l.jsx(is,{asChild:!0,container:o,children:i})}))})};Ol.displayName=hs;var Cr="DialogOverlay",Dl=d.forwardRef((e,t)=>{const n=Fl(Cr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ye(Cr,e.__scopeDialog);return s.modal?l.jsx(on,{present:r||s.open,children:l.jsx(xm,{...o,ref:t})}):null});Dl.displayName=Cr;var xm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(Cr,n);return l.jsx(Sl,{as:Nl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(xe.div,{"data-state":vs(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Gt="DialogContent",Ml=d.forwardRef((e,t)=>{const n=Fl(Gt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ye(Gt,e.__scopeDialog);return l.jsx(on,{present:r||s.open,children:s.modal?l.jsx(Cm,{...o,ref:t}):l.jsx(Sm,{...o,ref:t})})});Ml.displayName=Gt;var Cm=d.forwardRef((e,t)=>{const n=Ye(Gt,e.__scopeDialog),r=d.useRef(null),o=Ue(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return gm(s)},[]),l.jsx(Il,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:be(e.onFocusOutside,s=>s.preventDefault())})}),Sm=d.forwardRef((e,t)=>{const n=Ye(Gt,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Il,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Il=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Ye(Gt,n),u=d.useRef(null),c=Ue(t,u);return _h(),l.jsxs(l.Fragment,{children:[l.jsx(rl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(rs,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":vs(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Em,{titleId:a.titleId}),l.jsx(Tm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),ms="DialogTitle",kl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(ms,n);return l.jsx(xe.h2,{id:o.titleId,...r,ref:t})});kl.displayName=ms;var $l="DialogDescription",Ll=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye($l,n);return l.jsx(xe.p,{id:o.descriptionId,...r,ref:t})});Ll.displayName=$l;var Rl="DialogClose",Vl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(Rl,n);return l.jsx(xe.button,{type:"button",...r,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});Vl.displayName=Rl;function vs(e){return e?"open":"closed"}var Bl="DialogTitleWarning",[dC,zl]=Kg(Bl,{contentName:Gt,titleName:ms,docsSlug:"dialog"}),Em=({titleId:e})=>{const t=zl(Bl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
138
143
 
139
144
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
140
145
 
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"})});
146
+ 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},Nm="DialogDescriptionWarning",Tm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(Nm).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},Pm=Pl,Am=_l,_m=Ol,Hl=Dl,Ul=Ml,jl=kl,Wl=Ll,Fm=Vl;const Mt=Pm,Sr=Am,Om=_m,Gl=d.forwardRef(({className:e,...t},n)=>l.jsx(Hl,{ref:n,className:ee("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}));Gl.displayName=Hl.displayName;const ht=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Om,{children:[l.jsx(Gl,{}),l.jsxs(Ul,{ref:r,className:ee("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(Fm,{className:ee("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(jo,{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"})]})]})]}));ht.displayName=Ul.displayName;const mt=({className:e,...t})=>l.jsx("div",{className:ee("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});mt.displayName="DialogHeader";const dn=({className:e,...t})=>l.jsx("div",{className:ee("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});dn.displayName="DialogFooter";const vt=d.forwardRef(({className:e,...t},n)=>l.jsx(jl,{ref:n,className:ee("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));vt.displayName=jl.displayName;const Mn=d.forwardRef(({className:e,...t},n)=>l.jsx(Wl,{ref:n,className:ee("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));Mn.displayName=Wl.displayName;const It=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:ee("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}));It.displayName="Input";var Dm="Label",ql=d.forwardRef((e,t)=>l.jsx(xe.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())}}));ql.displayName=Dm;var Kl=ql;const Mm=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"}}),qt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Kl,{ref:o,className:ee(Mm({variant:t,size:n}),e),...r}));qt.displayName=Kl.displayName;const Er=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:ee("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:ee("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));Er.displayName="Table";const Nr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:ee("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));Nr.displayName="TableHeader";const Tr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:ee("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));Tr.displayName="TableBody";const Im=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:ee("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Im.displayName="TableFooter";const Ze=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Ze.displayName="TableRow";const st=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:ee("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:ee("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 km=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:ee("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));km.displayName="TableCaption";function ys(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 fn(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 Xl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ws(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Xl(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():Xl(e[o],null)}}}}function bs(...e){return d.useCallback(ws(...e),e)}var xs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Lm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Cs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Cs,{...r,ref:t,children:n})});xs.displayName="Slot";var Cs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Vm(n);return d.cloneElement(n,{...Rm(r,n.props),ref:t?ws(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Cs.displayName="SlotClone";var $m=({children:e})=>l.jsx(l.Fragment,{children:e});function Lm(e){return d.isValidElement(e)&&e.type===$m}function Rm(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 Vm(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 Bm(e){const t=e+"CollectionProvider",[n,r]=Ft(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=A.useRef(null),w=A.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=A.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=bs(v,w.collectionRef);return l.jsx(xs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=A.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=A.useRef(null),S=bs(v,b),E=s(c,h);return A.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(xs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return A.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 Jl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Hm);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(Ss,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ss,{...r,ref:t,children:n})});Jl.displayName="Slot";var Ss=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=jm(n);return d.cloneElement(n,{...Um(r,n.props),ref:t?ws(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ss.displayName="SlotClone";var zm=({children:e})=>l.jsx(l.Fragment,{children:e});function Hm(e){return d.isValidElement(e)&&e.type===zm}function Um(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 jm(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 Wm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Yl=Wm.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Jl: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}},{}),Gm=d.createContext(void 0);function Zl(e){const t=d.useContext(Gm);return e||t||"ltr"}var Es="rovingFocusGroup.onEntryFocus",qm={bubbles:!1,cancelable:!0},Pr="RovingFocusGroup",[Ns,Ql,Km]=Bm(Pr),[Xm,ec]=Ft(Pr,[Km]),[Jm,Ym]=Xm(Pr),tc=d.forwardRef((e,t)=>l.jsx(Ns.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ns.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Zm,{...e,ref:t})})}));tc.displayName=Pr;var Zm=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=bs(t,m),v=Zl(s),[h=null,y]=rn({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=Pe(c),E=Ql(n),C=d.useRef(!1),[P,F]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(Es,S),()=>O.removeEventListener(Es,S)},[S]),l.jsx(Jm,{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(()=>F(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>F(O=>O-1),[]),children:l.jsx(Yl.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:fn(e.onMouseDown,()=>{C.current=!0}),onFocus:fn(e.onFocus,O=>{const I=!C.current;if(O.target===O.currentTarget&&I&&!w){const D=new CustomEvent(Es,qm);if(O.currentTarget.dispatchEvent(D),!D.defaultPrevented){const q=E().filter(V=>V.focusable),k=q.find(V=>V.active),U=q.find(V=>V.id===h),z=[k,U,...q].filter(Boolean).map(V=>V.ref.current);oc(z,f)}}C.current=!1}),onBlur:fn(e.onBlur,()=>b(!1))})})}),nc="RovingFocusGroupItem",rc=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=sn(),u=s||a,c=Ym(nc,n),f=c.currentTabStopId===u,g=Ql(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(Ns.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Yl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:fn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:fn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:fn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=tv(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?nv(w,b+1):w.slice(b+1)}setTimeout(()=>oc(w))}})})})});rc.displayName=nc;var Qm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ev(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tv(e,t,n){const r=ev(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Qm[r]}function oc(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rv=tc,ov=rc;function sc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=sc(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():sc(e[o],null)}}}}function iv(...e){return d.useCallback(sv(...e),e)}function av(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var ic=e=>{const{present:t,children:n}=e,r=lv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=iv(r.ref,cv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};ic.displayName="Presence";function lv(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=av(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Ar(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=Ar(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=Ar(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=Ar(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 Ar(e){return(e==null?void 0:e.animationName)||"none"}function cv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ac(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function uv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ac(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():ac(e[o],null)}}}}var lc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(fv);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(Ts,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ts,{...r,ref:t,children:n})});lc.displayName="Slot";var Ts=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=gv(n);return d.cloneElement(n,{...pv(r,n.props),ref:t?uv(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ts.displayName="SlotClone";var dv=({children:e})=>l.jsx(l.Fragment,{children:e});function fv(e){return d.isValidElement(e)&&e.type===dv}function pv(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 gv(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 hv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],_r=hv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?lc: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}},{}),Ps="Tabs",[mv,fC]=Ft(Ps,[ec]),cc=ec(),[vv,As]=mv(Ps),uc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=Zl(a),[g,m]=rn({prop:r,onChange:o,defaultProp:s});return l.jsx(vv,{scope:n,baseId:sn(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(_r.div,{dir:f,"data-orientation":i,...c,ref:t})})});uc.displayName=Ps;var dc="TabsList",fc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=As(dc,n),i=cc(n);return l.jsx(rv,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(_r.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});fc.displayName=dc;var pc="TabsTrigger",gc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=As(pc,n),a=cc(n),u=vc(i.baseId,r),c=yc(i.baseId,r),f=r===i.value;return l.jsx(ov,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(_r.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:ys(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:ys(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:ys(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});gc.displayName=pc;var hc="TabsContent",mc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=As(hc,n),u=vc(a.baseId,r),c=yc(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(ic,{present:o||f,children:({present:m})=>l.jsx(_r.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})})});mc.displayName=hc;function vc(e,t){return`${e}-trigger-${t}`}function yc(e,t){return`${e}-content-${t}`}var yv=uc,wc=fc,bc=gc,xc=mc;const wv=yv,Cc=d.forwardRef(({className:e,...t},n)=>l.jsx(wc,{ref:n,className:ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Cc.displayName=wc.displayName;const Fr=d.forwardRef(({className:e,...t},n)=>l.jsx(bc,{ref:n,className:ee("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}));Fr.displayName=bc.displayName;const Or=d.forwardRef(({className:e,...t},n)=>l.jsx(xc,{ref:n,className:ee("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Or.displayName=xc.displayName;const In=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:ee("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}));In.displayName="Textarea";function bv(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,xv(o,...t)]}function xv(...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 _s=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Sv);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})});_s.displayName="Slot";var Fs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Nv(n);return d.cloneElement(n,{...Ev(r,n.props),ref:t?pr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Fs.displayName="SlotClone";var Cv=({children:e})=>l.jsx(l.Fragment,{children:e});function Sv(e){return d.isValidElement(e)&&e.type===Cv}function Ev(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 Nv(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 Tv(e){const t=e+"CollectionProvider",[n,r]=bv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=A.useRef(null),w=A.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=A.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=Ue(v,w.collectionRef);return l.jsx(_s,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=A.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=A.useRef(null),S=Ue(v,b),E=s(c,h);return A.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(_s,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return A.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 Pv="VisuallyHidden",Os=d.forwardRef((e,t)=>l.jsx(xe.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}}));Os.displayName=Pv;var Ds="ToastProvider",[Ms,Av,_v]=Tv("Toast"),[Sc,pC]=Ft("Toast",[_v]),[Fv,Dr]=Sc(Ds),Ec=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 \`${Ds}\`. Expected non-empty \`string\`.`),l.jsx(Ms.Provider,{scope:t,children:l.jsx(Fv,{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})})};Ec.displayName=Ds;var Nc="ToastViewport",Ov=["F8"],Is="toast.viewportPause",ks="toast.viewportResume",Tc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Ov,label:o="Notifications ({hotkey})",...s}=e,i=Dr(Nc,n),a=Av(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=Ue(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(Is);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(ks);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,...jv(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,F;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const O=document.activeElement,I=b.shiftKey;if(b.target===y&&I){(C=c.current)==null||C.focus();return}const k=h({tabbingDirection:I?"backwards":"forwards"}),U=k.findIndex(R=>R===O);Rs(k.slice(U+1))?b.preventDefault():I?(P=c.current)==null||P.focus():(F=f.current)==null||F.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(bh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx($s,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});Rs(y)}}),l.jsx(Ms.Slot,{scope:n,children:l.jsx(xe.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx($s,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});Rs(y)}})]})});Tc.displayName=Nc;var Pc="ToastFocusProxy",$s=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Dr(Pc,n);return l.jsx(Os,{"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()}})});$s.displayName=Pc;var Mr="Toast",Dv="toast.swipeStart",Mv="toast.swipeMove",Iv="toast.swipeCancel",kv="toast.swipeEnd",Ac=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=rn({prop:r,defaultProp:o,onChange:s});return l.jsx(on,{present:n||a,children:l.jsx(Rv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Pe(e.onPause),onResume:Pe(e.onResume),onSwipeStart:be(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:be(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:be(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:be(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)})})})});Ac.displayName=Mr;var[$v,Lv]=Sc(Mr,{onClose(){}}),Rv=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=Dr(Mr,n),[y,w]=d.useState(null),b=Ue(t,R=>w(R)),S=d.useRef(null),E=d.useRef(null),C=o||h.duration,P=d.useRef(0),F=d.useRef(C),O=d.useRef(0),{onToastAdd:I,onToastRemove:D}=h,q=Pe(()=>{var z;(y==null?void 0:y.contains(document.activeElement))&&((z=h.viewport)==null||z.focus()),i()}),k=d.useCallback(R=>{!R||R===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(q,R))},[q]);d.useEffect(()=>{const R=h.viewport;if(R){const z=()=>{k(F.current),c==null||c()},V=()=>{const J=new Date().getTime()-P.current;F.current=F.current-J,window.clearTimeout(O.current),u==null||u()};return R.addEventListener(Is,V),R.addEventListener(ks,z),()=>{R.removeEventListener(Is,V),R.removeEventListener(ks,z)}}},[h.viewport,C,u,c,k]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&k(C)},[s,C,h.isClosePausedRef,k]),d.useEffect(()=>(I(),()=>D()),[I,D]);const U=d.useMemo(()=>y?kc(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[U&&l.jsx(Vv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),l.jsx($v,{scope:n,onClose:q,children:Jn.createPortal(l.jsx(Ms.ItemSlot,{scope:n,children:l.jsx(wh,{asChild:!0,onEscapeKeyDown:be(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||q(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(xe.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:be(e.onKeyDown,R=>{R.key==="Escape"&&(a==null||a(R.nativeEvent),R.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:be(e.onPointerDown,R=>{R.button===0&&(S.current={x:R.clientX,y:R.clientY})}),onPointerMove:be(e.onPointerMove,R=>{if(!S.current)return;const z=R.clientX-S.current.x,V=R.clientY-S.current.y,J=!!E.current,G=["left","right"].includes(h.swipeDirection),Q=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,le=G?Q(0,z):0,ue=G?0:Q(0,V),Me=R.pointerType==="touch"?10:2,Ie={x:le,y:ue},Be={originalEvent:R,delta:Ie};J?(E.current=Ie,Ir(Mv,g,Be,{discrete:!1})):$c(Ie,h.swipeDirection,Me)?(E.current=Ie,Ir(Dv,f,Be,{discrete:!1}),R.target.setPointerCapture(R.pointerId)):(Math.abs(z)>Me||Math.abs(V)>Me)&&(S.current=null)}),onPointerUp:be(e.onPointerUp,R=>{const z=E.current,V=R.target;if(V.hasPointerCapture(R.pointerId)&&V.releasePointerCapture(R.pointerId),E.current=null,S.current=null,z){const J=R.currentTarget,G={originalEvent:R,delta:z};$c(z,h.swipeDirection,h.swipeThreshold)?Ir(kv,p,G,{discrete:!0}):Ir(Iv,m,G,{discrete:!0}),J.addEventListener("click",Q=>Q.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Vv=e=>{const{__scopeToast:t,children:n,...r}=e,o=Dr(Mr,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Hv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(is,{asChild:!0,children:l.jsx(Os,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Bv="ToastTitle",_c=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(xe.div,{...r,ref:t})});_c.displayName=Bv;var zv="ToastDescription",Fc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(xe.div,{...r,ref:t})});Fc.displayName=zv;var Oc="ToastAction",Dc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Ic,{altText:n,asChild:!0,children:l.jsx(Ls,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Oc}\`. Expected non-empty \`string\`.`),null)});Dc.displayName=Oc;var Mc="ToastClose",Ls=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Lv(Mc,n);return l.jsx(Ic,{asChild:!0,children:l.jsx(xe.button,{type:"button",...r,ref:t,onClick:be(e.onClick,o.onClose)})})});Ls.displayName=Mc;var Ic=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(xe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function kc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Uv(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(...kc(r))}}),t}function Ir(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ja(o,s):o.dispatchEvent(s)}var $c=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function Hv(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 Uv(e){return e.nodeType===e.ELEMENT_NODE}function jv(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 Rs(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Wv=Ec,Lc=Tc,Rc=Ac,Vc=_c,Bc=Fc,zc=Dc,Hc=Ls;const Gv=Wv,Uc=d.forwardRef(({className:e,...t},n)=>l.jsx(Lc,{ref:n,className:ee("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}));Uc.displayName=Lc.displayName;const qv=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"}}),jc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Rc,{ref:r,className:ee(qv({variant:t}),e),...n}));jc.displayName=Rc.displayName;const Kv=d.forwardRef(({className:e,...t},n)=>l.jsx(zc,{ref:n,className:ee("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}));Kv.displayName=zc.displayName;const Wc=d.forwardRef(({className:e,...t},n)=>l.jsx(Hc,{ref:n,className:ee("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(jo,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Wc.displayName=Hc.displayName;const Gc=d.forwardRef(({className:e,...t},n)=>l.jsx(Vc,{ref:n,className:ee("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Gc.displayName=Vc.displayName;const qc=d.forwardRef(({className:e,...t},n)=>l.jsx(Bc,{ref:n,className:ee("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));qc.displayName=Bc.displayName;const Xv=1,Jv=1e6;let Vs=0;function Yv(){return Vs=(Vs+1)%Number.MAX_SAFE_INTEGER,Vs.toString()}const Bs=new Map,Kc=e=>{if(Bs.has(e))return;const t=setTimeout(()=>{Bs.delete(e),kn({type:"REMOVE_TOAST",toastId:e})},Jv);Bs.set(e,t)},Zv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Xv)};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?Kc(n):e.toasts.forEach(r=>{Kc(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)}}},kr=[];let $r={toasts:[]};function kn(e){$r=Zv($r,e),kr.forEach(t=>{t($r)})}function Qv({...e}){const t=Yv(),n=o=>kn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>kn({type:"DISMISS_TOAST",toastId:t});return kn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Lr(){const[e,t]=d.useState($r);return d.useEffect(()=>(kr.push(t),()=>{const n=kr.indexOf(t);n>-1&&kr.splice(n,1)}),[e]),{...e,toast:Qv,dismiss:n=>kn({type:"DISMISS_TOAST",toastId:n})}}function Xc(){const{toasts:e}=Lr();return l.jsxs(Gv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(jc,{...s,className:`s3-explr-ui-toast ${s.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(Gc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(qc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Wc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(Uc,{className:"s3-explr-ui-toast-viewport"})]})}function yt(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 Jc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ey(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Jc(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():Jc(e[o],null)}}}}function $n(...e){return d.useCallback(ey(...e),e)}var ty=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ln=ty.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?en: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 ny(e,t){e&&Jn.flushSync(()=>e.dispatchEvent(t))}var ry="DismissableLayer",zs="dismissableLayer.update",oy="dismissableLayer.pointerDownOutside",sy="dismissableLayer.focusOutside",Yc,Zc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qc=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Zc),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=$n(t,F=>g(F)),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=ly(F=>{const O=F.target,I=[...c.branches].some(D=>D.contains(O));!E||I||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},m),P=cy(F=>{const O=F.target;[...c.branches].some(D=>D.contains(O))||(s==null||s(F),i==null||i(F),F.defaultPrevented||a==null||a())},m);return Ja(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Yc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),eu(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Yc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),eu())},[f,c]),d.useEffect(()=>{const F=()=>p({});return document.addEventListener(zs,F),()=>document.removeEventListener(zs,F)},[]),l.jsx(Ln.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:yt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:yt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:yt(e.onPointerDownCapture,C.onPointerDownCapture)})});Qc.displayName=ry;var iy="DismissableLayerBranch",ay=d.forwardRef((e,t)=>{const n=d.useContext(Zc),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(Ln.div,{...e,ref:o})});ay.displayName=iy;function ly(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(){tu(oy,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 cy(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&&tu(sy,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 eu(){const e=new CustomEvent(zs);document.dispatchEvent(e)}function tu(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?ny(o,s):o.dispatchEvent(s)}const uy=["top","right","bottom","left"],kt=Math.min,Re=Math.max,Rr=Math.round,Vr=Math.floor,it=e=>({x:e,y:e}),dy={left:"right",right:"left",bottom:"top",top:"bottom"},fy={start:"end",end:"start"};function Hs(e,t,n){return Re(e,kt(t,n))}function wt(e,t){return typeof e=="function"?e(t):e}function bt(e){return e.split("-")[0]}function pn(e){return e.split("-")[1]}function Us(e){return e==="x"?"y":"x"}function js(e){return e==="y"?"height":"width"}function $t(e){return["top","bottom"].includes(bt(e))?"y":"x"}function Ws(e){return Us($t(e))}function py(e,t,n){n===void 0&&(n=!1);const r=pn(e),o=Ws(e),s=js(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Br(i)),[i,Br(i)]}function gy(e){const t=Br(e);return[Gs(e),t,Gs(t)]}function Gs(e){return e.replace(/start|end/g,t=>fy[t])}function hy(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 my(e,t,n,r){const o=pn(e);let s=hy(bt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Gs)))),s}function Br(e){return e.replace(/left|right|bottom|top/g,t=>dy[t])}function vy(e){return{top:0,right:0,bottom:0,left:0,...e}}function nu(e){return typeof e!="number"?vy(e):{top:e,right:e,bottom:e,left:e}}function zr(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 ru(e,t,n){let{reference:r,floating:o}=e;const s=$t(t),i=Ws(t),a=js(i),u=bt(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(pn(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const yy=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}=ru(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}=ru(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function Rn(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}=wt(t,e),v=nu(p),y=a[m?g==="floating"?"reference":"floating":g],w=zr(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=zr(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 wy=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}=wt(e,t)||{};if(c==null)return{};const g=nu(f),m={x:n,y:r},p=Ws(o),v=js(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 F=P?P[S]:0;(!F||!await(i.isElement==null?void 0:i.isElement(P)))&&(F=a.floating[S]||s.floating[v]);const O=E/2-C/2,I=F/2-h[v]/2-1,D=kt(g[w],I),q=kt(g[b],I),k=D,U=F-h[v]-q,R=F/2-h[v]/2+O,z=Hs(k,R,U),V=!u.arrow&&pn(o)!=null&&R!==z&&s.reference[v]/2-(R<k?D:q)-h[v]/2<0,J=V?R<k?R-k:R-U:0;return{[p]:m[p]+J,data:{[p]:z,centerOffset:R-z-J,...V&&{alignmentOffset:J}},reset:V}}}),by=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}=wt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=bt(o),b=$t(a),S=bt(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=m||(S||!h?[Br(a)]:gy(a)),P=v!=="none";!m&&P&&C.push(...my(a,h,v,E));const F=[a,...C],O=await Rn(t,y),I=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&I.push(O[w]),g){const R=py(o,i,E);I.push(O[R[0]],O[R[1]])}if(D=[...D,{placement:o,overflows:I}],!I.every(R=>R<=0)){var q,k;const R=(((q=s.flip)==null?void 0:q.index)||0)+1,z=F[R];if(z)return{data:{index:R,overflows:D},reset:{placement:z}};let V=(k=D.filter(J=>J.overflows[0]<=0).sort((J,G)=>J.overflows[1]-G.overflows[1])[0])==null?void 0:k.placement;if(!V)switch(p){case"bestFit":{var U;const J=(U=D.filter(G=>{if(P){const Q=$t(G.placement);return Q===b||Q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(Q=>Q>0).reduce((Q,le)=>Q+le,0)]).sort((G,Q)=>G[1]-Q[1])[0])==null?void 0:U[0];J&&(V=J);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function ou(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function su(e){return uy.some(t=>e[t]>=0)}const xy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=wt(e,t);switch(r){case"referenceHidden":{const s=await Rn(t,{...o,elementContext:"reference"}),i=ou(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:su(i)}}}case"escaped":{const s=await Rn(t,{...o,altBoundary:!0}),i=ou(s,n.floating);return{data:{escapedOffsets:i,escaped:su(i)}}}default:return{}}}}};async function Cy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=bt(n),a=pn(n),u=$t(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=wt(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 Sy=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 Cy(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}}}}},Ey=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}=wt(e,t),c={x:n,y:r},f=await Rn(t,u),g=$t(bt(o)),m=Us(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=Hs(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=Hs(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}}}}}},Ny=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}=wt(e,t),f={x:n,y:r},g=$t(o),m=Us(g);let p=f[m],v=f[g];const h=wt(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(bt(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}}}},Ty=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}=wt(e,t),f=await Rn(t,c),g=bt(o),m=pn(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=kt(h-f[y],b),C=kt(v-f[w],S),P=!t.middlewareData.shift;let F=E,O=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=b),P&&!m){const D=Re(f.left,0),q=Re(f.right,0),k=Re(f.top,0),U=Re(f.bottom,0);p?O=v-2*(D!==0||q!==0?D+q:Re(f.left,f.right)):F=h-2*(k!==0||U!==0?k+U:Re(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:F});const I=await i.getDimensions(a.floating);return v!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function Hr(){return typeof window<"u"}function gn(e){return iu(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function at(e){var t;return(t=(iu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function iu(e){return Hr()?e instanceof Node||e instanceof Ve(e).Node:!1}function Qe(e){return Hr()?e instanceof Element||e instanceof Ve(e).Element:!1}function lt(e){return Hr()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function au(e){return!Hr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}function Vn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=et(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Py(e){return["table","td","th"].includes(gn(e))}function Ur(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function qs(e){const t=Ks(),n=Qe(e)?et(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 Ay(e){let t=Lt(e);for(;lt(t)&&!hn(t);){if(qs(t))return t;if(Ur(t))return null;t=Lt(t)}return null}function Ks(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hn(e){return["html","body","#document"].includes(gn(e))}function et(e){return Ve(e).getComputedStyle(e)}function jr(e){return Qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lt(e){if(gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||au(e)&&e.host||at(e);return au(t)?t.host:t}function lu(e){const t=Lt(e);return hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:lt(t)&&Vn(t)?t:lu(t)}function Bn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=lu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ve(o);if(s){const a=Xs(i);return t.concat(i,i.visualViewport||[],Vn(o)?o:[],a&&n?Bn(a):[])}return t.concat(o,Bn(o,[],n))}function Xs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cu(e){const t=et(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=Rr(n)!==s||Rr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Js(e){return Qe(e)?e:e.contextElement}function mn(e){const t=Js(e);if(!lt(t))return it(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=cu(t);let i=(s?Rr(n.width):n.width)/r,a=(s?Rr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const _y=it(0);function uu(e){const t=Ve(e);return!Ks()||!t.visualViewport?_y:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ve(e)?!1:t}function Kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Js(e);let i=it(1);t&&(r?Qe(r)&&(i=mn(r)):i=mn(e));const a=Fy(s,n,r)?uu(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=Ve(s),p=r&&Qe(r)?Ve(r):r;let v=m,h=Xs(v);for(;h&&r&&p!==v;){const y=mn(h),w=h.getBoundingClientRect(),b=et(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=Xs(v)}}return zr({width:f,height:g,x:u,y:c})}function Ys(e,t){const n=jr(e).scrollLeft;return t?t.left+n:Kt(at(e)).left+n}function du(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ys(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Oy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=at(r),a=t?Ur(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)&&((gn(r)!=="body"||Vn(i))&&(u=jr(r)),lt(r))){const p=Kt(r);c=mn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?du(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 Dy(e){return Array.from(e.getClientRects())}function My(e){const t=at(e),n=jr(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+Ys(e);const a=-n.scrollTop;return et(r).direction==="rtl"&&(i+=Re(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Iy(e,t){const n=Ve(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=Ks();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function ky(e,t){const n=Kt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=lt(e)?mn(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 fu(e,t,n){let r;if(t==="viewport")r=Iy(e,n);else if(t==="document")r=My(at(e));else if(Qe(t))r=ky(t,n);else{const o=uu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return zr(r)}function pu(e,t){const n=Lt(e);return n===t||!Qe(n)||hn(n)?!1:et(n).position==="fixed"||pu(n,t)}function $y(e,t){const n=t.get(e);if(n)return n;let r=Bn(e,[],!1).filter(a=>Qe(a)&&gn(a)!=="body"),o=null;const s=et(e).position==="fixed";let i=s?Lt(e):e;for(;Qe(i)&&!hn(i);){const a=et(i),u=qs(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Vn(i)&&!u&&pu(e,i))?r=r.filter(f=>f!==i):o=a,i=Lt(i)}return t.set(e,r),r}function Ly(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Ur(t)?[]:$y(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=fu(t,f,o);return c.top=Re(g.top,c.top),c.right=kt(g.right,c.right),c.bottom=kt(g.bottom,c.bottom),c.left=Re(g.left,c.left),c},fu(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ry(e){const{width:t,height:n}=cu(e);return{width:t,height:n}}function Vy(e,t,n){const r=lt(t),o=at(t),s=n==="fixed",i=Kt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=it(0);if(r||!r&&!s)if((gn(t)!=="body"||Vn(o))&&(a=jr(t)),r){const m=Kt(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Ys(o));const c=o&&!r&&!s?du(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 Zs(e){return et(e).position==="static"}function gu(e,t){if(!lt(e)||et(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return at(e)===n&&(n=n.ownerDocument.body),n}function hu(e,t){const n=Ve(e);if(Ur(e))return n;if(!lt(e)){let o=Lt(e);for(;o&&!hn(o);){if(Qe(o)&&!Zs(o))return o;o=Lt(o)}return n}let r=gu(e,t);for(;r&&Py(r)&&Zs(r);)r=gu(r,t);return r&&hn(r)&&Zs(r)&&!qs(r)?n:r||Ay(e)||n}const By=async function(e){const t=this.getOffsetParent||hu,n=this.getDimensions,r=await n(e.floating);return{reference:Vy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zy(e){return et(e).direction==="rtl"}const Hy={convertOffsetParentRelativeRectToViewportRelativeRect:Oy,getDocumentElement:at,getClippingRect:Ly,getOffsetParent:hu,getElementRects:By,getClientRects:Dy,getDimensions:Ry,getScale:mn,isElement:Qe,isRTL:zy};function Uy(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=Vr(f),v=Vr(o.clientWidth-(c+g)),h=Vr(o.clientHeight-(f+m)),y=Vr(c),b={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Re(0,kt(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 jy(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=Js(e),f=o||s?[...c?Bn(c):[],...Bn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?Uy(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?Kt(e):null;u&&y();function y(){const w=Kt(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 Wy=Sy,Gy=Ey,qy=by,Ky=Ty,Xy=xy,mu=wy,Jy=Ny,Yy=(e,t,n)=>{const r=new Map,o={platform:Hy,...n},s={...o.platform,_c:r};return yy(e,t,{...o,platform:s})};var Wr=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Gr(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(!Gr(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)&&!Gr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function vu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yu(e,t){const n=vu(e);return Math.round(t*n)/n}function Qs(e){const t=d.useRef(e);return Wr(()=>{t.current=e}),t}function Zy(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);Gr(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),b=d.useCallback(G=>{G!==P.current&&(P.current=G,h(G))},[]),S=d.useCallback(G=>{G!==F.current&&(F.current=G,w(G))},[]),E=s||v,C=i||y,P=d.useRef(null),F=d.useRef(null),O=d.useRef(f),I=u!=null,D=Qs(u),q=Qs(o),k=Qs(c),U=d.useCallback(()=>{if(!P.current||!F.current)return;const G={placement:t,strategy:n,middleware:m};q.current&&(G.platform=q.current),Yy(P.current,F.current,G).then(Q=>{const le={...Q,isPositioned:k.current!==!1};R.current&&!Gr(O.current,le)&&(O.current=le,Jn.flushSync(()=>{g(le)}))})},[m,t,n,q,k]);Wr(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(G=>({...G,isPositioned:!1})))},[c]);const R=d.useRef(!1);Wr(()=>(R.current=!0,()=>{R.current=!1}),[]),Wr(()=>{if(E&&(P.current=E),C&&(F.current=C),E&&C){if(D.current)return D.current(E,C,U);U()}},[E,C,U,D,I]);const z=d.useMemo(()=>({reference:P,floating:F,setReference:b,setFloating:S}),[b,S]),V=d.useMemo(()=>({reference:E,floating:C}),[E,C]),J=d.useMemo(()=>{const G={position:n,left:0,top:0};if(!V.floating)return G;const Q=yu(V.floating,f.x),le=yu(V.floating,f.y);return a?{...G,transform:"translate("+Q+"px, "+le+"px)",...vu(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:le}},[n,a,V.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:U,refs:z,elements:V,floatingStyles:J}),[f,U,z,V,J])}const Qy=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?mu({element:r.current,padding:o}).fn(n):{}:r?mu({element:r,padding:o}).fn(n):{}}}},ew=(e,t)=>({...Wy(e),options:[e,t]}),tw=(e,t)=>({...Gy(e),options:[e,t]}),nw=(e,t)=>({...Jy(e),options:[e,t]}),rw=(e,t)=>({...qy(e),options:[e,t]}),ow=(e,t)=>({...Ky(e),options:[e,t]}),sw=(e,t)=>({...Xy(e),options:[e,t]}),iw=(e,t)=>({...Qy(e),options:[e,t]});var aw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],lw=aw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?en: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}},{}),cw="Arrow",wu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(lw.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"})})});wu.displayName=cw;var uw=wu;function bu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=bu(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():bu(e[o],null)}}}}function xu(...e){return d.useCallback(dw(...e),e)}var fw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Cu=fw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?en: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}},{}),ei="Popper",[Su,Eu]=Ft(ei),[pw,Nu]=Su(ei),Tu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(pw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Tu.displayName=ei;var Pu="PopperAnchor",Au=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Nu(Pu,n),i=d.useRef(null),a=xu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(Cu.div,{...o,ref:a})});Au.displayName=Pu;var ti="PopperContent",[gw,hw]=Su(ti),_u=d.forwardRef((e,t)=>{var Ne,nt,Te,St,Bt,We;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=Nu(ti,n),[w,b]=d.useState(null),S=xu(t,ze=>b(ze)),[E,C]=d.useState(null),P=Ha(E),F=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,I=r+(s!=="center"?"-"+s:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},q=Array.isArray(c)?c:[c],k=q.length>0,U={padding:D,boundary:q.filter(vw),altBoundary:k},{refs:R,floatingStyles:z,placement:V,isPositioned:J,middlewareData:G}=Zy({strategy:"fixed",placement:I,whileElementsMounted:(...ze)=>jy(...ze,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[ew({mainAxis:o+O,alignmentAxis:i}),u&&tw({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?nw():void 0,...U}),u&&rw({...U}),ow({...U,apply:({elements:ze,rects:Et,availableWidth:zt,availableHeight:so})=>{const{width:Sn,height:x}=Et.reference,N=ze.floating.style;N.setProperty("--radix-popper-available-width",`${zt}px`),N.setProperty("--radix-popper-available-height",`${so}px`),N.setProperty("--radix-popper-anchor-width",`${Sn}px`),N.setProperty("--radix-popper-anchor-height",`${x}px`)}}),E&&iw({element:E,padding:a}),yw({arrowWidth:F,arrowHeight:O}),m&&sw({strategy:"referenceHidden",...U})]}),[Q,le]=Du(V),ue=Pe(v);Le(()=>{J&&(ue==null||ue())},[J,ue]);const Me=(Ne=G.arrow)==null?void 0:Ne.x,Ie=(nt=G.arrow)==null?void 0:nt.y,Be=((Te=G.arrow)==null?void 0:Te.centerOffset)!==0,[Vt,me]=d.useState();return Le(()=>{w&&me(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:J?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Vt,"--radix-popper-transform-origin":[(St=G.transformOrigin)==null?void 0:St.x,(Bt=G.transformOrigin)==null?void 0:Bt.y].join(" "),...((We=G.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(gw,{scope:n,placedSide:Q,onArrowChange:C,arrowX:Me,arrowY:Ie,shouldHideArrow:Be,children:l.jsx(Cu.div,{"data-side":Q,"data-align":le,...h,ref:S,style:{...h.style,animation:J?void 0:"none"}})})})});_u.displayName=ti;var Fu="PopperArrow",mw={top:"bottom",right:"left",bottom:"top",left:"right"},Ou=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=hw(Fu,r),i=mw[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(uw,{...o,ref:n,style:{...o.style,display:"block"}})})});Ou.displayName=Fu;function vw(e){return e!==null}var yw=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]=Du(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 Du(e){const[t,n="center"]=e.split("-");return[t,n]}var ww=Tu,bw=Au,xw=_u,Cw=Ou,Sw="Portal",Mu=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?fo.createPortal(l.jsx(Ln.div,{...r,ref:t}),i):null});Mu.displayName=Sw;function Ew(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var ni=e=>{const{present:t,children:n}=e,r=Nw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=$n(r.ref,Tw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};ni.displayName="Presence";function Nw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Ew(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=qr(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=qr(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=qr(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=qr(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 qr(e){return(e==null?void 0:e.animationName)||"none"}function Tw(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 Pw="VisuallyHidden",Iu=d.forwardRef((e,t)=>l.jsx(Ln.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Iu.displayName=Pw;var Aw=Iu,[Kr,gC]=Ft("Tooltip",[Eu]),Xr=Eu(),ku="TooltipProvider",_w=700,ri="tooltip.open",[Fw,oi]=Kr(ku),$u=e=>{const{__scopeTooltip:t,delayDuration:n=_w,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[i,a]=d.useState(!0),u=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),l.jsx(Fw,{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=ku;var Jr="Tooltip",[Ow,zn]=Kr(Jr),Lu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=oi(Jr,e.__scopeTooltip),c=Xr(t),[f,g]=d.useState(null),m=sn(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=rn({prop:r,defaultProp:o,onChange:F=>{F?(u.onOpen(),document.dispatchEvent(new CustomEvent(ri))):u.onClose(),s==null||s(F)}}),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(ww,{...c,children:l.jsx(Ow,{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})})};Lu.displayName=Jr;var si="TooltipTrigger",Ru=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zn(si,n),s=oi(si,n),i=Xr(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(bw,{asChild:!0,...i,children:l.jsx(Ln.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:yt(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:yt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:yt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:yt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:yt(e.onBlur,o.onClose),onClick:yt(e.onClick,o.onClose)})})});Ru.displayName=si;var ii="TooltipPortal",[Dw,Mw]=Kr(ii,{forceMount:void 0}),Vu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=zn(ii,t);return l.jsx(Dw,{scope:t,forceMount:n,children:l.jsx(ni,{present:n||s.open,children:l.jsx(Mu,{asChild:!0,container:o,children:r})})})};Vu.displayName=ii;var vn="TooltipContent",Bu=d.forwardRef((e,t)=>{const n=Mw(vn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=zn(vn,e.__scopeTooltip);return l.jsx(ni,{present:r||i.open,children:i.disableHoverableContent?l.jsx(zu,{side:o,...s,ref:t}):l.jsx(Iw,{side:o,...s,ref:t})})}),Iw=d.forwardRef((e,t)=>{const n=zn(vn,e.__scopeTooltip),r=oi(vn,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=Rw(w,y.getBoundingClientRect()),S=Vw(w,b),E=Bw(h.getBoundingClientRect()),C=Hw([...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=!zw(w,i);b?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(zu,{...e,ref:s})}),[kw,$w]=Kr(Jr,{isInside:!1}),zu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=zn(vn,n),c=Xr(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(ri,f),()=>document.removeEventListener(ri,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(Qc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(xw,{"data-state":u.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Ta,{children:r}),l.jsx(kw,{scope:n,isInside:!0,children:l.jsx(Aw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Bu.displayName=vn;var Hu="TooltipArrow",Lw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Xr(n);return $w(Hu,n).isInside?null:l.jsx(Cw,{...o,...r,ref:t})});Lw.displayName=Hu;function Rw(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 Vw(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 Bw(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 zw(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 Hw(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),Uw(t)}function Uw(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 jw=$u,Ww=Lu,Gw=Ru,qw=Vu,Uu=Bu;const yn=jw,wn=Ww,bn=Gw,Xt=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(qw,{children:l.jsx(Uu,{ref:r,sideOffset:t,className:ee("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})}));Xt.displayName=Uu.displayName;function Kw({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 Xw=d.forwardRef(Kw);var Jw=function(e){return function(t,n){var r=A.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},ju=function(e){return typeof e=="function"},Wu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const Yw=Jw(A.useEffect);function Gu(e){var t=A.useRef(e);return t.current=e,t}var Zw=function(e){Wu&&(ju(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Gu(e);A.useEffect(function(){return function(){t.current()}},[])},Yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function eb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var qu=eb,tb=typeof Yr=="object"&&Yr&&Yr.Object===Object&&Yr,nb=tb,rb=nb,ob=typeof self=="object"&&self&&self.Object===Object&&self,sb=rb||ob||Function("return this")(),Ku=sb,ib=Ku,ab=function(){return ib.Date.now()},lb=ab,cb=/\s/;function ub(e){for(var t=e.length;t--&&cb.test(e.charAt(t)););return t}var db=ub,fb=db,pb=/^\s+/;function gb(e){return e&&e.slice(0,fb(e)+1).replace(pb,"")}var hb=gb,mb=Ku,vb=mb.Symbol,Xu=vb,Ju=Xu,Yu=Object.prototype,yb=Yu.hasOwnProperty,wb=Yu.toString,Hn=Ju?Ju.toStringTag:void 0;function bb(e){var t=yb.call(e,Hn),n=e[Hn];try{e[Hn]=void 0;var r=!0}catch{}var o=wb.call(e);return r&&(t?e[Hn]=n:delete e[Hn]),o}var xb=bb,Cb=Object.prototype,Sb=Cb.toString;function Eb(e){return Sb.call(e)}var Nb=Eb,Zu=Xu,Tb=xb,Pb=Nb,Ab="[object Null]",_b="[object Undefined]",Qu=Zu?Zu.toStringTag:void 0;function Fb(e){return e==null?e===void 0?_b:Ab:Qu&&Qu in Object(e)?Tb(e):Pb(e)}var Ob=Fb;function Db(e){return e!=null&&typeof e=="object"}var Mb=Db,Ib=Ob,kb=Mb,$b="[object Symbol]";function Lb(e){return typeof e=="symbol"||kb(e)&&Ib(e)==$b}var Rb=Lb,Vb=hb,ed=qu,Bb=Rb,td=NaN,zb=/^[-+]0x[0-9a-f]+$/i,Hb=/^0b[01]+$/i,Ub=/^0o[0-7]+$/i,jb=parseInt;function Wb(e){if(typeof e=="number")return e;if(Bb(e))return td;if(ed(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ed(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Vb(e);var n=Hb.test(e);return n||Ub.test(e)?jb(e.slice(2),n?2:8):zb.test(e)?td:+e}var Gb=Wb,qb=qu,ai=lb,nd=Gb,Kb="Expected a function",Xb=Math.max,Jb=Math.min;function Yb(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(Kb);t=nd(t)||0,qb(n)&&(f=!!n.leading,g="maxWait"in n,s=g?Xb(nd(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(P){var F=r,O=o;return r=o=void 0,c=P,i=e.apply(O,F),i}function v(P){return c=P,a=setTimeout(w,t),f?p(P):i}function h(P){var F=P-u,O=P-c,I=t-F;return g?Jb(I,s-O):I}function y(P){var F=P-u,O=P-c;return u===void 0||F>=t||F<0||g&&O>=s}function w(){var P=ai();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(ai())}function C(){var P=ai(),F=y(P);if(r=arguments,o=this,u=P,F){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 Zb=Yb;const Qb=Qw(Zb);function ex(){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}ex()||(global.Date=Date);function tx(e,t){var n;Wu&&(ju(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Gu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=A.useMemo(function(){return Qb(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,dl([],ul(i),!1))},o,t)},[]);return Zw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function nx(e,t,n){var r=ul(A.useState({}),2),o=r[0],s=r[1],i=tx(function(){s({})},n).run;A.useEffect(function(){return i()},t),Yw(e,[o])}const rx=A.forwardRef(({onChange:e},t)=>{const n=A.useRef(null),[r,o]=A.useState("");return A.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),nx(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(It,{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(Xw,{className:"h-5 w-5"})})]})}),ox=({openDialogRename:e,setOpenDialogRename:t,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:s,ignoreCache:i})=>{var b;const[a,u]=A.useState({}),[c,f]=A.useState(!1),[g,m]=A.useState(!1),[p,v]=A.useState(""),{toast:h}=Lr();A.useEffect(()=>{e&&y(p)},[p,e]);const y=async S=>{try{m(!0);const E=await se.get(`${n}/api/list-s3-folders?prefix=${S}`);u(E==null?void 0:E.data)}catch{h({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{m(!1)}},w=async()=>{f(!0);try{const S=o.key;await se.post(`${n}/api/move`,{oldPath:S,newPath:p}),i.current=!0,await s(),h({title:"Đã đổi tên",description:`Đã đổi tên thành công "${o.name}" thành "${p}"`}),t(!1),r(null),v("")}catch(S){console.error("Error renaming item:",S),h({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{f(!1)}};return l.jsx(Mt,{open:e,onOpenChange:S=>{S||(t(!1),r(null),v(""))},children:l.jsxs(ht,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[l.jsxs(mt,{className:"mb-4 w-full h-full",children:[l.jsx("nav",{className:"mb-4",children:l.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),p.split("/").map((S,E,C)=>l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(S==="Root"?"":C.slice(0,E+1).join("/")+"/"),children:S},E))]})}),l.jsxs(vt,{className:"text-xl font-semibold text-gray-800",children:["Move File"," ",l.jsxs("span",{className:"text-sm text-gray-500",children:["file Hoặc folder sẽ được di chuyển đến thư mục"," ",p===""?"Root":p]})]}),l.jsx(Mn,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:g?l.jsx("div",{className:"flex justify-center items-center py-4",children:l.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):l.jsx("ul",{className:"space-y-2",children:(b=Object.keys(a))==null?void 0:b.map(S=>l.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(S),children:S},S))})})]}),l.jsxs(dn,{className:"flex justify-end space-x-2",children:[l.jsx(ie,{variant:"outline",onClick:()=>t(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),l.jsx(ie,{variant:"destructive",onClick:w,disabled:c,className:"px-4 py-2 rounded bg-red-600 text-white hover:bg-red-700 transition-colors",children:"Move"})]})]})})},Ae={current:!1},rd="crawl:jobs",xn="crawl:current_job",sx=e=>{const[t,n]=A.useState(null),[r,o]=A.useState(0);return A.useEffect(()=>{const s=localStorage.getItem(xn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),A.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]),A.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await se.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(xn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(xn)},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(xn,JSON.stringify(s)):localStorage.removeItem(xn)}}},ix=(e,t,n)=>{const r=[],o=s=>{(e[s]||[]).forEach(a=>{a.name.toLowerCase().includes(t.toLowerCase())&&r.push(a),a.isFolder&&a.key.startsWith(n)&&o(a.key)})};return o(n),r},Zr=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},ax=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Zr(e,o.key))}),n},lx=(e,t,n=[])=>{const[r,o]=A.useState({}),[s,i]=A.useState(!1),[a,u]=A.useState(null),c=A.useRef(t);A.useEffect(()=>{c.current=t},[t]);const f=async()=>{i(!0);try{const g=!Ae.current;Ae.current&&(Ae.current=!1);const m=await se.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 A.useEffect(()=>{f()},[]),{data:r,isLoading:s,error:a,refetch:f}},Un=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||"")},cx=A.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="https://s3-explorer.cmcts1.studio.ai.vn",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var _d;const[i,a]=A.useState(""),[u,c]=A.useState(new Set),[f,g]=A.useState(n),[m,p]=A.useState(null),[v,h]=A.useState(!1),[y,w]=A.useState(""),[b,S]=A.useState(!1),[E,C]=A.useState(null),[P,F]=A.useState(null),[O,I]=A.useState(!1),[D,q]=A.useState(!1),[k,U]=A.useState(null),R=A.useRef(null),{toast:z}=Lr(),[V,J]=A.useState(null),[G,Q]=A.useState(null),[le,ue]=A.useState(""),[Me,Ie]=A.useState(!1),[Be,Vt]=A.useState(!1),[me,Ne]=A.useState(new Set),[nt,Te]=A.useState(""),[St,Bt]=A.useState(!1),[We,ze]=A.useState(!1),[Et,zt]=A.useState("rename"),[so,Sn]=A.useState(!1),[x,N]=A.useState(""),[_,H]=A.useState("1"),[B,L]=A.useState(!1),[X,oe]=A.useState(!1),[ve,ye]=A.useState(!1),[ft,io]=A.useState(!1),{currentJob:ce,elapsedTime:Ht,setCurrentJob:ao}=sx(t),lo=m||n,{data:He,isLoading:En,error:Ix,refetch:Ge}=lx(t,lo,s);A.useEffect(()=>{ce!=null&&ce.status&&(ce.status.status==="completed"?(z({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${ce.url} với ${ce.status.completed} trang`}),Ae.current=!0,Ge()):ce.status.status==="failed"&&z({title:"Thu thập website thất bại",description:`Không thể thu thập ${ce.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(_d=ce==null?void 0:ce.status)==null?void 0:_d.status]);const Ed=A.useMemo(()=>He[f]||[],[He,f]),Yt=A.useMemo(()=>i?ix(He,i,f):Ed,[Ed,i,f,He]),Xn=A.useMemo(()=>{const M={};return Yt.forEach(($,j)=>{u.has($.key)&&(M[j]=!0)}),M},[u,Yt]),kx=M=>{const $=Zr(He,M);if($.length===0)return u.has(M)?"all":"none";const j=$.filter(K=>u.has(K)).length;return j===0?"none":j===$.length?"all":"partial"},co=M=>{io(!0),p(M),g(M)};A.useEffect(()=>{ft&&(Ae.current=!0,Ge().finally(()=>io(!1)))},[ft]);const $x=async(M,$)=>{S(!0);try{const j=`${$}${M}/`;if((await se.post(`${t}/api/create-folder`,{prefix:j})).status!==200){z({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}Ae.current=!0,await Ge(),z({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${M}"`}),w(""),h(!1)}catch(j){console.error("Error creating folder:",j),z({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{S(!1)}},Nd=async(M,$,j)=>{U(j),oe(!0);try{if(cg(M,z))return;let K=localStorage.getItem("dataLogin"),te;try{K&&(K=JSON.parse(K),te=K.user)}catch{K=null}const ae=new FormData;ae.append("prefix",$),Array.from(M).forEach(ge=>ae.append("files",ge)),te!=null&&te.id&&(console.log("🚀 ~ uploadFiles ~ user:",te),ae.append("metadata",JSON.stringify({creator:te.username,creatorId:te.id,DataSource:"Tệp tải lên"}))),await se.post(`${t}/api/upload`,ae,{headers:{"Content-Type":"multipart/form-data"}}),p($),Ae.current=!0,await Ge()}catch(K){console.error("Lỗi tải lên:",K)}finally{U(null),oe(!1)}},Lx=async M=>{var $;ye(!0);try{await se.delete(`${t}/api/files`,{data:{paths:[M.key]}});const j=(($=M.key)==null?void 0:$.replace(/^(.*?)(\/.*)?$/,(K,te,ae)=>!ae||ae==="/"?"":te+"/"))||"";p(j),Ae.current=!0,z({title:"Đã xóa tập tin",description:`Đã xóa thành công "${M.name}"`}),C(null)}catch(j){console.error("Error deleting file:",j),z({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{ye(!1),await Ge()}},uo=M=>{const $=new Set(u),j=typeof M=="function"?M(Xn):M;new Set(Object.keys(Xn).map(Number)).forEach(te=>{const ae=Yt[te];ae&&(j[te]||($.delete(ae.key),ae.isFolder&&Zr(He,ae.key).forEach(ge=>$.delete(ge))))}),Object.entries(j).forEach(([te,ae])=>{const ge=parseInt(te),Nt=Yt[ge];Nt&&ae&&($.add(Nt.key),Nt.isFolder&&Zr(He,Nt.key).forEach(Ci=>$.add(Ci)))}),c($)},Rx=async()=>{var M;I(!0);try{const $=Array.from(u),j=$.map(te=>Object.values(He).flat().find(ae=>ae.key===te)).filter(te=>te!==void 0);if(j.length===0){z({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await se.delete(`${t}/api/files`,{data:{paths:$}});const K=((M=j[0])==null?void 0:M.key.replace(/^(.*?)(\/.*)?$/,(te,ae,ge)=>!ge||ge==="/"?"":ae+"/"))||"";p(K),Ae.current=!0,Ge(),z({title:"Đã xóa tập tin",description:`Đã xóa thành công ${j.length} mục`}),q(!1),c(new Set)}catch($){console.error("Error deleting files:",$),z({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{I(!1)}},Vx=async(M,$)=>{Vt(!0);try{const j=M.key;let K;M.isFolder?K=j.split("/").slice(0,-2).join("/")+"/":K=j.substring(0,j.lastIndexOf("/")+1);const te=K+$+(M.isFolder?"/":"");await se.post(`${t}/api/rename`,{oldPath:j,newPath:te}),Ae.current=!0,await Ge(),z({title:"Đã đổi tên",description:`Đã đổi tên thành công "${M.name}" thành "${$}"`}),J(null),ue(""),Q(null)}catch(j){console.error("Error renaming item:",j),z({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{Vt(!1)}},Td=async M=>{Ne($=>new Set([...$,...M]));try{const $=await se.post(`${t}/api/download`,{paths:M},{responseType:"blob"}),j=window.URL.createObjectURL($.data),K=document.createElement("a");K.href=j;const te=$.headers["Content-Disposition"]||$.headers["content-disposition"],ae=te==null?void 0:te.match(/filename="(.+)"/),ge=ae?decodeURIComponent(ae[1]):"download.zip";K.setAttribute("download",ge),document.body.appendChild(K),K.click(),document.body.removeChild(K),window.URL.revokeObjectURL(j),z({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${M.length} mục${M.length>1,""}`})}catch($){console.error("Error downloading files:",$),z({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Ne($=>{const j=new Set($);return M.forEach(K=>j.delete(K)),j})}},Pd=f?f.replace(n,"").split("/").filter(Boolean):[],Bx=()=>Array.from(u).map(M=>{var $;for(const j in He){const K=($=He[j])==null?void 0:$.find(te=>te.key===M);if(K)return K}return null}).filter(M=>M!==null),Ad=A.useMemo(()=>{const M=[{id:"select",header:()=>{const $=ax(He,f),j=$.length>0&&$.every(te=>u.has(te)),K=$.some(te=>u.has(te));return l.jsx(ts,{checked:j?!0:K?"indeterminate":!1,onCheckedChange:te=>{if(te){const ae=Yt.reduce((ge,Nt,Ci)=>(ge[Ci]=!0,ge),{});uo(ae)}else uo({})},"aria-label":"Chọn tất cả"})},cell:({row:$})=>{const j=$.original,te=j.isFolder?kx(j.key):u.has(j.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(ts,{checked:te==="partial"?"indeterminate":te==="all",onCheckedChange:ae=>{const ge={...Xn};ae?ge[$.index]=!0:delete ge[$.index],uo(ge)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:$})=>{const j=$.original,K=j.key.substring(0,j.key.lastIndexOf("/"))||"/",te=i.trim()!==""&&K!==f,ae=K.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${j.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{j.isFolder&&co(j.key)},children:[j.isFolder?l.jsx(po,{className:"h-5 w-5 text-blue-500"}):null,j.name]}),te&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(po,{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:()=>{co("")},children:"/"}),ae.map((ge,Nt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{co(ae.slice(0,Nt+1).join("/")+"/")},children:ge}),Nt<ae.length-1&&l.jsx("span",{children:"/"})]},Nt))]})]})]})}}];return r||M.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:$,row:j})=>{const K=$();return l.jsx("span",{children:j.original.isFolder?"-":Wg(K)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:$})=>{const j=$.original.lastModified;return l.jsx("span",{children:j.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:$})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(yn,{children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>Td([$.original.key]),className:"h-8 w-8 p-0",disabled:me.has($.original.key),children:me.has($.original.key)?l.jsx(we,{className:"h-4 w-4 animate-spin"}):l.jsx(Ei,{className:"h-4 w-4"})})}),l.jsx(Xt,{children:"Tải xuống"})]})}),l.jsx(yn,{children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{J($.original),ue($.original.name)},className:"h-8 w-8 p-0",children:l.jsx(zd,{className:"h-4 w-4"})})}),l.jsx(Xt,{children:"Đổi tên"})]})}),l.jsx(yn,{children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{Ie(!0),F($.original)},className:"h-8 w-8 p-0",children:l.jsx(og,{className:"h-4 w-4"})})}),l.jsx(Xt,{children:"Di chuyển"})]})}),l.jsx(yn,{children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>C($.original),className:"h-8 w-8 p-0",children:l.jsx(Ni,{className:"h-4 w-4"})})}),l.jsx(Xt,{children:"Xóa"})]})})]})}),M},[u,Yt,Xn,me,r]),xi=Ri({data:Yt,columns:Ad,state:{rowSelection:Xn},enableRowSelection:!0,onRowSelectionChange:uo,getCoreRowModel:Li()}),zx=async M=>{var $,j;Bt(!0);try{if(Un(M)){const K=await se.get(`${t}/api/read-text`,{params:{path:M.key}});Te(K.data.content)}try{const K=await se.get(`${t}/api/read-json`,{params:{path:M.key+".metadata.json"}});console.log("🚀 ~ loadFileContent ~ responseMetadata:",K);const te=((j=($=K==null?void 0:K.data)==null?void 0:$.content)==null?void 0:j.metadataAttributes)||null;return Q({fullPath:V==null?void 0:V.key,...te})}catch{return Q("Lỗi phân tích siêu dữ liệu")}}catch(K){console.error("Error loading file content:",K),z({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{Bt(!1)}},Hx=async(M,$)=>{ze(!0);try{await se.post(`${t}/api/modify-text`,{path:M.key,content:$}),z({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Ae.current=!0,await Ge(),J(null),Te(""),zt("rename")}catch(j){console.error("Error saving file content:",j),z({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{ze(!1)}},Ux=async M=>{ze(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",G),await se.post(`${t}/api/modify-json`,{path:M.key+".metadata.json",content:{metadataAttributes:G}}),z({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Ae.current=!0,await Ge(),J(null),Te(""),zt("rename")}catch($){console.error("Error saving file content:",$),z({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{ze(!1)}};A.useEffect(()=>{V&&(V.isFolder||zx(V),zt("rename"))},[V]);const jx=async(M,$)=>{var j;if(ce){z({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}L(!0);try{const{data:K}=await se.post(`${t}/api/crawl`,{url:M,limit:$,prefix:f});if(K.id){ao({id:K.id,url:M,limit:$,prefix:f,taskId:((j=K.task)==null?void 0:j.id)||""});const te=localStorage.getItem(rd),ae=te?JSON.parse(te):[];ae.some(ge=>ge.id===K.id)||(ae.unshift({url:M,id:K.id,limit:$,prefix:f,timestamp:Date.now()}),ae.length>20&&(ae.length=20),localStorage.setItem(rd,JSON.stringify(ae))),z({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${M} với giới hạn ${$}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),Sn(!1),N(""),H("1")}}catch(K){console.error("Error crawling website:",K),z({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{L(!1)}},Wx=async()=>{try{if(!(ce!=null&&ce.id))return;ao(null),localStorage.removeItem(xn),z({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${ce.url}`})}catch(M){console.error("Error stopping job:",M),z({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(La,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Jo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Yo,{onClick:()=>{p(""),g(""),Ae.current=!0,setTimeout(()=>{Ge()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Pd.map((M,$)=>l.jsxs(l.Fragment,{children:[l.jsx(Ra,{className:"s3-explr-breadcrumb-separator"},`sep-${$}`),l.jsx(Jo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Yo,{onClick:()=>co(n+Pd.slice(0,$+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(rx,{ref:R,onChange:M=>a(M)})}),l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{p(f),Ae.current=!0,Ge()},disabled:En,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Dd,{className:`h-4 w-4 s3-explr-refresh-icon ${En?"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:()=>Td(Array.from(u)),disabled:Array.from(u).some(M=>me.has(M)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(M=>me.has(M))?l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(Ei,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(Mt,{open:D,onOpenChange:q,children:[l.jsx(Sr,{asChild:!0,children:l.jsxs(ie,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(Ni,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(ht,{className:"s3-explr-dialog-content",children:[l.jsxs(mt,{className:"s3-explr-dialog-header",children:[l.jsx(vt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(Mn,{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(dn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>q(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:Rx,disabled:O,className:"s3-explr-confirm-delete-btn",children:O?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(Mt,{open:v,onOpenChange:h,children:[l.jsx(Sr,{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($d,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(ht,{className:"s3-explr-dialog-content",children:[l.jsx(mt,{className:"s3-explr-dialog-header",children:l.jsx(vt,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(qt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(It,{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(ie,{onClick:()=>{y.trim()&&$x(y,f)},disabled:b,className:"s3-explr-create-btn",children:[b&&l.jsx(we,{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 M=document.createElement("input");M.type="file",M.multiple=!0,M.onchange=$=>{const j=$.target.files;j&&Nd(j,f,"files")},M.click()},disabled:k!==null||!!s&&!f,children:k==="files"?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Id,{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 M=document.createElement("input");M.type="file",M.multiple=!0,M.webkitdirectory=!0,M.onchange=$=>{const j=$.target.files;j&&Nd(j,f,"folder")},M.click()},disabled:k!==null||!!s&&!f,children:k==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(po,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),ce?l.jsx(yn,{delayDuration:0,children:l.jsxs(wn,{children:[l.jsx(bn,{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(we,{className:"h-4 w-4 animate-spin s3-explr-loader"}),ce.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",ce.status.completed,"/",ce.status.total,") - ",Math.floor(Ht/60),":",String(Ht%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>void Wx(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(Ud,{className:"h-4 w-4"})]})]})}),ce.status&&l.jsx(Xt,{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 ",ce.url]}),l.jsxs("p",{children:["Tiến độ: ",ce.status.completed,"/",ce.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(Ht/60),":",String(Ht%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",ce.status.status==="scraping"?"Đang thu thập":ce.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Mt,{open:so,onOpenChange:Sn,children:[l.jsx(Sr,{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(Vd,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(ht,{className:"s3-explr-dialog-content",children:[l.jsxs(mt,{className:"s3-explr-dialog-header",children:[l.jsx(vt,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(Mn,{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(qt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(It,{id:"websiteUrl",value:x,onChange:M=>N(M.target.value),placeholder:"https://example.com",type:"url",disabled:B,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(qt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(It,{id:"crawlLimit",value:_,onChange:M=>{const $=M.target.value;/^\d*$/.test($)&&H($)},placeholder:"1",type:"text",disabled:B,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(dn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{Sn(!1),N(""),H("1")},disabled:B,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{onClick:()=>{x.trim()&&jx(x.trim(),parseInt(_)||1)},disabled:B||!x.trim(),className:"s3-explr-crawl-btn",children:B?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(Mt,{open:!!E,onOpenChange:M=>!M&&C(null),children:l.jsxs(ht,{className:"s3-explr-dialog-content",children:[l.jsxs(mt,{className:"s3-explr-dialog-header",children:[l.jsx(vt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(Mn,{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(dn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>C(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:()=>Lx(E),disabled:ve,className:"s3-explr-confirm-delete-btn",children:ve?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(Mt,{open:!!V,onOpenChange:M=>{M||(J(null),Q(null),ue(""),Te(""),zt("rename"))},children:l.jsxs(ht,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(mt,{className:"s3-explr-dialog-header",children:l.jsx(vt,{className:"s3-explr-dialog-title",children:V!=null&&V.isFolder?"Đổi tên thư mục":Un(V)?"Quản lý tập tin":"Đổi tên tập tin"})}),V&&l.jsxs(wv,{value:Et,onValueChange:M=>zt(M),children:[l.jsxs(Cc,{"aria-checked":!Un(V),"aria-disabled":V.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[l.jsx(Fr,{value:"rename",children:"Đổi tên"}),!V.isFolder&&l.jsxs(l.Fragment,{children:[Un(V)&&l.jsx(Fr,{value:"edit",children:"Sửa nội dung"}),l.jsx(Fr,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),l.jsx(Or,{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(qt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(It,{id:"newName",value:le,onChange:M=>ue(M.target.value),placeholder:"Nhập tên mới",disabled:Be,className:"s3-explr-input"})]})})}),!V.isFolder&&l.jsxs(l.Fragment,{children:[Un(V)&&l.jsx(Or,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:St?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(we,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:[l.jsx(qt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(In,{id:"content",value:nt,onChange:M=>Te(M.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:We})]})})}),l.jsx(Or,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:St?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(we,{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:G&&typeof G=="object"&&Object.entries(G).map(([M,$])=>l.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[l.jsxs(qt,{htmlFor:M,className:"s3-explr-label flex items-center gap-1",children:[ag[M]||M,Wo(M)&&l.jsx(sg,{className:"h-[12px] w-[12px] text-red-500"})]}),lg(M)?l.jsx(In,{id:M,value:typeof $=="string"?$:JSON.stringify($),onChange:j=>{const K={...G,[M]:j.target.value};Q(K)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:We||Wo(M)}):l.jsx(It,{id:M,value:typeof $=="string"?$:JSON.stringify($),onChange:j=>{const K={...G,[M]:j.target.value};Q(K)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:We||Wo(M)})]},M))})})})]})]}),l.jsxs(dn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{J(null),Q(null),ue(""),Te("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Et==="edit"?l.jsx(ie,{onClick:()=>V&&Hx(V,nt),disabled:We||St,className:"s3-explr-save-btn",children:We?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):Et==="edit-metadata"?l.jsx(ie,{onClick:()=>G&&typeof G=="object"&&V&&Ux(V),disabled:We||St,className:"s3-explr-save-btn",children:We?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(ie,{onClick:()=>{le.trim()&&V&&Vx(V,le.trim())},disabled:Be||!le.trim()||le.trim()===(V==null?void 0:V.name),className:"s3-explr-rename-btn",children:Be?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),P&&Me&&l.jsx(ox,{openDialogRename:Me,setOpenDialogRename:Ie,apiBaseUrl:t,setFileToMove:F,fileToMove:P,refreshFiles:Ge,ignoreCache:Ae})]})]}),Ix&&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(Er,{className:"s3-explr-table",children:[l.jsx(Nr,{className:"s3-explr-table-header",children:xi.getHeaderGroups().map(M=>l.jsx(Ze,{className:"hover:bg-transparent s3-explr-header-row",children:M.headers.map($=>l.jsx(st,{className:"s3-explr-header-cell",children:$.isPlaceholder?null:tr($.column.columnDef.header,$.getContext())},$.id))},M.id))}),l.jsx(Tr,{className:"s3-explr-table-body",children:xi.getRowModel().rows.length===0?l.jsx(Ze,{className:"s3-explr-empty-row",children:l.jsx(Oe,{colSpan:Ad.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:En?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):xi.getRowModel().rows.map(M=>l.jsx(Ze,{className:"h-12 s3-explr-row",children:M.getVisibleCells().map($=>l.jsx(Oe,{className:"align-middle s3-explr-cell",children:tr($.column.columnDef.cell,$.getContext())},$.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(ie,{variant:"default",onClick:()=>o(Bx()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Xc,{})]})});var jn=e=>e.type==="checkbox",Jt=e=>e instanceof Date,_e=e=>e==null;const od=e=>typeof e=="object";var he=e=>!_e(e)&&!Array.isArray(e)&&od(e)&&!Jt(e),ux=e=>he(e)&&e.target?jn(e.target)?e.target.checked:e.target.value:e,dx=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,fx=(e,t)=>e.has(dx(t)),px=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},li=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function je(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(!(li&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!px(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=je(e[o]));else return e;return t}var Qr=e=>Array.isArray(e)?e.filter(Boolean):[],pe=e=>e===void 0,W=(e,t,n)=>{if(!t||!he(e))return n;const r=Qr(t.split(/[,[\].]+?/)).reduce((o,s)=>_e(o)?o:o[s],e);return pe(r)||r===e?pe(e[t])?n:e[t]:r},ct=e=>typeof e=="boolean",ci=e=>/^\w*$/.test(e),sd=e=>Qr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,n)=>{let r=-1;const o=ci(t)?[t]:sd(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let u=n;if(r!==i){const c=e[a];u=he(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const id={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},tt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},xt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};A.createContext(null);var gx=(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]!==tt.all&&(t._proxyFormState[i]=!r||tt.all),e[i]}});return o},De=e=>he(e)&&!Object.keys(e).length,hx=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return De(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===tt.all)},eo=e=>Array.isArray(e)?e:[e];function mx(e){const t=A.useRef(e);t.current=e,A.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",vx=(e,t,n,r,o)=>ut(e)?(r&&t.watch.add(e),W(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),W(n,s))):(r&&(t.watchAll=!0),n),yx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},ad=e=>({isOnSubmit:!e||e===tt.onSubmit,isOnBlur:e===tt.onBlur,isOnChange:e===tt.onChange,isOnAll:e===tt.all,isOnTouch:e===tt.onTouched}),ld=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Wn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=W(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(Wn(a,t))break}else if(he(a)&&Wn(a,t))break}}};var wx=(e,t,n)=>{const r=eo(W(e,n));return fe(r,"root",t[n]),fe(e,n,r),e},ui=e=>e.type==="file",dt=e=>typeof e=="function",to=e=>{if(!li)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},no=e=>ut(e),di=e=>e.type==="radio",ro=e=>e instanceof RegExp;const cd={value:!1,isValid:!1},ud={value:!0,isValid:!0};var dd=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&&!pe(e[0].attributes.value)?pe(e[0].value)||e[0].value===""?ud:{value:e[0].value,isValid:!0}:ud:cd}return cd};const fd={isValid:!1,value:null};var pd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,fd):fd;function gd(e,t,n="validate"){if(no(e)||Array.isArray(e)&&e.every(no)||ct(e)&&!e)return{type:n,message:no(e)?e:"",ref:t}}var Cn=e=>he(e)&&!ro(e)?e:{value:e,message:""},hd=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=W(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=di(s),F=jn(s),O=P||F,I=(h||ui(s))&&pe(s.value)&&pe(b)||to(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,D=yx.bind(null,v,n,C),q=(k,U,R,z=xt.maxLength,V=xt.minLength)=>{const J=k?U:R;C[v]={type:k?z:V,message:J,ref:s,...D(k?z:V,J)}};if(o?!Array.isArray(b)||!b.length:a&&(!O&&(I||_e(b))||ct(b)&&!b||F&&!dd(i).isValid||P&&!pd(i).isValid)){const{value:k,message:U}=no(a)?{value:!!a,message:a}:Cn(a);if(k&&(C[v]={type:xt.required,message:U,ref:S,...D(xt.required,U)},!n))return E(U),C}if(!I&&(!_e(f)||!_e(g))){let k,U;const R=Cn(g),z=Cn(f);if(!_e(b)&&!isNaN(b)){const V=s.valueAsNumber||b&&+b;_e(R.value)||(k=V>R.value),_e(z.value)||(U=V<z.value)}else{const V=s.valueAsDate||new Date(b),J=le=>new Date(new Date().toDateString()+" "+le),G=s.type=="time",Q=s.type=="week";ut(R.value)&&b&&(k=G?J(b)>J(R.value):Q?b>R.value:V>new Date(R.value)),ut(z.value)&&b&&(U=G?J(b)<J(z.value):Q?b<z.value:V<new Date(z.value))}if((k||U)&&(q(!!k,R.message,z.message,xt.max,xt.min),!n))return E(C[v].message),C}if((u||c)&&!I&&(ut(b)||o&&Array.isArray(b))){const k=Cn(u),U=Cn(c),R=!_e(k.value)&&b.length>+k.value,z=!_e(U.value)&&b.length<+U.value;if((R||z)&&(q(R,k.message,U.message),!n))return E(C[v].message),C}if(m&&!I&&ut(b)){const{value:k,message:U}=Cn(m);if(ro(k)&&!b.match(k)&&(C[v]={type:xt.pattern,message:U,ref:s,...D(xt.pattern,U)},!n))return E(U),C}if(p){if(dt(p)){const k=await p(b,t),U=gd(k,S);if(U&&(C[v]={...U,...D(xt.validate,U.message)},!n))return E(U.message),C}else if(he(p)){let k={};for(const U in p){if(!De(k)&&!n)break;const R=gd(await p[U](b,t),S,U);R&&(k={...R,...D(U,R.message)},E(R.message),n&&(C[v]=k))}if(!De(k)&&(C[v]={ref:S,...k},!n))return C}}return E(!0),C};function bx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=pe(e)?r++:e[t[r++]];return e}function xx(e){for(const t in e)if(e.hasOwnProperty(t)&&!pe(e[t]))return!1;return!0}function Ce(e,t){const n=Array.isArray(t)?t:ci(t)?[t]:sd(t),r=n.length===1?e:bx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&De(r)||Array.isArray(r)&&xx(r))&&Ce(e,n.slice(0,-1)),e}var fi=()=>{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=[]}}},pi=e=>_e(e)||!od(e);function Rt(e,t){if(pi(e)||pi(t))return e===t;if(Jt(e)&&Jt(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(Jt(s)&&Jt(i)||he(s)&&he(i)||Array.isArray(s)&&Array.isArray(i)?!Rt(s,i):s!==i)return!1}}return!0}var md=e=>e.type==="select-multiple",Cx=e=>di(e)||jn(e),gi=e=>to(e)&&e.isConnected,vd=e=>{for(const t in e)if(dt(e[t]))return!0;return!1};function oo(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!vd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},oo(e[r],t[r])):_e(e[r])||(t[r]=!0);return t}function yd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!vd(e[o])?pe(t)||pi(n[o])?n[o]=Array.isArray(e[o])?oo(e[o],[]):{...oo(e[o])}:yd(e[o],_e(t)?{}:t[o],n[o]):n[o]=!Rt(e[o],t[o]);return n}var Gn=(e,t)=>yd(e,t,oo(t)),wd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>pe(e)?e:t?e===""?NaN:e&&+e:n&&ut(e)?new Date(e):r?r(e):e;function hi(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ui(t)?t.files:di(t)?pd(e.refs).value:md(t)?[...t.selectedOptions].map(({value:n})=>n):jn(t)?dd(e.refs).value:wd(pe(t.value)?e.ref.value:t.value,e)}var Sx=(e,t,n,r)=>{const o={};for(const s of e){const i=W(t,s);i&&fe(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},qn=e=>pe(e)?e:ro(e)?e.source:he(e)?ro(e.value)?e.value.source:e.value:e;const bd="AsyncFunction";var Ex=e=>!!e&&!!e.validate&&!!(dt(e.validate)&&e.validate.constructor.name===bd||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===bd)),Nx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function xd(e,t,n){const r=W(e,n);if(r||ci(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=W(t,s),a=W(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 Tx=(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,Px=(e,t)=>!Qr(W(e,t)).length&&Ce(e,t);const Ax={mode:tt.onSubmit,reValidateMode:tt.onChange,shouldFocusError:!0};function _x(e={}){let t={...Ax,...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=he(t.defaultValues)||he(t.values)?je(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:je(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:fi(),array:fi(),state:fi()},m=ad(t.mode),p=ad(t.reValidateMode),v=t.criteriaMode===tt.all,h=x=>N=>{clearTimeout(c),c=setTimeout(x,N)},y=async x=>{if(!t.disabled&&(f.isValid||x)){const N=t.resolver?De((await O()).errors):await D(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(_=>{_&&(N?fe(n.validatingFields,_,N):Ce(n.validatingFields,_))}),g.state.next({validatingFields:n.validatingFields,isValidating:!De(n.validatingFields)}))},b=(x,N=[],_,H,B=!0,L=!0)=>{if(H&&_&&!t.disabled){if(i.action=!0,L&&Array.isArray(W(r,x))){const X=_(W(r,x),H.argA,H.argB);B&&fe(r,x,X)}if(L&&Array.isArray(W(n.errors,x))){const X=_(W(n.errors,x),H.argA,H.argB);B&&fe(n.errors,x,X),Px(n.errors,x)}if(f.touchedFields&&L&&Array.isArray(W(n.touchedFields,x))){const X=_(W(n.touchedFields,x),H.argA,H.argB);B&&fe(n.touchedFields,x,X)}f.dirtyFields&&(n.dirtyFields=Gn(o,s)),g.state.next({name:x,isDirty:k(x,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else fe(s,x,N)},S=(x,N)=>{fe(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,_,H)=>{const B=W(r,x);if(B){const L=W(s,x,pe(_)?W(o,x):_);pe(L)||H&&H.defaultChecked||N?fe(s,x,N?L:hi(B._f)):z(x,L),i.mount&&y()}},P=(x,N,_,H,B)=>{let L=!1,X=!1;const oe={name:x};if(!t.disabled){const ve=!!(W(r,x)&&W(r,x)._f&&W(r,x)._f.disabled);if(!_||H){f.isDirty&&(X=n.isDirty,n.isDirty=oe.isDirty=k(),L=X!==oe.isDirty);const ye=ve||Rt(W(o,x),N);X=!!(!ve&&W(n.dirtyFields,x)),ye||ve?Ce(n.dirtyFields,x):fe(n.dirtyFields,x,!0),oe.dirtyFields=n.dirtyFields,L=L||f.dirtyFields&&X!==!ye}if(_){const ye=W(n.touchedFields,x);ye||(fe(n.touchedFields,x,_),oe.touchedFields=n.touchedFields,L=L||f.touchedFields&&ye!==_)}L&&B&&g.state.next(oe)}return L?oe:{}},F=(x,N,_,H)=>{const B=W(n.errors,x),L=f.isValid&&ct(N)&&n.isValid!==N;if(t.delayError&&_?(u=h(()=>S(x,_)),u(t.delayError)):(clearTimeout(c),u=null,_?fe(n.errors,x,_):Ce(n.errors,x)),(_?!Rt(B,_):B)||!De(H)||L){const X={...H,...L&&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,Sx(x||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(x),N},I=async x=>{const{errors:N}=await O(x);if(x)for(const _ of x){const H=W(N,_);H?fe(n.errors,_,H):Ce(n.errors,_)}else n.errors=N;return N},D=async(x,N,_={valid:!0})=>{for(const H in x){const B=x[H];if(B){const{_f:L,...X}=B;if(L){const oe=a.array.has(L.name),ve=B._f&&Ex(B._f);ve&&f.validatingFields&&w([H],!0);const ye=await hd(B,s,v,t.shouldUseNativeValidation&&!N,oe);if(ve&&f.validatingFields&&w([H]),ye[L.name]&&(_.valid=!1,N))break;!N&&(W(ye,L.name)?oe?wx(n.errors,ye,L.name):fe(n.errors,L.name,ye[L.name]):Ce(n.errors,L.name))}!De(X)&&await D(X,N,_)}}return _.valid},q=()=>{for(const x of a.unMount){const N=W(r,x);N&&(N._f.refs?N._f.refs.every(_=>!gi(_)):!gi(N._f.ref))&&me(x)}a.unMount=new Set},k=(x,N)=>!t.disabled&&(x&&N&&fe(s,x,N),!Rt(ue(),o)),U=(x,N,_)=>vx(x,a,{...i.mount?s:pe(N)?o:ut(x)?{[x]:N}:N},_,N),R=x=>Qr(W(i.mount?s:o,x,t.shouldUnregister?W(o,x,[]):[])),z=(x,N,_={})=>{const H=W(r,x);let B=N;if(H){const L=H._f;L&&(!L.disabled&&fe(s,x,wd(N,L)),B=to(L.ref)&&_e(N)?"":N,md(L.ref)?[...L.ref.options].forEach(X=>X.selected=B.includes(X.value)):L.refs?jn(L.ref)?L.refs.length>1?L.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(B)?!!B.find(oe=>oe===X.value):B===X.value)):L.refs[0]&&(L.refs[0].checked=!!B):L.refs.forEach(X=>X.checked=X.value===B):ui(L.ref)?L.ref.value="":(L.ref.value=B,L.ref.type||g.values.next({name:x,values:{...s}})))}(_.shouldDirty||_.shouldTouch)&&P(x,B,_.shouldTouch,_.shouldDirty,!0),_.shouldValidate&&le(x)},V=(x,N,_)=>{for(const H in N){const B=N[H],L=`${x}.${H}`,X=W(r,L);(a.array.has(x)||he(B)||X&&!X._f)&&!Jt(B)?V(L,B,_):z(L,B,_)}},J=(x,N,_={})=>{const H=W(r,x),B=a.array.has(x),L=je(N);fe(s,x,L),B?(g.array.next({name:x,values:{...s}}),(f.isDirty||f.dirtyFields)&&_.shouldDirty&&g.state.next({name:x,dirtyFields:Gn(o,s),isDirty:k(x,L)})):H&&!H._f&&!_e(L)?V(x,L,_):z(x,L,_),ld(x,a)&&g.state.next({...n}),g.values.next({name:i.mount?x:void 0,values:{...s}})},G=async x=>{i.mount=!0;const N=x.target;let _=N.name,H=!0;const B=W(r,_),L=()=>N.type?hi(B._f):ux(x),X=oe=>{H=Number.isNaN(oe)||Jt(oe)&&isNaN(oe.getTime())||Rt(oe,W(s,_,oe))};if(B){let oe,ve;const ye=L(),ft=x.type===id.BLUR||x.type===id.FOCUS_OUT,io=!Nx(B._f)&&!t.resolver&&!W(n.errors,_)&&!B._f.deps||Tx(ft,W(n.touchedFields,_),n.isSubmitted,p,m),ce=ld(_,a,ft);fe(s,_,ye),ft?(B._f.onBlur&&B._f.onBlur(x),u&&u(0)):B._f.onChange&&B._f.onChange(x);const Ht=P(_,ye,ft,!1),ao=!De(Ht)||ce;if(!ft&&g.values.next({name:_,type:x.type,values:{...s}}),io)return f.isValid&&(t.mode==="onBlur"?ft&&y():y()),ao&&g.state.next({name:_,...ce?{}:Ht});if(!ft&&ce&&g.state.next({...n}),t.resolver){const{errors:lo}=await O([_]);if(X(ye),H){const He=xd(n.errors,r,_),En=xd(lo,r,He.name||_);oe=En.error,_=En.name,ve=De(lo)}}else w([_],!0),oe=(await hd(B,s,v,t.shouldUseNativeValidation))[_],w([_]),X(ye),H&&(oe?ve=!1:f.isValid&&(ve=await D(r,!0)));H&&(B._f.deps&&le(B._f.deps),F(_,ve,oe,Ht))}},Q=(x,N)=>{if(W(n.errors,N)&&x.focus)return x.focus(),1},le=async(x,N={})=>{let _,H;const B=eo(x);if(t.resolver){const L=await I(pe(x)?x:B);_=De(L),H=x?!B.some(X=>W(L,X)):_}else x?(H=(await Promise.all(B.map(async L=>{const X=W(r,L);return await D(X&&X._f?{[L]:X}:X)}))).every(Boolean),!(!H&&!n.isValid)&&y()):H=_=await D(r);return g.state.next({...!ut(x)||f.isValid&&_!==n.isValid?{}:{name:x},...t.resolver||!x?{isValid:_}:{},errors:n.errors}),N.shouldFocus&&!H&&Wn(r,Q,x?B:a.mount),H},ue=x=>{const N={...i.mount?s:o};return pe(x)?N:ut(x)?W(N,x):x.map(_=>W(N,_))},Me=(x,N)=>({invalid:!!W((N||n).errors,x),isDirty:!!W((N||n).dirtyFields,x),error:W((N||n).errors,x),isValidating:!!W(n.validatingFields,x),isTouched:!!W((N||n).touchedFields,x)}),Ie=x=>{x&&eo(x).forEach(N=>Ce(n.errors,N)),g.state.next({errors:x?n.errors:{}})},Be=(x,N,_)=>{const H=(W(r,x,{_f:{}})._f||{}).ref,B=W(n.errors,x)||{},{ref:L,message:X,type:oe,...ve}=B;fe(n.errors,x,{...ve,...N,ref:H}),g.state.next({name:x,errors:n.errors,isValid:!1}),_&&_.shouldFocus&&H&&H.focus&&H.focus()},Vt=(x,N)=>dt(x)?g.values.subscribe({next:_=>x(U(void 0,N),_)}):U(x,N,!0),me=(x,N={})=>{for(const _ of x?eo(x):a.mount)a.mount.delete(_),a.array.delete(_),N.keepValue||(Ce(r,_),Ce(s,_)),!N.keepError&&Ce(n.errors,_),!N.keepDirty&&Ce(n.dirtyFields,_),!N.keepTouched&&Ce(n.touchedFields,_),!N.keepIsValidating&&Ce(n.validatingFields,_),!t.shouldUnregister&&!N.keepDefaultValue&&Ce(o,_);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:k()}:{}}),!N.keepIsValid&&y()},Ne=({disabled:x,name:N,field:_,fields:H,value:B})=>{if(ct(x)&&i.mount||x){const L=x?void 0:pe(B)?hi(_?_._f:W(H,N)._f):B;(x||!x&&!pe(L))&&fe(s,N,L),P(N,L,!1,!1,!0)}},nt=(x,N={})=>{let _=W(r,x);const H=ct(N.disabled)||ct(t.disabled);return fe(r,x,{..._||{},_f:{..._&&_._f?_._f:{ref:{name:x}},name:x,mount:!0,...N}}),a.mount.add(x),_?Ne({field:_,disabled:ct(N.disabled)?N.disabled:t.disabled,name:x,value:N.value}):C(x,!0,N.value),{...H?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:qn(N.min),max:qn(N.max),minLength:qn(N.minLength),maxLength:qn(N.maxLength),pattern:qn(N.pattern)}:{},name:x,onChange:G,onBlur:G,ref:B=>{if(B){nt(x,N),_=W(r,x);const L=pe(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,X=Cx(L),oe=_._f.refs||[];if(X?oe.find(ve=>ve===L):L===_._f.ref)return;fe(r,x,{_f:{..._._f,...X?{refs:[...oe.filter(gi),L,...Array.isArray(W(o,x))?[{}]:[]],ref:{type:L.type,name:x}}:{ref:L}}}),C(x,!1,void 0,L)}else _=W(r,x,{}),_._f&&(_._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(fx(a.array,x)&&i.action)&&a.unMount.add(x)}}},Te=()=>t.shouldFocusError&&Wn(r,Q,a.mount),St=x=>{ct(x)&&(g.state.next({disabled:x}),Wn(r,(N,_)=>{const H=W(r,_);H&&(N.disabled=H._f.disabled||x,Array.isArray(H._f.refs)&&H._f.refs.forEach(B=>{B.disabled=H._f.disabled||x}))},0,!1))},Bt=(x,N)=>async _=>{let H;if(_&&(_.preventDefault&&_.preventDefault(),_.persist&&_.persist()),t.disabled){N&&await N({...n.errors},_);return}let B=je(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:X}=await O();n.errors=L,B=X}else await D(r);if(Ce(n.errors,"root"),De(n.errors)){g.state.next({errors:{}});try{await x(B,_)}catch(L){H=L}}else N&&await N({...n.errors},_),Te(),setTimeout(Te);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:De(n.errors)&&!H,submitCount:n.submitCount+1,errors:n.errors}),H)throw H},We=(x,N={})=>{W(r,x)&&(pe(N.defaultValue)?J(x,je(W(o,x))):(J(x,N.defaultValue),fe(o,x,je(N.defaultValue))),N.keepTouched||Ce(n.touchedFields,x),N.keepDirty||(Ce(n.dirtyFields,x),n.isDirty=N.defaultValue?k(x,je(W(o,x))):k()),N.keepError||(Ce(n.errors,x),f.isValid&&y()),g.state.next({...n}))},ze=(x,N={})=>{const _=x?je(x):o,H=je(_),B=De(x),L=B?o:H;if(N.keepDefaultValues||(o=_),!N.keepValues){if(N.keepDirtyValues){const X=new Set([...a.mount,...Object.keys(Gn(o,s))]);for(const oe of Array.from(X))W(n.dirtyFields,oe)?fe(L,oe,W(s,oe)):J(oe,W(L,oe))}else{if(li&&pe(x))for(const X of a.mount){const oe=W(r,X);if(oe&&oe._f){const ve=Array.isArray(oe._f.refs)?oe._f.refs[0]:oe._f.ref;if(to(ve)){const ye=ve.closest("form");if(ye){ye.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?je(o):{}:je(L),g.array.next({values:{...L}}),g.values.next({values:{...L}})}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&&!Rt(x,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:B?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Gn(o,s):n.dirtyFields:N.keepDefaultValues&&x?Gn(o,x):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Et=(x,N)=>ze(dt(x)?x(s):x,N);return{control:{register:nt,unregister:me,getFieldState:Me,handleSubmit:Bt,setError:Be,_executeSchema:O,_getWatch:U,_getDirty:k,_updateValid:y,_removeUnmounted:q,_updateFieldArray:b,_updateDisabledField:Ne,_getFieldArray:R,_reset:ze,_resetDefaultValues:()=>dt(t.defaultValues)&&t.defaultValues().then(x=>{Et(x,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:x=>{n={...n,...x}},_disableForm:St,_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:le,register:nt,handleSubmit:Bt,watch:Vt,setValue:J,getValues:ue,reset:Et,resetField:We,clearErrors:Ie,unregister:me,setError:Be,setFocus:(x,N={})=>{const _=W(r,x),H=_&&_._f;if(H){const B=H.refs?H.refs[0]:H.ref;B.focus&&(B.focus(),N.shouldSelect&&dt(B.select)&&B.select())}},getFieldState:Me}}function Fx(e={}){const t=A.useRef(),n=A.useRef(),[r,o]=A.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={..._x(e),formState:r});const s=t.current.control;return s._options=e,mx({subject:s._subjects.state,next:i=>{hx(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),A.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),A.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),A.useEffect(()=>{e.values&&!Rt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),A.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),A.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()}),A.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),A.useMemo(()=>({...t.current,formState:gx(r,s)}),[r,s])}const Cd=({className:e,children:t,content:n,side:r})=>{const[o,s]=A.useState(!1);return l.jsx(yn,{delayDuration:0,children:l.jsxs(wn,{open:o,children:[l.jsx(bn,{asChild:!0,children:l.jsx("button",{type:"button",className:ee("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(Xt,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},mi=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:ee("mx-auto flex w-full justify-center",e),...t});mi.displayName="Pagination";const vi=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:ee("flex flex-row items-center gap-1",e),...t}));vi.displayName="PaginationContent";const Ct=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ee("",e),...t}));Ct.displayName="PaginationItem";const Kn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:ee(za({variant:t?"outline":"ghost",size:n}),e),...r});Kn.displayName="PaginationLink";const yi=({className:e,...t})=>l.jsxs(Kn,{"aria-label":"Go to previous page",size:"default",className:ee("gap-1 pl-2.5",e),...t,children:[l.jsx(tg,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});yi.displayName="PaginationPrevious";const wi=({className:e,...t})=>l.jsxs(Kn,{"aria-label":"Go to next page",size:"default",className:ee("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(Ea,{className:"h-4 w-4"})]});wi.displayName="PaginationNext";const bi=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:ee("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(ng,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});bi.displayName="PaginationEllipsis";const Ox=(e,t)=>{const[n,r]=A.useState(e);return A.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Dx=({apiBaseUrl:e="https://s3-explorer.cmcts1.studio.ai.vn"})=>{var P,F;const[t,n]=A.useState([]),[r,o]=A.useState(!1),[s,i]=A.useState([]),[a,u]=A.useState(1),[c,f]=A.useState(1),[g,m]=A.useState(null),[p,v]=A.useState(""),h=Ox(p,500),y=O=>{const I=O.match(/\d{6}/);if(!I)return{month:"",year:""};const D=I[0],q=D.substring(0,2),k=D.substring(2);return{month:q,year:k}},w=O=>O.map(D=>{let q=(D==null?void 0:D.month)||"",k=(D==null?void 0:D.year)||"";if((!q||!k)&&(D!=null&&D.file_name)){const U=y(D.file_name);q=q||U.month,k=k||U.year}return{id:D==null?void 0:D.id,prefix:(D==null?void 0:D.prefix)||"",model:(D==null?void 0:D.model)||"",fileName:(D==null?void 0:D.file_name)||"",code:(D==null?void 0:D.stock_id)||"",month:q,year:k,content:(D==null?void 0:D.text_summary)||"",status:(D==null?void 0:D.status)||"",note:(D==null?void 0:D.note)||"",lastUpdate:D==null?void 0:D.updated_at,stock_id:D==null?void 0:D.stock_id}}),b=O=>{if(!(O!=null&&O.data))return[];const I=w(O==null?void 0:O.data);n(I),f(O.pagination.totalPages)},S=async(O=1,I=15)=>{m(O),o(!0);try{const D=await se.get(`${e}/api/latest-summaries`,{params:{page:O,limit:I,search:p}});(D==null?void 0:D.status)===200?b(D.data):console.error(D)}catch(D){console.error("Error fetching data:",D)}finally{m(null),o(!1)}};A.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=A.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:I})=>l.jsx("span",{className:"flex flex-col",children:I.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:I})=>{const D=I.original.month,q=I.original.year;return l.jsx("span",{className:"flex flex-col",children:`${D.toString().padStart(2,"0")}/${q}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:I})=>{const D=I.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:D})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:I})=>{const q=I.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${q?"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:q?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:I})=>l.jsx(Cd,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:I.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:I.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:I})=>{const D=new Date(I.original.lastUpdate),q=D.getDate(),k=D.getMonth()+1,U=`ngày ${q} tháng ${k}`;return l.jsx("span",{className:"flex flex-col",children:U})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:I})=>{const[D,q]=A.useState(!1),[k,U]=A.useState(!1),[R,z]=A.useState(!1),{handleSubmit:V,register:J,reset:G}=Fx(),Q=I.original.id,le=I.getValue("status"),ue=I.getValue("content"),[Me,Ie]=A.useState(!1),Be=async()=>{try{Ie(!0);const me=le==="unpublish"?"published":"unpublish",Ne=await se.patch(`${e}/api/toggle-publish/${Q}`,{id:Q,typeAction:"update",status:le,idInput:Q,stock_id:I.original.stock_id,prefix:I.original.prefix,model:I.original.model,summary_result:I.original.content,note:I.original.note});Ne.status===200?n(nt=>nt.map(Te=>Te.id===Q?{...Te,status:me}:Te)):console.error("Failed to toggle publish status:",Ne)}catch(me){console.error("Error toggling publish status:",me)}finally{Ie(!1)}},Vt=async me=>{q(!0);try{const Ne=await se.patch(`${e}/api/update-summary`,{note:me.note,text_summary:me.content,id:Q});Ne.status===200?(await S(a),U(!1)):console.error("Failed to update summary:",Ne)}catch(Ne){console.error("Error updating summary:",Ne)}return q(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>z(!0),className:"px-2 py-0.5 h-7",children:l.jsx(rg,{className:"h-4 w-4"})}),l.jsx(Mt,{open:R,onOpenChange:z,children:l.jsxs(ht,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(mt,{children:l.jsx(vt,{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:ue})})]})}),l.jsxs(Mt,{open:k,onOpenChange:me=>{U(me),me?G({content:I.original.content,note:I.original.note}):G()},children:[l.jsx(Sr,{asChild:!0,children:l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>U(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(ht,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(mt,{className:"flex flex-col gap-3",children:[l.jsx(vt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:V(Vt),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(In,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:I.original.answer||"",rows:10,...J("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(In,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:I.original.note||"",rows:1,...J("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ie,{disabled:D,type:"submit",variant:"default",children:D?l.jsx(we,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ie,{variant:"outline",size:"sm",onClick:Be,disabled:Me,className:"w-[70px] px-2 py-0.5 h-7",children:Me?l.jsx(we,{className:"h-4 w-4 animate-spin"}):le==="unpublish"?"Publish":"Unpublish"})]})}}],[]),C=Ri({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:Sf(),getCoreRowModel:Li()});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(It,{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(jo,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(Er,{className:"s3-explr-table",children:[l.jsx(Nr,{className:"s3-explr-table-header",children:C.getHeaderGroups().map(O=>l.jsx(Ze,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map(I=>l.jsx(st,{className:"s3-explr-header-cell",children:I.isPlaceholder?null:tr(I.column.columnDef.header,I.getContext())},I.id))},O.id))}),l.jsx(Tr,{className:"s3-explr-table-body",children:r?l.jsx(Ze,{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?(F=C.getRowModel().rows)==null?void 0:F.map(O=>l.jsx(Ze,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map(I=>l.jsx(Oe,{className:"align-middle s3-explr-cell",children:tr(I.column.columnDef.cell,I.getContext())},I.id))},O.id)):l.jsx(Ze,{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(mi,{children:l.jsxs(vi,{children:[l.jsx(Ct,{children:l.jsx(yi,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,I)=>I+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,I,D)=>l.jsxs(l.Fragment,{children:[I>0&&D[I-1]!==O-1&&l.jsx(Ct,{children:l.jsx(bi,{})},O+"..."),l.jsx(Ct,{children:l.jsx(Kn,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===O?l.jsx(we,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(Ct,{children:l.jsx(wi,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},Sd=10,Mx=A.memo(({apiBaseUrl:e="https://s3-explorer.cmcts1.studio.ai.vn"})=>{const[t,n]=A.useState(1),[r,o]=A.useState([]),[s,i]=A.useState({total:0,page:1,limit:Sd,totalPages:1}),[a,u]=A.useState(!0),[c,f]=A.useState(null),[g,m]=A.useState(new Set),{toast:p}=Lr(),[v,h]=A.useState(!1),y=async C=>{try{f(C);const P=await se.get(`${e}/api/jobs`,{params:{page:C.toString(),limit:Sd.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)}};A.useEffect(()=>{y(t)},[t,e]);const w=async C=>{m(P=>new Set(P).add(C.toString()));try{await se.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 F=new Set(P);return F.delete(C.toString()),F})}},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),F=(C%60).toFixed(0);return`${P}m ${F}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(Qp,{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(ig,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(Er,{children:[l.jsx(Nr,{children:l.jsxs(Ze,{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(Tr,{children:a&&r.length===0?l.jsx(Ze,{children:l.jsx(Oe,{colSpan:7,className:"text-center py-4",children:l.jsx(we,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(C=>{var P,F;return l.jsxs(Ze,{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(Cd,{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]
147
+ ${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":(F=C.status)==null?void 0:F.toUpperCase()})})}),l.jsx(Oe,{className:"!w-[200px]",children:C.status==="fail"?l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>w(C.id),disabled:g.has(C.id.toString()),className:"h-[32px]",children:g.has(C.id.toString())?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):l.jsx("div",{className:"h-[32px]"})})]},C.id)})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(mi,{children:l.jsxs(vi,{children:[l.jsx(Ct,{children:l.jsx(yi,{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,F)=>l.jsxs(l.Fragment,{children:[P>0&&F[P-1]!==C-1&&l.jsx(Ct,{children:l.jsx(bi,{})},C+"..."),l.jsx(Ct,{children:l.jsx(Kn,{onClick:()=>n(C),isActive:t===C,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===C?l.jsx(we,{className:"h-4 w-4 animate-spin"}):C})},C)]})),l.jsx(Ct,{children:l.jsx(wi,{onClick:()=>n(C=>Math.min(s.totalPages,C+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(Xc,{})]})});qe.Job=Mx,qe.S3Explorer=cx,qe.Summary=Dx,Object.defineProperty(qe,Symbol.toStringTag,{value:"Module"})});
143
148
  //# sourceMappingURL=s3-explorer.umd.cjs.map