dccxx-s3-explorer 1.0.92 → 1.0.93

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.
@@ -74,16 +74,16 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
74
74
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[fx]=this[fx]={accessors:{}}).accessors,o=this.prototype;function a(s){const l=rc(s);r[l]||(ZR(o,s),r[l]=!0)}return ie.isArray(e)?e.forEach(a):a(e),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ie.reduceDescriptors(zn.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),ie.freezeMethods(zn);function Zp(t,e){const n=this||nc,r=e||n,o=zn.from(r.headers);let a=r.data;return ie.forEach(t,function(l){a=l.call(n,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function hx(t){return!!(t&&t.__CANCEL__)}function qa(t,e,n){nt.call(this,t??"canceled",nt.ERR_CANCELED,e,n),this.name="CanceledError"}ie.inherits(qa,nt,{__CANCEL__:!0});function px(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function eD(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function tD(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,a=0,s;return e=e!==void 0?e:1e3,function(u){const h=Date.now(),p=r[a];s||(s=h),n[o]=u,r[o]=h;let g=a,w=0;for(;g!==o;)w+=n[g++],g=g%t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),h-s<e)return;const y=p&&h-p;return y?Math.round(w*1e3/y):void 0}}function nD(t,e){let n=0,r=1e3/e,o,a;const s=(h,p=Date.now())=>{n=p,o=null,a&&(clearTimeout(a),a=null),t.apply(null,h)};return[(...h)=>{const p=Date.now(),g=p-n;g>=r?s(h,p):(o=h,a||(a=setTimeout(()=>{a=null,s(o)},r-g)))},()=>o&&s(o)]}const Rd=(t,e,n=3)=>{let r=0;const o=tD(50,250);return nD(a=>{const s=a.loaded,l=a.lengthComputable?a.total:void 0,u=s-r,h=o(u),p=s<=l;r=s;const g={loaded:s,total:l,progress:l?s/l:void 0,bytes:u,rate:h||void 0,estimated:h&&l&&p?(l-s)/h:void 0,event:a,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(g)},n)},gx=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},mx=t=>(...e)=>ie.asap(()=>t(...e)),rD=xn.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,xn.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(xn.origin),xn.navigator&&/(msie|trident)/i.test(xn.navigator.userAgent)):()=>!0,oD=xn.hasStandardBrowserEnv?{write(t,e,n,r,o,a){const s=[t+"="+encodeURIComponent(e)];ie.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ie.isString(r)&&s.push("path="+r),ie.isString(o)&&s.push("domain="+o),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function iD(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function aD(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function vx(t,e,n){let r=!iD(e);return t&&(r||n==!1)?aD(t,e):e}const yx=t=>t instanceof zn?{...t}:t;function Gi(t,e){e=e||{};const n={};function r(h,p,g,w){return ie.isPlainObject(h)&&ie.isPlainObject(p)?ie.merge.call({caseless:w},h,p):ie.isPlainObject(p)?ie.merge({},p):ie.isArray(p)?p.slice():p}function o(h,p,g,w){if(ie.isUndefined(p)){if(!ie.isUndefined(h))return r(void 0,h,g,w)}else return r(h,p,g,w)}function a(h,p){if(!ie.isUndefined(p))return r(void 0,p)}function s(h,p){if(ie.isUndefined(p)){if(!ie.isUndefined(h))return r(void 0,h)}else return r(void 0,p)}function l(h,p,g){if(g in e)return r(h,p);if(g in t)return r(void 0,h)}const u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(h,p,g)=>o(yx(h),yx(p),g,!0)};return ie.forEach(Object.keys(Object.assign({},t,e)),function(p){const g=u[p]||o,w=g(t[p],e[p],p);ie.isUndefined(w)&&g!==l||(n[p]=w)}),n}const wx=t=>{const e=Gi({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=e;e.headers=s=zn.from(s),e.url=cx(vx(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(ie.isFormData(n)){if(xn.hasStandardBrowserEnv||xn.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((u=s.getContentType())!==!1){const[h,...p]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];s.setContentType([h||"multipart/form-data",...p].join("; "))}}if(xn.hasStandardBrowserEnv&&(r&&ie.isFunction(r)&&(r=r(e)),r||r!==!1&&rD(e.url))){const h=o&&a&&oD.read(a);h&&s.set(o,h)}return e},sD=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=wx(t);let a=o.data;const s=zn.from(o.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:h}=o,p,g,w,y,x;function v(){y&&y(),x&&x(),o.cancelToken&&o.cancelToken.unsubscribe(p),o.signal&&o.signal.removeEventListener("abort",p)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function E(){if(!b)return;const N=zn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),_={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:N,config:t,request:b};px(function(H){n(H),v()},function(H){r(H),v()},_),b=null}"onloadend"in b?b.onloadend=E:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(E)},b.onabort=function(){b&&(r(new nt("Request aborted",nt.ECONNABORTED,t,b)),b=null)},b.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,t,b)),b=null},b.ontimeout=function(){let P=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||dx;o.timeoutErrorMessage&&(P=o.timeoutErrorMessage),r(new nt(P,_.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,t,b)),b=null},a===void 0&&s.setContentType(null),"setRequestHeader"in b&&ie.forEach(s.toJSON(),function(P,_){b.setRequestHeader(_,P)}),ie.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),l&&l!=="json"&&(b.responseType=o.responseType),h&&([w,x]=Rd(h,!0),b.addEventListener("progress",w)),u&&b.upload&&([g,y]=Rd(u),b.upload.addEventListener("progress",g),b.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(p=N=>{b&&(r(!N||N.type?new qa(null,t,b):N),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(p),o.signal&&(o.signal.aborted?p():o.signal.addEventListener("abort",p)));const T=eD(o.url);if(T&&xn.protocols.indexOf(T)===-1){r(new nt("Unsupported protocol "+T+":",nt.ERR_BAD_REQUEST,t));return}b.send(a||null)})},cD=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const a=function(h){if(!o){o=!0,l();const p=h instanceof Error?h:this.reason;r.abort(p instanceof nt?p:new qa(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{s=null,a(new nt(`timeout ${e} of ms exceeded`,nt.ETIMEDOUT))},e);const l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(a):h.removeEventListener("abort",a)}),t=null)};t.forEach(h=>h.addEventListener("abort",a));const{signal:u}=r;return u.unsubscribe=()=>ie.asap(l),u}},lD=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},dD=async function*(t,e){for await(const n of uD(t))yield*lD(n,e)},uD=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Cx=(t,e,n,r)=>{const o=dD(t,e);let a=0,s,l=u=>{s||(s=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:h,value:p}=await o.next();if(h){l(),u.close();return}let g=p.byteLength;if(n){let w=a+=g;n(w)}u.enqueue(new Uint8Array(p))}catch(h){throw l(h),h}},cancel(u){return l(u),o.return()}},{highWaterMark:2})},Dd=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",bx=Dd&&typeof ReadableStream=="function",fD=Dd&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),xx=(t,...e)=>{try{return!!t(...e)}catch{return!1}},hD=bx&&xx(()=>{let t=!1;const e=new Request(xn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Sx=64*1024,eg=bx&&xx(()=>ie.isReadableStream(new Response("").body)),Ld={stream:eg&&(t=>t.body)};Dd&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ld[e]&&(Ld[e]=ie.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new nt(`Response type '${e}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})})(new Response);const pD=async t=>{if(t==null)return 0;if(ie.isBlob(t))return t.size;if(ie.isSpecCompliantForm(t))return(await new Request(xn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(ie.isArrayBufferView(t)||ie.isArrayBuffer(t))return t.byteLength;if(ie.isURLSearchParams(t)&&(t=t+""),ie.isString(t))return(await fD(t)).byteLength},gD=async(t,e)=>{const n=ie.toFiniteNumber(t.getContentLength());return n??pD(e)},tg={http:LR,xhr:sD,fetch:Dd&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:a,timeout:s,onDownloadProgress:l,onUploadProgress:u,responseType:h,headers:p,withCredentials:g="same-origin",fetchOptions:w}=wx(t);h=h?(h+"").toLowerCase():"text";let y=cD([o,a&&a.toAbortSignal()],s),x;const v=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let b;try{if(u&&hD&&n!=="get"&&n!=="head"&&(b=await gD(p,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),D;if(ie.isFormData(r)&&(D=_.headers.get("content-type"))&&p.setContentType(D),_.body){const[H,K]=gx(b,Rd(mx(u)));r=Cx(_.body,Sx,H,K)}}ie.isString(g)||(g=g?"include":"omit");const E="credentials"in Request.prototype;x=new Request(e,{...w,signal:y,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:E?g:void 0});let T=await fetch(x);const N=eg&&(h==="stream"||h==="response");if(eg&&(l||N&&v)){const _={};["status","statusText","headers"].forEach(ee=>{_[ee]=T[ee]});const D=ie.toFiniteNumber(T.headers.get("content-length")),[H,K]=l&&gx(D,Rd(mx(l),!0))||[];T=new Response(Cx(T.body,Sx,H,()=>{K&&K(),v&&v()}),_)}h=h||"text";let P=await Ld[ie.findKey(Ld,h)||"text"](T,t);return!N&&v&&v(),await new Promise((_,D)=>{px(_,D,{data:P,headers:zn.from(T.headers),status:T.status,statusText:T.statusText,config:t,request:x})})}catch(E){throw v&&v(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new nt("Network Error",nt.ERR_NETWORK,t,x),{cause:E.cause||E}):nt.from(E,E&&E.code,t,x)}})};ie.forEach(tg,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const _x=t=>`- ${t}`,mD=t=>ie.isFunction(t)||t===null||t===!1,Ex={getAdapter:t=>{t=ie.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let a=0;a<e;a++){n=t[a];let s;if(r=n,!mD(n)&&(r=tg[(s=String(n)).toLowerCase()],r===void 0))throw new nt(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+a]=r}if(!r){const a=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=e?a.length>1?`since :
75
75
  `+a.map(_x).join(`
76
76
  `):" "+_x(a[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:tg};function ng(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new qa(null,t)}function Tx(t){return ng(t),t.headers=zn.from(t.headers),t.data=Zp.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ex.getAdapter(t.adapter||nc.adapter)(t).then(function(r){return ng(t),r.data=Zp.call(t,t.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return hx(r)||(ng(t),r&&r.response&&(r.response.data=Zp.call(t,t.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const Ax="1.9.0",Fd={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Fd[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ix={};Fd.transitional=function(e,n,r){function o(a,s){return"[Axios v"+Ax+"] Transitional option '"+a+"'"+s+(r?". "+r:"")}return(a,s,l)=>{if(e===!1)throw new nt(o(s," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!Ix[s]&&(Ix[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(a,s,l):!0}},Fd.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function vD(t,e,n){if(typeof t!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const a=r[o],s=e[a];if(s){const l=t[a],u=l===void 0||s(l,a,t);if(u!==!0)throw new nt("option "+a+" must be "+u,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+a,nt.ERR_BAD_OPTION)}}const $d={assertOptions:vD,validators:Fd},uo=$d.validators;let ji=class{constructor(e){this.defaults=e||{},this.interceptors={request:new lx,response:new lx}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
77
- `+a):r.stack=a}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Gi(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&$d.assertOptions(r,{silentJSONParsing:uo.transitional(uo.boolean),forcedJSONParsing:uo.transitional(uo.boolean),clarifyTimeoutError:uo.transitional(uo.boolean)},!1),o!=null&&(ie.isFunction(o)?n.paramsSerializer={serialize:o}:$d.assertOptions(o,{encode:uo.function,serialize:uo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),$d.assertOptions(n,{baseUrl:uo.spelling("baseURL"),withXsrfToken:uo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=a&&ie.merge(a.common,a[n.method]);a&&ie.forEach(["delete","get","head","post","put","patch","common"],x=>{delete a[x]}),n.headers=zn.concat(s,a);const l=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});const h=[];this.interceptors.response.forEach(function(v){h.push(v.fulfilled,v.rejected)});let p,g=0,w;if(!u){const x=[Tx.bind(this),void 0];for(x.unshift.apply(x,l),x.push.apply(x,h),w=x.length,p=Promise.resolve(n);g<w;)p=p.then(x[g++],x[g++]);return p}w=l.length;let y=n;for(g=0;g<w;){const x=l[g++],v=l[g++];try{y=x(y)}catch(b){v.call(this,b);break}}try{p=Tx.call(this,y)}catch(x){return Promise.reject(x)}for(g=0,w=h.length;g<w;)p=p.then(h[g++],h[g++]);return p}getUri(e){e=Gi(this.defaults,e);const n=vx(e.baseURL,e.url,e.allowAbsoluteUrls);return cx(n,e.params,e.paramsSerializer)}};ie.forEach(["delete","get","head","options"],function(e){ji.prototype[e]=function(n,r){return this.request(Gi(r||{},{method:e,url:n,data:(r||{}).data}))}}),ie.forEach(["post","put","patch"],function(e){function n(r){return function(a,s,l){return this.request(Gi(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}ji.prototype[e]=n(),ji.prototype[e+"Form"]=n(!0)});let yD=class gI{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const s=new Promise(l=>{r.subscribe(l),a=l}).then(o);return s.cancel=function(){r.unsubscribe(a)},s},e(function(a,s,l){r.reason||(r.reason=new qa(a,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new gI(function(o){e=o}),cancel:e}}};function wD(t){return function(n){return t.apply(null,n)}}function CD(t){return ie.isObject(t)&&t.isAxiosError===!0}const rg={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(rg).forEach(([t,e])=>{rg[e]=t});function kx(t){const e=new ji(t),n=Wb(ji.prototype.request,e);return ie.extend(n,ji.prototype,e,{allOwnKeys:!0}),ie.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return kx(Gi(t,o))},n}const Le=kx(nc);Le.Axios=ji,Le.CanceledError=qa,Le.CancelToken=yD,Le.isCancel=hx,Le.VERSION=Ax,Le.toFormData=Od,Le.AxiosError=nt,Le.Cancel=Le.CanceledError,Le.all=function(e){return Promise.all(e)},Le.spread=wD,Le.isAxiosError=CD,Le.mergeConfig=Gi,Le.AxiosHeaders=zn,Le.formToJSON=t=>ux(ie.isHTMLForm(t)?new FormData(t):t),Le.getAdapter=Ex.getAdapter,Le.HttpStatusCode=rg,Le.default=Le;const{Axios:bj,AxiosError:xj,CanceledError:Sj,isCancel:_j,CancelToken:Ej,VERSION:Tj,all:Aj,Cancel:Ij,isAxiosError:kj,spread:Nj,toFormData:Pj,AxiosHeaders:Oj,HttpStatusCode:Mj,formToJSON:Rj,getAdapter:Dj,mergeConfig:Lj}=Le;var fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const bD=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var xD=t=>!bD.has(t&&t.code);const SD=Hd(xD),og="axios-retry";function Nx(t){const e=["ERR_CANCELED","ECONNABORTED"];return t.response||!t.code||e.includes(t.code)?!1:SD(t)}const Px=["get","head","options"],_D=Px.concat(["put","delete"]);function ig(t){return t.code!=="ECONNABORTED"&&(!t.response||t.response.status===429||t.response.status>=500&&t.response.status<=599)}function ED(t){var e;return(e=t.config)!=null&&e.method?ig(t)&&Px.indexOf(t.config.method)!==-1:!1}function Ox(t){var e;return(e=t.config)!=null&&e.method?ig(t)&&_D.indexOf(t.config.method)!==-1:!1}function Mx(t){return Nx(t)||Ox(t)}function ag(t=void 0){var r;const e=(r=t==null?void 0:t.response)==null?void 0:r.headers["retry-after"];if(!e)return 0;let n=(Number(e)||0)*1e3;return n===0&&(n=(new Date(e).valueOf()||0)-Date.now()),Math.max(0,n)}function TD(t=0,e=void 0){return Math.max(0,ag(e))}function AD(t=0,e=void 0,n=100){const r=2**t*n,o=Math.max(r,ag(e)),a=o*.2*Math.random();return o+a}function ID(t=100){return(e=0,n=void 0)=>{const r=e*t;return Math.max(r,ag(n))}}const kD={retries:3,retryCondition:Mx,retryDelay:TD,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function ND(t,e){return{...kD,...e,...t[og]}}function Rx(t,e,n=!1){const r=ND(t,e||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),t[og]=r,r}function PD(t,e){t.defaults.agent===e.agent&&delete e.agent,t.defaults.httpAgent===e.httpAgent&&delete e.httpAgent,t.defaults.httpsAgent===e.httpsAgent&&delete e.httpsAgent}async function OD(t,e){const{retries:n,retryCondition:r}=t,o=(t.retryCount||0)<n&&r(e);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function MD(t,e,n,r){var u;e.retryCount+=1;const{retryDelay:o,shouldResetTimeout:a,onRetry:s}=e,l=o(e.retryCount,n);if(PD(t,r),!a&&r.timeout&&e.lastRequestTime){const h=Date.now()-e.lastRequestTime,p=r.timeout-h-l;if(p<=0)return Promise.reject(n);r.timeout=p}return r.transformRequest=[h=>h],await s(e.retryCount,n,r),(u=r.signal)!=null&&u.aborted?Promise.resolve(t(r)):new Promise(h=>{var w;const p=()=>{clearTimeout(g),h(t(r))},g=setTimeout(()=>{var y;h(t(r)),(y=r.signal)!=null&&y.removeEventListener&&r.signal.removeEventListener("abort",p)},l);(w=r.signal)!=null&&w.addEventListener&&r.signal.addEventListener("abort",p,{once:!0})})}async function RD(t,e){t.retryCount>=t.retries&&await t.onMaxRetryTimesExceeded(e,t.retryCount)}const Lo=(t,e)=>{const n=t.interceptors.request.use(o=>{var a;return Rx(o,e,!0),(a=o[og])!=null&&a.validateResponse&&(o.validateStatus=()=>!1),o}),r=t.interceptors.response.use(null,async o=>{var l;const{config:a}=o;if(!a)return Promise.reject(o);const s=Rx(a,e);return o.response&&((l=s.validateResponse)!=null&&l.call(s,o.response))?o.response:await OD(s,o)?MD(t,s,o,a):(await RD(s,o),Promise.reject(o))});return{requestInterceptorId:n,responseInterceptorId:r}};Lo.isNetworkError=Nx,Lo.isSafeRequestError=ED,Lo.isIdempotentRequestError=Ox,Lo.isNetworkOrIdempotentRequestError=Mx,Lo.exponentialDelay=AD,Lo.linearDelay=ID,Lo.isRetryableError=ig;var Dx={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(fo,function(){var n=1e3,r=6e4,o=36e5,a="millisecond",s="second",l="minute",u="hour",h="day",p="week",g="month",w="quarter",y="year",x="date",v="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(q){var Z=["th","st","nd","rd"],Y=q%100;return"["+q+(Z[(Y-20)%10]||Z[Y]||Z[0])+"]"}},N=function(q,Z,Y){var oe=String(q);return!oe||oe.length>=Z?q:""+Array(Z+1-oe.length).join(Y)+q},P={s:N,z:function(q){var Z=-q.utcOffset(),Y=Math.abs(Z),oe=Math.floor(Y/60),Q=Y%60;return(Z<=0?"+":"-")+N(oe,2,"0")+":"+N(Q,2,"0")},m:function q(Z,Y){if(Z.date()<Y.date())return-q(Y,Z);var oe=12*(Y.year()-Z.year())+(Y.month()-Z.month()),Q=Z.clone().add(oe,g),X=Y-Q<0,$=Z.clone().add(oe+(X?-1:1),g);return+(-(oe+(Y-Q)/(X?Q-$:$-Q))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:g,y,w:p,d:h,D:x,h:u,m:l,s,ms:a,Q:w}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},_="en",D={};D[_]=T;var H="$isDayjsObject",K=function(q){return q instanceof se||!(!q||!q[H])},ee=function q(Z,Y,oe){var Q;if(!Z)return _;if(typeof Z=="string"){var X=Z.toLowerCase();D[X]&&(Q=X),Y&&(D[X]=Y,Q=X);var $=Z.split("-");if(!Q&&$.length>1)return q($[0])}else{var te=Z.name;D[te]=Z,Q=te}return!oe&&Q&&(_=Q),Q||!oe&&_},W=function(q,Z){if(K(q))return q.clone();var Y=typeof Z=="object"?Z:{};return Y.date=q,Y.args=arguments,new se(Y)},de=P;de.l=ee,de.i=K,de.w=function(q,Z){return W(q,{locale:Z.$L,utc:Z.$u,x:Z.$x,$offset:Z.$offset})};var se=function(){function q(Y){this.$L=ee(Y.locale,null,!0),this.parse(Y),this.$x=this.$x||Y.x||{},this[H]=!0}var Z=q.prototype;return Z.parse=function(Y){this.$d=function(oe){var Q=oe.date,X=oe.utc;if(Q===null)return new Date(NaN);if(de.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var $=Q.match(b);if($){var te=$[2]-1||0,_e=($[7]||"0").substring(0,3);return X?new Date(Date.UTC($[1],te,$[3]||1,$[4]||0,$[5]||0,$[6]||0,_e)):new Date($[1],te,$[3]||1,$[4]||0,$[5]||0,$[6]||0,_e)}}return new Date(Q)}(Y),this.init()},Z.init=function(){var Y=this.$d;this.$y=Y.getFullYear(),this.$M=Y.getMonth(),this.$D=Y.getDate(),this.$W=Y.getDay(),this.$H=Y.getHours(),this.$m=Y.getMinutes(),this.$s=Y.getSeconds(),this.$ms=Y.getMilliseconds()},Z.$utils=function(){return de},Z.isValid=function(){return this.$d.toString()!==v},Z.isSame=function(Y,oe){var Q=W(Y);return this.startOf(oe)<=Q&&Q<=this.endOf(oe)},Z.isAfter=function(Y,oe){return W(Y)<this.startOf(oe)},Z.isBefore=function(Y,oe){return this.endOf(oe)<W(Y)},Z.$g=function(Y,oe,Q){return de.u(Y)?this[oe]:this.set(Q,Y)},Z.unix=function(){return Math.floor(this.valueOf()/1e3)},Z.valueOf=function(){return this.$d.getTime()},Z.startOf=function(Y,oe){var Q=this,X=!!de.u(oe)||oe,$=de.p(Y),te=function(Ae,Ce){var Ne=de.w(Q.$u?Date.UTC(Q.$y,Ce,Ae):new Date(Q.$y,Ce,Ae),Q);return X?Ne:Ne.endOf(h)},_e=function(Ae,Ce){return de.w(Q.toDate()[Ae].apply(Q.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(Ce)),Q)},ke=this.$W,xe=this.$M,Pe=this.$D,Te="set"+(this.$u?"UTC":"");switch($){case y:return X?te(1,0):te(31,11);case g:return X?te(1,xe):te(0,xe+1);case p:var z=this.$locale().weekStart||0,ce=(ke<z?ke+7:ke)-z;return te(X?Pe-ce:Pe+(6-ce),xe);case h:case x:return _e(Te+"Hours",0);case u:return _e(Te+"Minutes",1);case l:return _e(Te+"Seconds",2);case s:return _e(Te+"Milliseconds",3);default:return this.clone()}},Z.endOf=function(Y){return this.startOf(Y,!1)},Z.$set=function(Y,oe){var Q,X=de.p(Y),$="set"+(this.$u?"UTC":""),te=(Q={},Q[h]=$+"Date",Q[x]=$+"Date",Q[g]=$+"Month",Q[y]=$+"FullYear",Q[u]=$+"Hours",Q[l]=$+"Minutes",Q[s]=$+"Seconds",Q[a]=$+"Milliseconds",Q)[X],_e=X===h?this.$D+(oe-this.$W):oe;if(X===g||X===y){var ke=this.clone().set(x,1);ke.$d[te](_e),ke.init(),this.$d=ke.set(x,Math.min(this.$D,ke.daysInMonth())).$d}else te&&this.$d[te](_e);return this.init(),this},Z.set=function(Y,oe){return this.clone().$set(Y,oe)},Z.get=function(Y){return this[de.p(Y)]()},Z.add=function(Y,oe){var Q,X=this;Y=Number(Y);var $=de.p(oe),te=function(xe){var Pe=W(X);return de.w(Pe.date(Pe.date()+Math.round(xe*Y)),X)};if($===g)return this.set(g,this.$M+Y);if($===y)return this.set(y,this.$y+Y);if($===h)return te(1);if($===p)return te(7);var _e=(Q={},Q[l]=r,Q[u]=o,Q[s]=n,Q)[$]||1,ke=this.$d.getTime()+Y*_e;return de.w(ke,this)},Z.subtract=function(Y,oe){return this.add(-1*Y,oe)},Z.format=function(Y){var oe=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||v;var X=Y||"YYYY-MM-DDTHH:mm:ssZ",$=de.z(this),te=this.$H,_e=this.$m,ke=this.$M,xe=Q.weekdays,Pe=Q.months,Te=Q.meridiem,z=function(Ce,Ne,ne,Ve){return Ce&&(Ce[Ne]||Ce(oe,X))||ne[Ne].slice(0,Ve)},ce=function(Ce){return de.s(te%12||12,Ce,"0")},Ae=Te||function(Ce,Ne,ne){var Ve=Ce<12?"AM":"PM";return ne?Ve.toLowerCase():Ve};return X.replace(E,function(Ce,Ne){return Ne||function(ne){switch(ne){case"YY":return String(oe.$y).slice(-2);case"YYYY":return de.s(oe.$y,4,"0");case"M":return ke+1;case"MM":return de.s(ke+1,2,"0");case"MMM":return z(Q.monthsShort,ke,Pe,3);case"MMMM":return z(Pe,ke);case"D":return oe.$D;case"DD":return de.s(oe.$D,2,"0");case"d":return String(oe.$W);case"dd":return z(Q.weekdaysMin,oe.$W,xe,2);case"ddd":return z(Q.weekdaysShort,oe.$W,xe,3);case"dddd":return xe[oe.$W];case"H":return String(te);case"HH":return de.s(te,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return Ae(te,_e,!0);case"A":return Ae(te,_e,!1);case"m":return String(_e);case"mm":return de.s(_e,2,"0");case"s":return String(oe.$s);case"ss":return de.s(oe.$s,2,"0");case"SSS":return de.s(oe.$ms,3,"0");case"Z":return $}return null}(Ce)||$.replace(":","")})},Z.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Z.diff=function(Y,oe,Q){var X,$=this,te=de.p(oe),_e=W(Y),ke=(_e.utcOffset()-this.utcOffset())*r,xe=this-_e,Pe=function(){return de.m($,_e)};switch(te){case y:X=Pe()/12;break;case g:X=Pe();break;case w:X=Pe()/3;break;case p:X=(xe-ke)/6048e5;break;case h:X=(xe-ke)/864e5;break;case u:X=xe/o;break;case l:X=xe/r;break;case s:X=xe/n;break;default:X=xe}return Q?X:de.a(X)},Z.daysInMonth=function(){return this.endOf(g).$D},Z.$locale=function(){return D[this.$L]},Z.locale=function(Y,oe){if(!Y)return this.$L;var Q=this.clone(),X=ee(Y,oe,!0);return X&&(Q.$L=X),Q},Z.clone=function(){return de.w(this.$d,this)},Z.toDate=function(){return new Date(this.valueOf())},Z.toJSON=function(){return this.isValid()?this.toISOString():null},Z.toISOString=function(){return this.$d.toISOString()},Z.toString=function(){return this.$d.toUTCString()},q}(),fe=se.prototype;return W.prototype=fe,[["$ms",a],["$s",s],["$m",l],["$H",u],["$W",h],["$M",g],["$y",y],["$D",x]].forEach(function(q){fe[q[1]]=function(Z){return this.$g(Z,q[0],q[1])}}),W.extend=function(q,Z){return q.$i||(q(Z,se,W),q.$i=!0),W},W.locale=ee,W.isDayjs=K,W.unix=function(q){return W(1e3*q)},W.en=D[_],W.Ls=D,W.p={},W})})(Dx);var DD=Dx.exports;const Lx=Hd(DD);var Ud={exports:{}};/**
77
+ `+a):r.stack=a}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Gi(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&$d.assertOptions(r,{silentJSONParsing:uo.transitional(uo.boolean),forcedJSONParsing:uo.transitional(uo.boolean),clarifyTimeoutError:uo.transitional(uo.boolean)},!1),o!=null&&(ie.isFunction(o)?n.paramsSerializer={serialize:o}:$d.assertOptions(o,{encode:uo.function,serialize:uo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),$d.assertOptions(n,{baseUrl:uo.spelling("baseURL"),withXsrfToken:uo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=a&&ie.merge(a.common,a[n.method]);a&&ie.forEach(["delete","get","head","post","put","patch","common"],x=>{delete a[x]}),n.headers=zn.concat(s,a);const l=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});const h=[];this.interceptors.response.forEach(function(v){h.push(v.fulfilled,v.rejected)});let p,g=0,w;if(!u){const x=[Tx.bind(this),void 0];for(x.unshift.apply(x,l),x.push.apply(x,h),w=x.length,p=Promise.resolve(n);g<w;)p=p.then(x[g++],x[g++]);return p}w=l.length;let y=n;for(g=0;g<w;){const x=l[g++],v=l[g++];try{y=x(y)}catch(b){v.call(this,b);break}}try{p=Tx.call(this,y)}catch(x){return Promise.reject(x)}for(g=0,w=h.length;g<w;)p=p.then(h[g++],h[g++]);return p}getUri(e){e=Gi(this.defaults,e);const n=vx(e.baseURL,e.url,e.allowAbsoluteUrls);return cx(n,e.params,e.paramsSerializer)}};ie.forEach(["delete","get","head","options"],function(e){ji.prototype[e]=function(n,r){return this.request(Gi(r||{},{method:e,url:n,data:(r||{}).data}))}}),ie.forEach(["post","put","patch"],function(e){function n(r){return function(a,s,l){return this.request(Gi(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}ji.prototype[e]=n(),ji.prototype[e+"Form"]=n(!0)});let yD=class gI{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const s=new Promise(l=>{r.subscribe(l),a=l}).then(o);return s.cancel=function(){r.unsubscribe(a)},s},e(function(a,s,l){r.reason||(r.reason=new qa(a,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new gI(function(o){e=o}),cancel:e}}};function wD(t){return function(n){return t.apply(null,n)}}function CD(t){return ie.isObject(t)&&t.isAxiosError===!0}const rg={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(rg).forEach(([t,e])=>{rg[e]=t});function kx(t){const e=new ji(t),n=Wb(ji.prototype.request,e);return ie.extend(n,ji.prototype,e,{allOwnKeys:!0}),ie.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return kx(Gi(t,o))},n}const Le=kx(nc);Le.Axios=ji,Le.CanceledError=qa,Le.CancelToken=yD,Le.isCancel=hx,Le.VERSION=Ax,Le.toFormData=Od,Le.AxiosError=nt,Le.Cancel=Le.CanceledError,Le.all=function(e){return Promise.all(e)},Le.spread=wD,Le.isAxiosError=CD,Le.mergeConfig=Gi,Le.AxiosHeaders=zn,Le.formToJSON=t=>ux(ie.isHTMLForm(t)?new FormData(t):t),Le.getAdapter=Ex.getAdapter,Le.HttpStatusCode=rg,Le.default=Le;const{Axios:bj,AxiosError:xj,CanceledError:Sj,isCancel:_j,CancelToken:Ej,VERSION:Tj,all:Aj,Cancel:Ij,isAxiosError:kj,spread:Nj,toFormData:Pj,AxiosHeaders:Oj,HttpStatusCode:Mj,formToJSON:Rj,getAdapter:Dj,mergeConfig:Lj}=Le;var fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const bD=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var xD=t=>!bD.has(t&&t.code);const SD=Hd(xD),og="axios-retry";function Nx(t){const e=["ERR_CANCELED","ECONNABORTED"];return t.response||!t.code||e.includes(t.code)?!1:SD(t)}const Px=["get","head","options"],_D=Px.concat(["put","delete"]);function ig(t){return t.code!=="ECONNABORTED"&&(!t.response||t.response.status===429||t.response.status>=500&&t.response.status<=599)}function ED(t){var e;return(e=t.config)!=null&&e.method?ig(t)&&Px.indexOf(t.config.method)!==-1:!1}function Ox(t){var e;return(e=t.config)!=null&&e.method?ig(t)&&_D.indexOf(t.config.method)!==-1:!1}function Mx(t){return Nx(t)||Ox(t)}function ag(t=void 0){var r;const e=(r=t==null?void 0:t.response)==null?void 0:r.headers["retry-after"];if(!e)return 0;let n=(Number(e)||0)*1e3;return n===0&&(n=(new Date(e).valueOf()||0)-Date.now()),Math.max(0,n)}function TD(t=0,e=void 0){return Math.max(0,ag(e))}function AD(t=0,e=void 0,n=100){const r=2**t*n,o=Math.max(r,ag(e)),a=o*.2*Math.random();return o+a}function ID(t=100){return(e=0,n=void 0)=>{const r=e*t;return Math.max(r,ag(n))}}const kD={retries:3,retryCondition:Mx,retryDelay:TD,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function ND(t,e){return{...kD,...e,...t[og]}}function Rx(t,e,n=!1){const r=ND(t,e||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),t[og]=r,r}function PD(t,e){t.defaults.agent===e.agent&&delete e.agent,t.defaults.httpAgent===e.httpAgent&&delete e.httpAgent,t.defaults.httpsAgent===e.httpsAgent&&delete e.httpsAgent}async function OD(t,e){const{retries:n,retryCondition:r}=t,o=(t.retryCount||0)<n&&r(e);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function MD(t,e,n,r){var u;e.retryCount+=1;const{retryDelay:o,shouldResetTimeout:a,onRetry:s}=e,l=o(e.retryCount,n);if(PD(t,r),!a&&r.timeout&&e.lastRequestTime){const h=Date.now()-e.lastRequestTime,p=r.timeout-h-l;if(p<=0)return Promise.reject(n);r.timeout=p}return r.transformRequest=[h=>h],await s(e.retryCount,n,r),(u=r.signal)!=null&&u.aborted?Promise.resolve(t(r)):new Promise(h=>{var w;const p=()=>{clearTimeout(g),h(t(r))},g=setTimeout(()=>{var y;h(t(r)),(y=r.signal)!=null&&y.removeEventListener&&r.signal.removeEventListener("abort",p)},l);(w=r.signal)!=null&&w.addEventListener&&r.signal.addEventListener("abort",p,{once:!0})})}async function RD(t,e){t.retryCount>=t.retries&&await t.onMaxRetryTimesExceeded(e,t.retryCount)}const Lo=(t,e)=>{const n=t.interceptors.request.use(o=>{var a;return Rx(o,e,!0),(a=o[og])!=null&&a.validateResponse&&(o.validateStatus=()=>!1),o}),r=t.interceptors.response.use(null,async o=>{var l;const{config:a}=o;if(!a)return Promise.reject(o);const s=Rx(a,e);return o.response&&((l=s.validateResponse)!=null&&l.call(s,o.response))?o.response:await OD(s,o)?MD(t,s,o,a):(await RD(s,o),Promise.reject(o))});return{requestInterceptorId:n,responseInterceptorId:r}};Lo.isNetworkError=Nx,Lo.isSafeRequestError=ED,Lo.isIdempotentRequestError=Ox,Lo.isNetworkOrIdempotentRequestError=Mx,Lo.exponentialDelay=AD,Lo.linearDelay=ID,Lo.isRetryableError=ig;var Dx={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(fo,function(){var n=1e3,r=6e4,o=36e5,a="millisecond",s="second",l="minute",u="hour",h="day",p="week",g="month",w="quarter",y="year",x="date",v="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(q){var Z=["th","st","nd","rd"],Y=q%100;return"["+q+(Z[(Y-20)%10]||Z[Y]||Z[0])+"]"}},N=function(q,Z,Y){var oe=String(q);return!oe||oe.length>=Z?q:""+Array(Z+1-oe.length).join(Y)+q},P={s:N,z:function(q){var Z=-q.utcOffset(),Y=Math.abs(Z),oe=Math.floor(Y/60),Q=Y%60;return(Z<=0?"+":"-")+N(oe,2,"0")+":"+N(Q,2,"0")},m:function q(Z,Y){if(Z.date()<Y.date())return-q(Y,Z);var oe=12*(Y.year()-Z.year())+(Y.month()-Z.month()),Q=Z.clone().add(oe,g),X=Y-Q<0,$=Z.clone().add(oe+(X?-1:1),g);return+(-(oe+(Y-Q)/(X?Q-$:$-Q))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:g,y,w:p,d:h,D:x,h:u,m:l,s,ms:a,Q:w}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},_="en",D={};D[_]=T;var H="$isDayjsObject",K=function(q){return q instanceof se||!(!q||!q[H])},ee=function q(Z,Y,oe){var Q;if(!Z)return _;if(typeof Z=="string"){var X=Z.toLowerCase();D[X]&&(Q=X),Y&&(D[X]=Y,Q=X);var $=Z.split("-");if(!Q&&$.length>1)return q($[0])}else{var te=Z.name;D[te]=Z,Q=te}return!oe&&Q&&(_=Q),Q||!oe&&_},W=function(q,Z){if(K(q))return q.clone();var Y=typeof Z=="object"?Z:{};return Y.date=q,Y.args=arguments,new se(Y)},de=P;de.l=ee,de.i=K,de.w=function(q,Z){return W(q,{locale:Z.$L,utc:Z.$u,x:Z.$x,$offset:Z.$offset})};var se=function(){function q(Y){this.$L=ee(Y.locale,null,!0),this.parse(Y),this.$x=this.$x||Y.x||{},this[H]=!0}var Z=q.prototype;return Z.parse=function(Y){this.$d=function(oe){var Q=oe.date,X=oe.utc;if(Q===null)return new Date(NaN);if(de.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var $=Q.match(b);if($){var te=$[2]-1||0,_e=($[7]||"0").substring(0,3);return X?new Date(Date.UTC($[1],te,$[3]||1,$[4]||0,$[5]||0,$[6]||0,_e)):new Date($[1],te,$[3]||1,$[4]||0,$[5]||0,$[6]||0,_e)}}return new Date(Q)}(Y),this.init()},Z.init=function(){var Y=this.$d;this.$y=Y.getFullYear(),this.$M=Y.getMonth(),this.$D=Y.getDate(),this.$W=Y.getDay(),this.$H=Y.getHours(),this.$m=Y.getMinutes(),this.$s=Y.getSeconds(),this.$ms=Y.getMilliseconds()},Z.$utils=function(){return de},Z.isValid=function(){return this.$d.toString()!==v},Z.isSame=function(Y,oe){var Q=W(Y);return this.startOf(oe)<=Q&&Q<=this.endOf(oe)},Z.isAfter=function(Y,oe){return W(Y)<this.startOf(oe)},Z.isBefore=function(Y,oe){return this.endOf(oe)<W(Y)},Z.$g=function(Y,oe,Q){return de.u(Y)?this[oe]:this.set(Q,Y)},Z.unix=function(){return Math.floor(this.valueOf()/1e3)},Z.valueOf=function(){return this.$d.getTime()},Z.startOf=function(Y,oe){var Q=this,X=!!de.u(oe)||oe,$=de.p(Y),te=function(Ae,Ce){var Ne=de.w(Q.$u?Date.UTC(Q.$y,Ce,Ae):new Date(Q.$y,Ce,Ae),Q);return X?Ne:Ne.endOf(h)},_e=function(Ae,Ce){return de.w(Q.toDate()[Ae].apply(Q.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(Ce)),Q)},ke=this.$W,xe=this.$M,Pe=this.$D,Te="set"+(this.$u?"UTC":"");switch($){case y:return X?te(1,0):te(31,11);case g:return X?te(1,xe):te(0,xe+1);case p:var z=this.$locale().weekStart||0,ce=(ke<z?ke+7:ke)-z;return te(X?Pe-ce:Pe+(6-ce),xe);case h:case x:return _e(Te+"Hours",0);case u:return _e(Te+"Minutes",1);case l:return _e(Te+"Seconds",2);case s:return _e(Te+"Milliseconds",3);default:return this.clone()}},Z.endOf=function(Y){return this.startOf(Y,!1)},Z.$set=function(Y,oe){var Q,X=de.p(Y),$="set"+(this.$u?"UTC":""),te=(Q={},Q[h]=$+"Date",Q[x]=$+"Date",Q[g]=$+"Month",Q[y]=$+"FullYear",Q[u]=$+"Hours",Q[l]=$+"Minutes",Q[s]=$+"Seconds",Q[a]=$+"Milliseconds",Q)[X],_e=X===h?this.$D+(oe-this.$W):oe;if(X===g||X===y){var ke=this.clone().set(x,1);ke.$d[te](_e),ke.init(),this.$d=ke.set(x,Math.min(this.$D,ke.daysInMonth())).$d}else te&&this.$d[te](_e);return this.init(),this},Z.set=function(Y,oe){return this.clone().$set(Y,oe)},Z.get=function(Y){return this[de.p(Y)]()},Z.add=function(Y,oe){var Q,X=this;Y=Number(Y);var $=de.p(oe),te=function(xe){var Pe=W(X);return de.w(Pe.date(Pe.date()+Math.round(xe*Y)),X)};if($===g)return this.set(g,this.$M+Y);if($===y)return this.set(y,this.$y+Y);if($===h)return te(1);if($===p)return te(7);var _e=(Q={},Q[l]=r,Q[u]=o,Q[s]=n,Q)[$]||1,ke=this.$d.getTime()+Y*_e;return de.w(ke,this)},Z.subtract=function(Y,oe){return this.add(-1*Y,oe)},Z.format=function(Y){var oe=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||v;var X=Y||"YYYY-MM-DDTHH:mm:ssZ",$=de.z(this),te=this.$H,_e=this.$m,ke=this.$M,xe=Q.weekdays,Pe=Q.months,Te=Q.meridiem,z=function(Ce,Ne,ne,Ve){return Ce&&(Ce[Ne]||Ce(oe,X))||ne[Ne].slice(0,Ve)},ce=function(Ce){return de.s(te%12||12,Ce,"0")},Ae=Te||function(Ce,Ne,ne){var Ve=Ce<12?"AM":"PM";return ne?Ve.toLowerCase():Ve};return X.replace(E,function(Ce,Ne){return Ne||function(ne){switch(ne){case"YY":return String(oe.$y).slice(-2);case"YYYY":return de.s(oe.$y,4,"0");case"M":return ke+1;case"MM":return de.s(ke+1,2,"0");case"MMM":return z(Q.monthsShort,ke,Pe,3);case"MMMM":return z(Pe,ke);case"D":return oe.$D;case"DD":return de.s(oe.$D,2,"0");case"d":return String(oe.$W);case"dd":return z(Q.weekdaysMin,oe.$W,xe,2);case"ddd":return z(Q.weekdaysShort,oe.$W,xe,3);case"dddd":return xe[oe.$W];case"H":return String(te);case"HH":return de.s(te,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return Ae(te,_e,!0);case"A":return Ae(te,_e,!1);case"m":return String(_e);case"mm":return de.s(_e,2,"0");case"s":return String(oe.$s);case"ss":return de.s(oe.$s,2,"0");case"SSS":return de.s(oe.$ms,3,"0");case"Z":return $}return null}(Ce)||$.replace(":","")})},Z.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Z.diff=function(Y,oe,Q){var X,$=this,te=de.p(oe),_e=W(Y),ke=(_e.utcOffset()-this.utcOffset())*r,xe=this-_e,Pe=function(){return de.m($,_e)};switch(te){case y:X=Pe()/12;break;case g:X=Pe();break;case w:X=Pe()/3;break;case p:X=(xe-ke)/6048e5;break;case h:X=(xe-ke)/864e5;break;case u:X=xe/o;break;case l:X=xe/r;break;case s:X=xe/n;break;default:X=xe}return Q?X:de.a(X)},Z.daysInMonth=function(){return this.endOf(g).$D},Z.$locale=function(){return D[this.$L]},Z.locale=function(Y,oe){if(!Y)return this.$L;var Q=this.clone(),X=ee(Y,oe,!0);return X&&(Q.$L=X),Q},Z.clone=function(){return de.w(this.$d,this)},Z.toDate=function(){return new Date(this.valueOf())},Z.toJSON=function(){return this.isValid()?this.toISOString():null},Z.toISOString=function(){return this.$d.toISOString()},Z.toString=function(){return this.$d.toUTCString()},q}(),he=se.prototype;return W.prototype=he,[["$ms",a],["$s",s],["$m",l],["$H",u],["$W",h],["$M",g],["$y",y],["$D",x]].forEach(function(q){he[q[1]]=function(Z){return this.$g(Z,q[0],q[1])}}),W.extend=function(q,Z){return q.$i||(q(Z,se,W),q.$i=!0),W},W.locale=ee,W.isDayjs=K,W.unix=function(q){return W(1e3*q)},W.en=D[_],W.Ls=D,W.p={},W})})(Dx);var DD=Dx.exports;const Lx=Hd(DD);var Ud={exports:{}};/**
78
78
  * @license
79
79
  * Lodash <https://lodash.com/>
80
80
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
81
81
  * Released under MIT license <https://lodash.com/license>
82
82
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
83
83
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
84
- */Ud.exports,function(t,e){(function(){var n,r="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",g=1,w=2,y=4,x=1,v=2,b=1,E=2,T=4,N=8,P=16,_=32,D=64,H=128,K=256,ee=512,W=30,de="...",se=800,fe=16,q=1,Z=2,Y=3,oe=1/0,Q=9007199254740991,X=17976931348623157e292,$=NaN,te=4294967295,_e=te-1,ke=te>>>1,xe=[["ary",H],["bind",b],["bindKey",E],["curry",N],["curryRight",P],["flip",ee],["partial",_],["partialRight",D],["rearg",K]],Pe="[object Arguments]",Te="[object Array]",z="[object AsyncFunction]",ce="[object Boolean]",Ae="[object Date]",Ce="[object DOMException]",Ne="[object Error]",ne="[object Function]",Ve="[object GeneratorFunction]",Qe="[object Map]",Ct="[object Number]",Yt="[object Null]",bt="[object Object]",rn="[object Promise]",zt="[object Proxy]",Dn="[object RegExp]",Kt="[object Set]",L="[object String]",J="[object Symbol]",U="[object Undefined]",ae="[object WeakMap]",ye="[object WeakSet]",he="[object ArrayBuffer]",Ee="[object DataView]",Xe="[object Float32Array]",ft="[object Float64Array]",xt="[object Int8Array]",bo="[object Int16Array]",Jt="[object Int32Array]",vn="[object Uint8Array]",jr="[object Uint8ClampedArray]",Gt="[object Uint16Array]",hr="[object Uint32Array]",Wr=/\b__p \+= '';/g,oa=/\b(__p \+=) '' \+/g,Je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zo=/&(?:amp|lt|gt|quot|#39);/g,Nc=/[&<>"']/g,xo=RegExp(zo.source),ia=RegExp(Nc.source),aa=/<%-([\s\S]+?)%>/g,ss=/<%([\s\S]+?)%>/g,Lu=/<%=([\s\S]+?)%>/g,sa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cs=/^\w*$/,Fu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pc=/[\\^$.*+?()[\]{}|]/g,$u=RegExp(Pc.source),Oc=/^\s+/,Hu=/\s/,ls=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Uu=/\{\n\/\* \[wrapped with (.+)\] \*/,ca=/,? & /,Bu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ds=/[()=,{}\[\]\/\s]/,Fm=/\\(\\)?/g,Vo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Mc=/\w*$/,Rc=/^[-+]0x[0-9a-f]+$/i,$m=/^0b[01]+$/i,Pt=/^\[object .+?Constructor\]$/,Dc=/^0o[0-7]+$/i,x0=/^(?:0|[1-9]\d*)$/,Hm=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Lc=/($^)/,Fc=/['\n\r\u2028\u2029\\]/g,la="\\ud800-\\udfff",us="\\u0300-\\u036f",zu="\\ufe20-\\ufe2f",Vu="\\u20d0-\\u20ff",$c=us+zu+Vu,Hc="\\u2700-\\u27bf",da="a-z\\xdf-\\xf6\\xf8-\\xff",Uc="\\xac\\xb1\\xd7\\xf7",Um="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fs="\\u2000-\\u206f",hs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Bc="A-Z\\xc0-\\xd6\\xd8-\\xde",Ku="\\ufe0e\\ufe0f",Ko=Uc+Um+fs+hs,ps="['’]",zc="["+la+"]",Vc="["+Ko+"]",gs="["+$c+"]",ms="\\d+",Gu="["+Hc+"]",Kc="["+da+"]",ua="[^"+la+Ko+ms+Hc+da+Bc+"]",So="\\ud83c[\\udffb-\\udfff]",fa="(?:"+gs+"|"+So+")",Gc="[^"+la+"]",jc="(?:\\ud83c[\\udde6-\\uddff]){2}",gt="[\\ud800-\\udbff][\\udc00-\\udfff]",qr="["+Bc+"]",ju="\\u200d",vs="(?:"+Kc+"|"+ua+")",Bm="(?:"+qr+"|"+ua+")",ha="(?:"+ps+"(?:d|ll|m|re|s|t|ve))?",Go="(?:"+ps+"(?:D|LL|M|RE|S|T|VE))?",Wc=fa+"?",zm="["+Ku+"]?",S0="(?:"+ju+"(?:"+[Gc,jc,gt].join("|")+")"+zm+Wc+")*",Vm="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_0="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wu=zm+Wc+S0,En="(?:"+[Gu,jc,gt].join("|")+")"+Wu,ys="(?:"+[Gc+gs+"?",gs,jc,gt,zc].join("|")+")",Km=RegExp(ps,"g"),pa=RegExp(gs,"g"),an=RegExp(So+"(?="+So+")|"+ys+Wu,"g"),qc=RegExp([qr+"?"+Kc+"+"+ha+"(?="+[Vc,qr,"$"].join("|")+")",Bm+"+"+Go+"(?="+[Vc,qr+vs,"$"].join("|")+")",qr+"?"+vs+"+"+ha,qr+"+"+Go,_0,Vm,ms,En].join("|"),"g"),_o=RegExp("["+ju+la+$c+Ku+"]"),Yc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ht=-1,Ot={};Ot[Xe]=Ot[ft]=Ot[xt]=Ot[bo]=Ot[Jt]=Ot[vn]=Ot[jr]=Ot[Gt]=Ot[hr]=!0,Ot[Pe]=Ot[Te]=Ot[he]=Ot[ce]=Ot[Ee]=Ot[Ae]=Ot[Ne]=Ot[ne]=Ot[Qe]=Ot[Ct]=Ot[bt]=Ot[Dn]=Ot[Kt]=Ot[L]=Ot[ae]=!1;var It={};It[Pe]=It[Te]=It[he]=It[Ee]=It[ce]=It[Ae]=It[Xe]=It[ft]=It[xt]=It[bo]=It[Jt]=It[Qe]=It[Ct]=It[bt]=It[Dn]=It[Kt]=It[L]=It[J]=It[vn]=It[jr]=It[Gt]=It[hr]=!0,It[Ne]=It[ne]=It[ae]=!1;var qu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Gm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},jm={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ws={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wm=parseFloat,qm=parseInt,Yu=typeof fo=="object"&&fo&&fo.Object===Object&&fo,Ju=typeof self=="object"&&self&&self.Object===Object&&self,sn=Yu||Ju||Function("return this")(),Cs=e&&!e.nodeType&&e,Yr=Cs&&!0&&t&&!t.nodeType&&t,Qu=Yr&&Yr.exports===Cs,Qc=Qu&&Yu.process,Qn=function(){try{var V=Yr&&Yr.require&&Yr.require("util").types;return V||Qc&&Qc.binding&&Qc.binding("util")}catch{}}(),Xu=Qn&&Qn.isArrayBuffer,ga=Qn&&Qn.isDate,Zu=Qn&&Qn.isMap,ef=Qn&&Qn.isRegExp,Xc=Qn&&Qn.isSet,tf=Qn&&Qn.isTypedArray;function Ln(V,le,re){switch(re.length){case 0:return V.call(le);case 1:return V.call(le,re[0]);case 2:return V.call(le,re[0],re[1]);case 3:return V.call(le,re[0],re[1],re[2])}return V.apply(le,re)}function Ym(V,le,re,De){for(var Ze=-1,vt=V==null?0:V.length;++Ze<vt;){var cn=V[Ze];le(De,cn,re(cn),V)}return De}function Xn(V,le){for(var re=-1,De=V==null?0:V.length;++re<De&&le(V[re],re,V)!==!1;);return V}function nf(V,le){for(var re=V==null?0:V.length;re--&&le(V[re],re,V)!==!1;);return V}function Jr(V,le){for(var re=-1,De=V==null?0:V.length;++re<De;)if(!le(V[re],re,V))return!1;return!0}function Zn(V,le){for(var re=-1,De=V==null?0:V.length,Ze=0,vt=[];++re<De;){var cn=V[re];le(cn,re,V)&&(vt[Ze++]=cn)}return vt}function bs(V,le){var re=V==null?0:V.length;return!!re&&Ai(V,le,0)>-1}function Qr(V,le,re){for(var De=-1,Ze=V==null?0:V.length;++De<Ze;)if(re(le,V[De]))return!0;return!1}function Lt(V,le){for(var re=-1,De=V==null?0:V.length,Ze=Array(De);++re<De;)Ze[re]=le(V[re],re,V);return Ze}function Eo(V,le){for(var re=-1,De=le.length,Ze=V.length;++re<De;)V[Ze+re]=le[re];return V}function ma(V,le,re,De){var Ze=-1,vt=V==null?0:V.length;for(De&&vt&&(re=V[++Ze]);++Ze<vt;)re=le(re,V[Ze],Ze,V);return re}function Jm(V,le,re,De){var Ze=V==null?0:V.length;for(De&&Ze&&(re=V[--Ze]);Ze--;)re=le(re,V[Ze],Ze,V);return re}function xs(V,le){for(var re=-1,De=V==null?0:V.length;++re<De;)if(le(V[re],re,V))return!0;return!1}var Ss=el("length");function Qm(V){return V.split("")}function Xm(V){return V.match(Bu)||[]}function rf(V,le,re){var De;return re(V,function(Ze,vt,cn){if(le(Ze,vt,cn))return De=vt,!1}),De}function va(V,le,re,De){for(var Ze=V.length,vt=re+(De?1:-1);De?vt--:++vt<Ze;)if(le(V[vt],vt,V))return vt;return-1}function Ai(V,le,re){return le===le?Qt(V,le,re):va(V,_s,re)}function of(V,le,re,De){for(var Ze=re-1,vt=V.length;++Ze<vt;)if(De(V[Ze],le))return Ze;return-1}function _s(V){return V!==V}function Zc(V,le){var re=V==null?0:V.length;return re?Es(V,le)/re:$}function el(V){return function(le){return le==null?n:le[V]}}function tl(V){return function(le){return V==null?n:V[le]}}function nl(V,le,re,De,Ze){return Ze(V,function(vt,cn,Rt){re=De?(De=!1,vt):le(re,vt,cn,Rt)}),re}function Zm(V,le){var re=V.length;for(V.sort(le);re--;)V[re]=V[re].value;return V}function Es(V,le){for(var re,De=-1,Ze=V.length;++De<Ze;){var vt=le(V[De]);vt!==n&&(re=re===n?vt:re+vt)}return re}function rl(V,le){for(var re=-1,De=Array(V);++re<V;)De[re]=le(re);return De}function jo(V,le){return Lt(le,function(re){return[re,V[re]]})}function Xr(V){return V&&V.slice(0,E0(V)+1).replace(Oc,"")}function dn(V){return function(le){return V(le)}}function ol(V,le){return Lt(le,function(re){return V[re]})}function Ii(V,le){return V.has(le)}function A(V,le){for(var re=-1,De=V.length;++re<De&&Ai(le,V[re],0)>-1;);return re}function O(V,le){for(var re=V.length;re--&&Ai(le,V[re],0)>-1;);return re}function G(V,le){for(var re=V.length,De=0;re--;)V[re]===le&&++De;return De}var pe=tl(qu),be=tl(Gm);function Ie(V){return"\\"+ws[V]}function Me(V,le){return V==null?n:V[le]}function Mt(V){return _o.test(V)}function Zr(V){return Yc.test(V)}function ya(V){for(var le,re=[];!(le=V.next()).done;)re.push(le.value);return re}function Ts(V){var le=-1,re=Array(V.size);return V.forEach(function(De,Ze){re[++le]=[Ze,De]}),re}function il(V,le){return function(re){return V(le(re))}}function er(V,le){for(var re=-1,De=V.length,Ze=0,vt=[];++re<De;){var cn=V[re];(cn===le||cn===p)&&(V[re]=p,vt[Ze++]=re)}return vt}function Wo(V){var le=-1,re=Array(V.size);return V.forEach(function(De){re[++le]=De}),re}function qo(V){var le=-1,re=Array(V.size);return V.forEach(function(De){re[++le]=[De,De]}),re}function Qt(V,le,re){for(var De=re-1,Ze=V.length;++De<Ze;)if(V[De]===le)return De;return-1}function Tn(V,le,re){for(var De=re+1;De--;)if(V[De]===le)return De;return De}function Cr(V){return Mt(V)?G3(V):Ss(V)}function eo(V){return Mt(V)?j3(V):Qm(V)}function E0(V){for(var le=V.length;le--&&Hu.test(V.charAt(le)););return le}var K3=tl(jm);function G3(V){for(var le=an.lastIndex=0;an.test(V);)++le;return le}function j3(V){return V.match(an)||[]}function W3(V){return V.match(qc)||[]}var q3=function V(le){le=le==null?sn:As.defaults(sn.Object(),le,As.pick(sn,Jc));var re=le.Array,De=le.Date,Ze=le.Error,vt=le.Function,cn=le.Math,Rt=le.Object,ev=le.RegExp,Y3=le.String,br=le.TypeError,af=re.prototype,J3=vt.prototype,Is=Rt.prototype,sf=le["__core-js_shared__"],cf=J3.toString,Tt=Is.hasOwnProperty,Q3=0,T0=function(){var i=/[^.]+$/.exec(sf&&sf.keys&&sf.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),lf=Is.toString,X3=cf.call(Rt),Z3=sn._,e5=ev("^"+cf.call(Tt).replace(Pc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),df=Qu?le.Buffer:n,ki=le.Symbol,uf=le.Uint8Array,A0=df?df.allocUnsafe:n,ff=il(Rt.getPrototypeOf,Rt),I0=Rt.create,k0=Is.propertyIsEnumerable,hf=af.splice,N0=ki?ki.isConcatSpreadable:n,al=ki?ki.iterator:n,wa=ki?ki.toStringTag:n,pf=function(){try{var i=_a(Rt,"defineProperty");return i({},"",{}),i}catch{}}(),t5=le.clearTimeout!==sn.clearTimeout&&le.clearTimeout,n5=De&&De.now!==sn.Date.now&&De.now,r5=le.setTimeout!==sn.setTimeout&&le.setTimeout,gf=cn.ceil,mf=cn.floor,tv=Rt.getOwnPropertySymbols,o5=df?df.isBuffer:n,P0=le.isFinite,i5=af.join,a5=il(Rt.keys,Rt),ln=cn.max,An=cn.min,s5=De.now,c5=le.parseInt,O0=cn.random,l5=af.reverse,nv=_a(le,"DataView"),sl=_a(le,"Map"),rv=_a(le,"Promise"),ks=_a(le,"Set"),cl=_a(le,"WeakMap"),ll=_a(Rt,"create"),vf=cl&&new cl,Ns={},d5=Ea(nv),u5=Ea(sl),f5=Ea(rv),h5=Ea(ks),p5=Ea(cl),yf=ki?ki.prototype:n,dl=yf?yf.valueOf:n,M0=yf?yf.toString:n;function I(i){if(jt(i)&&!et(i)&&!(i instanceof ut)){if(i instanceof xr)return i;if(Tt.call(i,"__wrapped__"))return RA(i)}return new xr(i)}var Ps=function(){function i(){}return function(c){if(!Vt(c))return{};if(I0)return I0(c);i.prototype=c;var f=new i;return i.prototype=n,f}}();function wf(){}function xr(i,c){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}I.templateSettings={escape:aa,evaluate:ss,interpolate:Lu,variable:"",imports:{_:I}},I.prototype=wf.prototype,I.prototype.constructor=I,xr.prototype=Ps(wf.prototype),xr.prototype.constructor=xr;function ut(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=te,this.__views__=[]}function g5(){var i=new ut(this.__wrapped__);return i.__actions__=tr(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=tr(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=tr(this.__views__),i}function m5(){if(this.__filtered__){var i=new ut(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function v5(){var i=this.__wrapped__.value(),c=this.__dir__,f=et(i),m=c<0,S=f?i.length:0,k=k4(0,S,this.__views__),R=k.start,F=k.end,j=F-R,me=m?F:R-1,ve=this.__iteratees__,we=ve.length,Oe=0,$e=An(j,this.__takeCount__);if(!f||!m&&S==j&&$e==j)return rA(i,this.__actions__);var je=[];e:for(;j--&&Oe<$e;){me+=c;for(var at=-1,We=i[me];++at<we;){var dt=ve[at],ht=dt.iteratee,mr=dt.type,Hn=ht(We);if(mr==Z)We=Hn;else if(!Hn){if(mr==q)continue e;break e}}je[Oe++]=We}return je}ut.prototype=Ps(wf.prototype),ut.prototype.constructor=ut;function Ca(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function y5(){this.__data__=ll?ll(null):{},this.size=0}function w5(i){var c=this.has(i)&&delete this.__data__[i];return this.size-=c?1:0,c}function C5(i){var c=this.__data__;if(ll){var f=c[i];return f===u?n:f}return Tt.call(c,i)?c[i]:n}function b5(i){var c=this.__data__;return ll?c[i]!==n:Tt.call(c,i)}function x5(i,c){var f=this.__data__;return this.size+=this.has(i)?0:1,f[i]=ll&&c===n?u:c,this}Ca.prototype.clear=y5,Ca.prototype.delete=w5,Ca.prototype.get=C5,Ca.prototype.has=b5,Ca.prototype.set=x5;function Yo(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function S5(){this.__data__=[],this.size=0}function _5(i){var c=this.__data__,f=Cf(c,i);if(f<0)return!1;var m=c.length-1;return f==m?c.pop():hf.call(c,f,1),--this.size,!0}function E5(i){var c=this.__data__,f=Cf(c,i);return f<0?n:c[f][1]}function T5(i){return Cf(this.__data__,i)>-1}function A5(i,c){var f=this.__data__,m=Cf(f,i);return m<0?(++this.size,f.push([i,c])):f[m][1]=c,this}Yo.prototype.clear=S5,Yo.prototype.delete=_5,Yo.prototype.get=E5,Yo.prototype.has=T5,Yo.prototype.set=A5;function Jo(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function I5(){this.size=0,this.__data__={hash:new Ca,map:new(sl||Yo),string:new Ca}}function k5(i){var c=Of(this,i).delete(i);return this.size-=c?1:0,c}function N5(i){return Of(this,i).get(i)}function P5(i){return Of(this,i).has(i)}function O5(i,c){var f=Of(this,i),m=f.size;return f.set(i,c),this.size+=f.size==m?0:1,this}Jo.prototype.clear=I5,Jo.prototype.delete=k5,Jo.prototype.get=N5,Jo.prototype.has=P5,Jo.prototype.set=O5;function ba(i){var c=-1,f=i==null?0:i.length;for(this.__data__=new Jo;++c<f;)this.add(i[c])}function M5(i){return this.__data__.set(i,u),this}function R5(i){return this.__data__.has(i)}ba.prototype.add=ba.prototype.push=M5,ba.prototype.has=R5;function to(i){var c=this.__data__=new Yo(i);this.size=c.size}function D5(){this.__data__=new Yo,this.size=0}function L5(i){var c=this.__data__,f=c.delete(i);return this.size=c.size,f}function F5(i){return this.__data__.get(i)}function $5(i){return this.__data__.has(i)}function H5(i,c){var f=this.__data__;if(f instanceof Yo){var m=f.__data__;if(!sl||m.length<o-1)return m.push([i,c]),this.size=++f.size,this;f=this.__data__=new Jo(m)}return f.set(i,c),this.size=f.size,this}to.prototype.clear=D5,to.prototype.delete=L5,to.prototype.get=F5,to.prototype.has=$5,to.prototype.set=H5;function R0(i,c){var f=et(i),m=!f&&Ta(i),S=!f&&!m&&Ri(i),k=!f&&!m&&!S&&Ds(i),R=f||m||S||k,F=R?rl(i.length,Y3):[],j=F.length;for(var me in i)(c||Tt.call(i,me))&&!(R&&(me=="length"||S&&(me=="offset"||me=="parent")||k&&(me=="buffer"||me=="byteLength"||me=="byteOffset")||ei(me,j)))&&F.push(me);return F}function D0(i){var c=i.length;return c?i[pv(0,c-1)]:n}function U5(i,c){return Mf(tr(i),xa(c,0,i.length))}function B5(i){return Mf(tr(i))}function ov(i,c,f){(f!==n&&!no(i[c],f)||f===n&&!(c in i))&&Qo(i,c,f)}function ul(i,c,f){var m=i[c];(!(Tt.call(i,c)&&no(m,f))||f===n&&!(c in i))&&Qo(i,c,f)}function Cf(i,c){for(var f=i.length;f--;)if(no(i[f][0],c))return f;return-1}function z5(i,c,f,m){return Ni(i,function(S,k,R){c(m,S,f(S),R)}),m}function L0(i,c){return i&&Ao(c,un(c),i)}function V5(i,c){return i&&Ao(c,rr(c),i)}function Qo(i,c,f){c=="__proto__"&&pf?pf(i,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):i[c]=f}function iv(i,c){for(var f=-1,m=c.length,S=re(m),k=i==null;++f<m;)S[f]=k?n:Hv(i,c[f]);return S}function xa(i,c,f){return i===i&&(f!==n&&(i=i<=f?i:f),c!==n&&(i=i>=c?i:c)),i}function Sr(i,c,f,m,S,k){var R,F=c&g,j=c&w,me=c&y;if(f&&(R=S?f(i,m,S,k):f(i)),R!==n)return R;if(!Vt(i))return i;var ve=et(i);if(ve){if(R=P4(i),!F)return tr(i,R)}else{var we=In(i),Oe=we==ne||we==Ve;if(Ri(i))return aA(i,F);if(we==bt||we==Pe||Oe&&!S){if(R=j||Oe?{}:EA(i),!F)return j?C4(i,V5(R,i)):w4(i,L0(R,i))}else{if(!It[we])return S?i:{};R=O4(i,we,F)}}k||(k=new to);var $e=k.get(i);if($e)return $e;k.set(i,R),eI(i)?i.forEach(function(We){R.add(Sr(We,c,f,We,i,k))}):XA(i)&&i.forEach(function(We,dt){R.set(dt,Sr(We,c,f,dt,i,k))});var je=me?j?Ev:_v:j?rr:un,at=ve?n:je(i);return Xn(at||i,function(We,dt){at&&(dt=We,We=i[dt]),ul(R,dt,Sr(We,c,f,dt,i,k))}),R}function K5(i){var c=un(i);return function(f){return F0(f,i,c)}}function F0(i,c,f){var m=f.length;if(i==null)return!m;for(i=Rt(i);m--;){var S=f[m],k=c[S],R=i[S];if(R===n&&!(S in i)||!k(R))return!1}return!0}function $0(i,c,f){if(typeof i!="function")throw new br(s);return yl(function(){i.apply(n,f)},c)}function fl(i,c,f,m){var S=-1,k=bs,R=!0,F=i.length,j=[],me=c.length;if(!F)return j;f&&(c=Lt(c,dn(f))),m?(k=Qr,R=!1):c.length>=o&&(k=Ii,R=!1,c=new ba(c));e:for(;++S<F;){var ve=i[S],we=f==null?ve:f(ve);if(ve=m||ve!==0?ve:0,R&&we===we){for(var Oe=me;Oe--;)if(c[Oe]===we)continue e;j.push(ve)}else k(c,we,m)||j.push(ve)}return j}var Ni=uA(To),H0=uA(sv,!0);function G5(i,c){var f=!0;return Ni(i,function(m,S,k){return f=!!c(m,S,k),f}),f}function bf(i,c,f){for(var m=-1,S=i.length;++m<S;){var k=i[m],R=c(k);if(R!=null&&(F===n?R===R&&!gr(R):f(R,F)))var F=R,j=k}return j}function j5(i,c,f,m){var S=i.length;for(f=it(f),f<0&&(f=-f>S?0:S+f),m=m===n||m>S?S:it(m),m<0&&(m+=S),m=f>m?0:nI(m);f<m;)i[f++]=c;return i}function U0(i,c){var f=[];return Ni(i,function(m,S,k){c(m,S,k)&&f.push(m)}),f}function yn(i,c,f,m,S){var k=-1,R=i.length;for(f||(f=R4),S||(S=[]);++k<R;){var F=i[k];c>0&&f(F)?c>1?yn(F,c-1,f,m,S):Eo(S,F):m||(S[S.length]=F)}return S}var av=fA(),B0=fA(!0);function To(i,c){return i&&av(i,c,un)}function sv(i,c){return i&&B0(i,c,un)}function xf(i,c){return Zn(c,function(f){return ti(i[f])})}function Sa(i,c){c=Oi(c,i);for(var f=0,m=c.length;i!=null&&f<m;)i=i[Io(c[f++])];return f&&f==m?i:n}function z0(i,c,f){var m=c(i);return et(i)?m:Eo(m,f(i))}function Fn(i){return i==null?i===n?U:Yt:wa&&wa in Rt(i)?I4(i):B4(i)}function cv(i,c){return i>c}function W5(i,c){return i!=null&&Tt.call(i,c)}function q5(i,c){return i!=null&&c in Rt(i)}function Y5(i,c,f){return i>=An(c,f)&&i<ln(c,f)}function lv(i,c,f){for(var m=f?Qr:bs,S=i[0].length,k=i.length,R=k,F=re(k),j=1/0,me=[];R--;){var ve=i[R];R&&c&&(ve=Lt(ve,dn(c))),j=An(ve.length,j),F[R]=!f&&(c||S>=120&&ve.length>=120)?new ba(R&&ve):n}ve=i[0];var we=-1,Oe=F[0];e:for(;++we<S&&me.length<j;){var $e=ve[we],je=c?c($e):$e;if($e=f||$e!==0?$e:0,!(Oe?Ii(Oe,je):m(me,je,f))){for(R=k;--R;){var at=F[R];if(!(at?Ii(at,je):m(i[R],je,f)))continue e}Oe&&Oe.push(je),me.push($e)}}return me}function J5(i,c,f,m){return To(i,function(S,k,R){c(m,f(S),k,R)}),m}function hl(i,c,f){c=Oi(c,i),i=kA(i,c);var m=i==null?i:i[Io(Er(c))];return m==null?n:Ln(m,i,f)}function V0(i){return jt(i)&&Fn(i)==Pe}function Q5(i){return jt(i)&&Fn(i)==he}function X5(i){return jt(i)&&Fn(i)==Ae}function pl(i,c,f,m,S){return i===c?!0:i==null||c==null||!jt(i)&&!jt(c)?i!==i&&c!==c:Z5(i,c,f,m,pl,S)}function Z5(i,c,f,m,S,k){var R=et(i),F=et(c),j=R?Te:In(i),me=F?Te:In(c);j=j==Pe?bt:j,me=me==Pe?bt:me;var ve=j==bt,we=me==bt,Oe=j==me;if(Oe&&Ri(i)){if(!Ri(c))return!1;R=!0,ve=!1}if(Oe&&!ve)return k||(k=new to),R||Ds(i)?xA(i,c,f,m,S,k):T4(i,c,j,f,m,S,k);if(!(f&x)){var $e=ve&&Tt.call(i,"__wrapped__"),je=we&&Tt.call(c,"__wrapped__");if($e||je){var at=$e?i.value():i,We=je?c.value():c;return k||(k=new to),S(at,We,f,m,k)}}return Oe?(k||(k=new to),A4(i,c,f,m,S,k)):!1}function e4(i){return jt(i)&&In(i)==Qe}function dv(i,c,f,m){var S=f.length,k=S,R=!m;if(i==null)return!k;for(i=Rt(i);S--;){var F=f[S];if(R&&F[2]?F[1]!==i[F[0]]:!(F[0]in i))return!1}for(;++S<k;){F=f[S];var j=F[0],me=i[j],ve=F[1];if(R&&F[2]){if(me===n&&!(j in i))return!1}else{var we=new to;if(m)var Oe=m(me,ve,j,i,c,we);if(!(Oe===n?pl(ve,me,x|v,m,we):Oe))return!1}}return!0}function K0(i){if(!Vt(i)||L4(i))return!1;var c=ti(i)?e5:Pt;return c.test(Ea(i))}function t4(i){return jt(i)&&Fn(i)==Dn}function n4(i){return jt(i)&&In(i)==Kt}function r4(i){return jt(i)&&Hf(i.length)&&!!Ot[Fn(i)]}function G0(i){return typeof i=="function"?i:i==null?or:typeof i=="object"?et(i)?q0(i[0],i[1]):W0(i):hI(i)}function uv(i){if(!vl(i))return a5(i);var c=[];for(var f in Rt(i))Tt.call(i,f)&&f!="constructor"&&c.push(f);return c}function o4(i){if(!Vt(i))return U4(i);var c=vl(i),f=[];for(var m in i)m=="constructor"&&(c||!Tt.call(i,m))||f.push(m);return f}function fv(i,c){return i<c}function j0(i,c){var f=-1,m=nr(i)?re(i.length):[];return Ni(i,function(S,k,R){m[++f]=c(S,k,R)}),m}function W0(i){var c=Av(i);return c.length==1&&c[0][2]?AA(c[0][0],c[0][1]):function(f){return f===i||dv(f,i,c)}}function q0(i,c){return kv(i)&&TA(c)?AA(Io(i),c):function(f){var m=Hv(f,i);return m===n&&m===c?Uv(f,i):pl(c,m,x|v)}}function Sf(i,c,f,m,S){i!==c&&av(c,function(k,R){if(S||(S=new to),Vt(k))i4(i,c,R,f,Sf,m,S);else{var F=m?m(Pv(i,R),k,R+"",i,c,S):n;F===n&&(F=k),ov(i,R,F)}},rr)}function i4(i,c,f,m,S,k,R){var F=Pv(i,f),j=Pv(c,f),me=R.get(j);if(me){ov(i,f,me);return}var ve=k?k(F,j,f+"",i,c,R):n,we=ve===n;if(we){var Oe=et(j),$e=!Oe&&Ri(j),je=!Oe&&!$e&&Ds(j);ve=j,Oe||$e||je?et(F)?ve=F:Xt(F)?ve=tr(F):$e?(we=!1,ve=aA(j,!0)):je?(we=!1,ve=sA(j,!0)):ve=[]:wl(j)||Ta(j)?(ve=F,Ta(F)?ve=rI(F):(!Vt(F)||ti(F))&&(ve=EA(j))):we=!1}we&&(R.set(j,ve),S(ve,j,m,k,R),R.delete(j)),ov(i,f,ve)}function Y0(i,c){var f=i.length;if(f)return c+=c<0?f:0,ei(c,f)?i[c]:n}function J0(i,c,f){c.length?c=Lt(c,function(k){return et(k)?function(R){return Sa(R,k.length===1?k[0]:k)}:k}):c=[or];var m=-1;c=Lt(c,dn(Ke()));var S=j0(i,function(k,R,F){var j=Lt(c,function(me){return me(k)});return{criteria:j,index:++m,value:k}});return Zm(S,function(k,R){return y4(k,R,f)})}function a4(i,c){return Q0(i,c,function(f,m){return Uv(i,m)})}function Q0(i,c,f){for(var m=-1,S=c.length,k={};++m<S;){var R=c[m],F=Sa(i,R);f(F,R)&&gl(k,Oi(R,i),F)}return k}function s4(i){return function(c){return Sa(c,i)}}function hv(i,c,f,m){var S=m?of:Ai,k=-1,R=c.length,F=i;for(i===c&&(c=tr(c)),f&&(F=Lt(i,dn(f)));++k<R;)for(var j=0,me=c[k],ve=f?f(me):me;(j=S(F,ve,j,m))>-1;)F!==i&&hf.call(F,j,1),hf.call(i,j,1);return i}function X0(i,c){for(var f=i?c.length:0,m=f-1;f--;){var S=c[f];if(f==m||S!==k){var k=S;ei(S)?hf.call(i,S,1):vv(i,S)}}return i}function pv(i,c){return i+mf(O0()*(c-i+1))}function c4(i,c,f,m){for(var S=-1,k=ln(gf((c-i)/(f||1)),0),R=re(k);k--;)R[m?k:++S]=i,i+=f;return R}function gv(i,c){var f="";if(!i||c<1||c>Q)return f;do c%2&&(f+=i),c=mf(c/2),c&&(i+=i);while(c);return f}function ct(i,c){return Ov(IA(i,c,or),i+"")}function l4(i){return D0(Ls(i))}function d4(i,c){var f=Ls(i);return Mf(f,xa(c,0,f.length))}function gl(i,c,f,m){if(!Vt(i))return i;c=Oi(c,i);for(var S=-1,k=c.length,R=k-1,F=i;F!=null&&++S<k;){var j=Io(c[S]),me=f;if(j==="__proto__"||j==="constructor"||j==="prototype")return i;if(S!=R){var ve=F[j];me=m?m(ve,j,F):n,me===n&&(me=Vt(ve)?ve:ei(c[S+1])?[]:{})}ul(F,j,me),F=F[j]}return i}var Z0=vf?function(i,c){return vf.set(i,c),i}:or,u4=pf?function(i,c){return pf(i,"toString",{configurable:!0,enumerable:!1,value:zv(c),writable:!0})}:or;function f4(i){return Mf(Ls(i))}function _r(i,c,f){var m=-1,S=i.length;c<0&&(c=-c>S?0:S+c),f=f>S?S:f,f<0&&(f+=S),S=c>f?0:f-c>>>0,c>>>=0;for(var k=re(S);++m<S;)k[m]=i[m+c];return k}function h4(i,c){var f;return Ni(i,function(m,S,k){return f=c(m,S,k),!f}),!!f}function _f(i,c,f){var m=0,S=i==null?m:i.length;if(typeof c=="number"&&c===c&&S<=ke){for(;m<S;){var k=m+S>>>1,R=i[k];R!==null&&!gr(R)&&(f?R<=c:R<c)?m=k+1:S=k}return S}return mv(i,c,or,f)}function mv(i,c,f,m){var S=0,k=i==null?0:i.length;if(k===0)return 0;c=f(c);for(var R=c!==c,F=c===null,j=gr(c),me=c===n;S<k;){var ve=mf((S+k)/2),we=f(i[ve]),Oe=we!==n,$e=we===null,je=we===we,at=gr(we);if(R)var We=m||je;else me?We=je&&(m||Oe):F?We=je&&Oe&&(m||!$e):j?We=je&&Oe&&!$e&&(m||!at):$e||at?We=!1:We=m?we<=c:we<c;We?S=ve+1:k=ve}return An(k,_e)}function eA(i,c){for(var f=-1,m=i.length,S=0,k=[];++f<m;){var R=i[f],F=c?c(R):R;if(!f||!no(F,j)){var j=F;k[S++]=R===0?0:R}}return k}function tA(i){return typeof i=="number"?i:gr(i)?$:+i}function pr(i){if(typeof i=="string")return i;if(et(i))return Lt(i,pr)+"";if(gr(i))return M0?M0.call(i):"";var c=i+"";return c=="0"&&1/i==-1/0?"-0":c}function Pi(i,c,f){var m=-1,S=bs,k=i.length,R=!0,F=[],j=F;if(f)R=!1,S=Qr;else if(k>=o){var me=c?null:_4(i);if(me)return Wo(me);R=!1,S=Ii,j=new ba}else j=c?[]:F;e:for(;++m<k;){var ve=i[m],we=c?c(ve):ve;if(ve=f||ve!==0?ve:0,R&&we===we){for(var Oe=j.length;Oe--;)if(j[Oe]===we)continue e;c&&j.push(we),F.push(ve)}else S(j,we,f)||(j!==F&&j.push(we),F.push(ve))}return F}function vv(i,c){return c=Oi(c,i),i=kA(i,c),i==null||delete i[Io(Er(c))]}function nA(i,c,f,m){return gl(i,c,f(Sa(i,c)),m)}function Ef(i,c,f,m){for(var S=i.length,k=m?S:-1;(m?k--:++k<S)&&c(i[k],k,i););return f?_r(i,m?0:k,m?k+1:S):_r(i,m?k+1:0,m?S:k)}function rA(i,c){var f=i;return f instanceof ut&&(f=f.value()),ma(c,function(m,S){return S.func.apply(S.thisArg,Eo([m],S.args))},f)}function yv(i,c,f){var m=i.length;if(m<2)return m?Pi(i[0]):[];for(var S=-1,k=re(m);++S<m;)for(var R=i[S],F=-1;++F<m;)F!=S&&(k[S]=fl(k[S]||R,i[F],c,f));return Pi(yn(k,1),c,f)}function oA(i,c,f){for(var m=-1,S=i.length,k=c.length,R={};++m<S;){var F=m<k?c[m]:n;f(R,i[m],F)}return R}function wv(i){return Xt(i)?i:[]}function Cv(i){return typeof i=="function"?i:or}function Oi(i,c){return et(i)?i:kv(i,c)?[i]:MA(St(i))}var p4=ct;function Mi(i,c,f){var m=i.length;return f=f===n?m:f,!c&&f>=m?i:_r(i,c,f)}var iA=t5||function(i){return sn.clearTimeout(i)};function aA(i,c){if(c)return i.slice();var f=i.length,m=A0?A0(f):new i.constructor(f);return i.copy(m),m}function bv(i){var c=new i.constructor(i.byteLength);return new uf(c).set(new uf(i)),c}function g4(i,c){var f=c?bv(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.byteLength)}function m4(i){var c=new i.constructor(i.source,Mc.exec(i));return c.lastIndex=i.lastIndex,c}function v4(i){return dl?Rt(dl.call(i)):{}}function sA(i,c){var f=c?bv(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.length)}function cA(i,c){if(i!==c){var f=i!==n,m=i===null,S=i===i,k=gr(i),R=c!==n,F=c===null,j=c===c,me=gr(c);if(!F&&!me&&!k&&i>c||k&&R&&j&&!F&&!me||m&&R&&j||!f&&j||!S)return 1;if(!m&&!k&&!me&&i<c||me&&f&&S&&!m&&!k||F&&f&&S||!R&&S||!j)return-1}return 0}function y4(i,c,f){for(var m=-1,S=i.criteria,k=c.criteria,R=S.length,F=f.length;++m<R;){var j=cA(S[m],k[m]);if(j){if(m>=F)return j;var me=f[m];return j*(me=="desc"?-1:1)}}return i.index-c.index}function lA(i,c,f,m){for(var S=-1,k=i.length,R=f.length,F=-1,j=c.length,me=ln(k-R,0),ve=re(j+me),we=!m;++F<j;)ve[F]=c[F];for(;++S<R;)(we||S<k)&&(ve[f[S]]=i[S]);for(;me--;)ve[F++]=i[S++];return ve}function dA(i,c,f,m){for(var S=-1,k=i.length,R=-1,F=f.length,j=-1,me=c.length,ve=ln(k-F,0),we=re(ve+me),Oe=!m;++S<ve;)we[S]=i[S];for(var $e=S;++j<me;)we[$e+j]=c[j];for(;++R<F;)(Oe||S<k)&&(we[$e+f[R]]=i[S++]);return we}function tr(i,c){var f=-1,m=i.length;for(c||(c=re(m));++f<m;)c[f]=i[f];return c}function Ao(i,c,f,m){var S=!f;f||(f={});for(var k=-1,R=c.length;++k<R;){var F=c[k],j=m?m(f[F],i[F],F,f,i):n;j===n&&(j=i[F]),S?Qo(f,F,j):ul(f,F,j)}return f}function w4(i,c){return Ao(i,Iv(i),c)}function C4(i,c){return Ao(i,SA(i),c)}function Tf(i,c){return function(f,m){var S=et(f)?Ym:z5,k=c?c():{};return S(f,i,Ke(m,2),k)}}function Os(i){return ct(function(c,f){var m=-1,S=f.length,k=S>1?f[S-1]:n,R=S>2?f[2]:n;for(k=i.length>3&&typeof k=="function"?(S--,k):n,R&&$n(f[0],f[1],R)&&(k=S<3?n:k,S=1),c=Rt(c);++m<S;){var F=f[m];F&&i(c,F,m,k)}return c})}function uA(i,c){return function(f,m){if(f==null)return f;if(!nr(f))return i(f,m);for(var S=f.length,k=c?S:-1,R=Rt(f);(c?k--:++k<S)&&m(R[k],k,R)!==!1;);return f}}function fA(i){return function(c,f,m){for(var S=-1,k=Rt(c),R=m(c),F=R.length;F--;){var j=R[i?F:++S];if(f(k[j],j,k)===!1)break}return c}}function b4(i,c,f){var m=c&b,S=ml(i);function k(){var R=this&&this!==sn&&this instanceof k?S:i;return R.apply(m?f:this,arguments)}return k}function hA(i){return function(c){c=St(c);var f=Mt(c)?eo(c):n,m=f?f[0]:c.charAt(0),S=f?Mi(f,1).join(""):c.slice(1);return m[i]()+S}}function Ms(i){return function(c){return ma(uI(dI(c).replace(Km,"")),i,"")}}function ml(i){return function(){var c=arguments;switch(c.length){case 0:return new i;case 1:return new i(c[0]);case 2:return new i(c[0],c[1]);case 3:return new i(c[0],c[1],c[2]);case 4:return new i(c[0],c[1],c[2],c[3]);case 5:return new i(c[0],c[1],c[2],c[3],c[4]);case 6:return new i(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new i(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=Ps(i.prototype),m=i.apply(f,c);return Vt(m)?m:f}}function x4(i,c,f){var m=ml(i);function S(){for(var k=arguments.length,R=re(k),F=k,j=Rs(S);F--;)R[F]=arguments[F];var me=k<3&&R[0]!==j&&R[k-1]!==j?[]:er(R,j);if(k-=me.length,k<f)return yA(i,c,Af,S.placeholder,n,R,me,n,n,f-k);var ve=this&&this!==sn&&this instanceof S?m:i;return Ln(ve,this,R)}return S}function pA(i){return function(c,f,m){var S=Rt(c);if(!nr(c)){var k=Ke(f,3);c=un(c),f=function(F){return k(S[F],F,S)}}var R=i(c,f,m);return R>-1?S[k?c[R]:R]:n}}function gA(i){return Zo(function(c){var f=c.length,m=f,S=xr.prototype.thru;for(i&&c.reverse();m--;){var k=c[m];if(typeof k!="function")throw new br(s);if(S&&!R&&Pf(k)=="wrapper")var R=new xr([],!0)}for(m=R?m:f;++m<f;){k=c[m];var F=Pf(k),j=F=="wrapper"?Tv(k):n;j&&Nv(j[0])&&j[1]==(H|N|_|K)&&!j[4].length&&j[9]==1?R=R[Pf(j[0])].apply(R,j[3]):R=k.length==1&&Nv(k)?R[F]():R.thru(k)}return function(){var me=arguments,ve=me[0];if(R&&me.length==1&&et(ve))return R.plant(ve).value();for(var we=0,Oe=f?c[we].apply(this,me):ve;++we<f;)Oe=c[we].call(this,Oe);return Oe}})}function Af(i,c,f,m,S,k,R,F,j,me){var ve=c&H,we=c&b,Oe=c&E,$e=c&(N|P),je=c&ee,at=Oe?n:ml(i);function We(){for(var dt=arguments.length,ht=re(dt),mr=dt;mr--;)ht[mr]=arguments[mr];if($e)var Hn=Rs(We),vr=G(ht,Hn);if(m&&(ht=lA(ht,m,S,$e)),k&&(ht=dA(ht,k,R,$e)),dt-=vr,$e&&dt<me){var Zt=er(ht,Hn);return yA(i,c,Af,We.placeholder,f,ht,Zt,F,j,me-dt)}var ro=we?f:this,ri=Oe?ro[i]:i;return dt=ht.length,F?ht=z4(ht,F):je&&dt>1&&ht.reverse(),ve&&j<dt&&(ht.length=j),this&&this!==sn&&this instanceof We&&(ri=at||ml(ri)),ri.apply(ro,ht)}return We}function mA(i,c){return function(f,m){return J5(f,i,c(m),{})}}function If(i,c){return function(f,m){var S;if(f===n&&m===n)return c;if(f!==n&&(S=f),m!==n){if(S===n)return m;typeof f=="string"||typeof m=="string"?(f=pr(f),m=pr(m)):(f=tA(f),m=tA(m)),S=i(f,m)}return S}}function xv(i){return Zo(function(c){return c=Lt(c,dn(Ke())),ct(function(f){var m=this;return i(c,function(S){return Ln(S,m,f)})})})}function kf(i,c){c=c===n?" ":pr(c);var f=c.length;if(f<2)return f?gv(c,i):c;var m=gv(c,gf(i/Cr(c)));return Mt(c)?Mi(eo(m),0,i).join(""):m.slice(0,i)}function S4(i,c,f,m){var S=c&b,k=ml(i);function R(){for(var F=-1,j=arguments.length,me=-1,ve=m.length,we=re(ve+j),Oe=this&&this!==sn&&this instanceof R?k:i;++me<ve;)we[me]=m[me];for(;j--;)we[me++]=arguments[++F];return Ln(Oe,S?f:this,we)}return R}function vA(i){return function(c,f,m){return m&&typeof m!="number"&&$n(c,f,m)&&(f=m=n),c=ni(c),f===n?(f=c,c=0):f=ni(f),m=m===n?c<f?1:-1:ni(m),c4(c,f,m,i)}}function Nf(i){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=Tr(c),f=Tr(f)),i(c,f)}}function yA(i,c,f,m,S,k,R,F,j,me){var ve=c&N,we=ve?R:n,Oe=ve?n:R,$e=ve?k:n,je=ve?n:k;c|=ve?_:D,c&=~(ve?D:_),c&T||(c&=-4);var at=[i,c,S,$e,we,je,Oe,F,j,me],We=f.apply(n,at);return Nv(i)&&NA(We,at),We.placeholder=m,PA(We,i,c)}function Sv(i){var c=cn[i];return function(f,m){if(f=Tr(f),m=m==null?0:An(it(m),292),m&&P0(f)){var S=(St(f)+"e").split("e"),k=c(S[0]+"e"+(+S[1]+m));return S=(St(k)+"e").split("e"),+(S[0]+"e"+(+S[1]-m))}return c(f)}}var _4=ks&&1/Wo(new ks([,-0]))[1]==oe?function(i){return new ks(i)}:Gv;function wA(i){return function(c){var f=In(c);return f==Qe?Ts(c):f==Kt?qo(c):jo(c,i(c))}}function Xo(i,c,f,m,S,k,R,F){var j=c&E;if(!j&&typeof i!="function")throw new br(s);var me=m?m.length:0;if(me||(c&=-97,m=S=n),R=R===n?R:ln(it(R),0),F=F===n?F:it(F),me-=S?S.length:0,c&D){var ve=m,we=S;m=S=n}var Oe=j?n:Tv(i),$e=[i,c,f,m,S,ve,we,k,R,F];if(Oe&&H4($e,Oe),i=$e[0],c=$e[1],f=$e[2],m=$e[3],S=$e[4],F=$e[9]=$e[9]===n?j?0:i.length:ln($e[9]-me,0),!F&&c&(N|P)&&(c&=-25),!c||c==b)var je=b4(i,c,f);else c==N||c==P?je=x4(i,c,F):(c==_||c==(b|_))&&!S.length?je=S4(i,c,f,m):je=Af.apply(n,$e);var at=Oe?Z0:NA;return PA(at(je,$e),i,c)}function CA(i,c,f,m){return i===n||no(i,Is[f])&&!Tt.call(m,f)?c:i}function bA(i,c,f,m,S,k){return Vt(i)&&Vt(c)&&(k.set(c,i),Sf(i,c,n,bA,k),k.delete(c)),i}function E4(i){return wl(i)?n:i}function xA(i,c,f,m,S,k){var R=f&x,F=i.length,j=c.length;if(F!=j&&!(R&&j>F))return!1;var me=k.get(i),ve=k.get(c);if(me&&ve)return me==c&&ve==i;var we=-1,Oe=!0,$e=f&v?new ba:n;for(k.set(i,c),k.set(c,i);++we<F;){var je=i[we],at=c[we];if(m)var We=R?m(at,je,we,c,i,k):m(je,at,we,i,c,k);if(We!==n){if(We)continue;Oe=!1;break}if($e){if(!xs(c,function(dt,ht){if(!Ii($e,ht)&&(je===dt||S(je,dt,f,m,k)))return $e.push(ht)})){Oe=!1;break}}else if(!(je===at||S(je,at,f,m,k))){Oe=!1;break}}return k.delete(i),k.delete(c),Oe}function T4(i,c,f,m,S,k,R){switch(f){case Ee:if(i.byteLength!=c.byteLength||i.byteOffset!=c.byteOffset)return!1;i=i.buffer,c=c.buffer;case he:return!(i.byteLength!=c.byteLength||!k(new uf(i),new uf(c)));case ce:case Ae:case Ct:return no(+i,+c);case Ne:return i.name==c.name&&i.message==c.message;case Dn:case L:return i==c+"";case Qe:var F=Ts;case Kt:var j=m&x;if(F||(F=Wo),i.size!=c.size&&!j)return!1;var me=R.get(i);if(me)return me==c;m|=v,R.set(i,c);var ve=xA(F(i),F(c),m,S,k,R);return R.delete(i),ve;case J:if(dl)return dl.call(i)==dl.call(c)}return!1}function A4(i,c,f,m,S,k){var R=f&x,F=_v(i),j=F.length,me=_v(c),ve=me.length;if(j!=ve&&!R)return!1;for(var we=j;we--;){var Oe=F[we];if(!(R?Oe in c:Tt.call(c,Oe)))return!1}var $e=k.get(i),je=k.get(c);if($e&&je)return $e==c&&je==i;var at=!0;k.set(i,c),k.set(c,i);for(var We=R;++we<j;){Oe=F[we];var dt=i[Oe],ht=c[Oe];if(m)var mr=R?m(ht,dt,Oe,c,i,k):m(dt,ht,Oe,i,c,k);if(!(mr===n?dt===ht||S(dt,ht,f,m,k):mr)){at=!1;break}We||(We=Oe=="constructor")}if(at&&!We){var Hn=i.constructor,vr=c.constructor;Hn!=vr&&"constructor"in i&&"constructor"in c&&!(typeof Hn=="function"&&Hn instanceof Hn&&typeof vr=="function"&&vr instanceof vr)&&(at=!1)}return k.delete(i),k.delete(c),at}function Zo(i){return Ov(IA(i,n,FA),i+"")}function _v(i){return z0(i,un,Iv)}function Ev(i){return z0(i,rr,SA)}var Tv=vf?function(i){return vf.get(i)}:Gv;function Pf(i){for(var c=i.name+"",f=Ns[c],m=Tt.call(Ns,c)?f.length:0;m--;){var S=f[m],k=S.func;if(k==null||k==i)return S.name}return c}function Rs(i){var c=Tt.call(I,"placeholder")?I:i;return c.placeholder}function Ke(){var i=I.iteratee||Vv;return i=i===Vv?G0:i,arguments.length?i(arguments[0],arguments[1]):i}function Of(i,c){var f=i.__data__;return D4(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Av(i){for(var c=un(i),f=c.length;f--;){var m=c[f],S=i[m];c[f]=[m,S,TA(S)]}return c}function _a(i,c){var f=Me(i,c);return K0(f)?f:n}function I4(i){var c=Tt.call(i,wa),f=i[wa];try{i[wa]=n;var m=!0}catch{}var S=lf.call(i);return m&&(c?i[wa]=f:delete i[wa]),S}var Iv=tv?function(i){return i==null?[]:(i=Rt(i),Zn(tv(i),function(c){return k0.call(i,c)}))}:jv,SA=tv?function(i){for(var c=[];i;)Eo(c,Iv(i)),i=ff(i);return c}:jv,In=Fn;(nv&&In(new nv(new ArrayBuffer(1)))!=Ee||sl&&In(new sl)!=Qe||rv&&In(rv.resolve())!=rn||ks&&In(new ks)!=Kt||cl&&In(new cl)!=ae)&&(In=function(i){var c=Fn(i),f=c==bt?i.constructor:n,m=f?Ea(f):"";if(m)switch(m){case d5:return Ee;case u5:return Qe;case f5:return rn;case h5:return Kt;case p5:return ae}return c});function k4(i,c,f){for(var m=-1,S=f.length;++m<S;){var k=f[m],R=k.size;switch(k.type){case"drop":i+=R;break;case"dropRight":c-=R;break;case"take":c=An(c,i+R);break;case"takeRight":i=ln(i,c-R);break}}return{start:i,end:c}}function N4(i){var c=i.match(Uu);return c?c[1].split(ca):[]}function _A(i,c,f){c=Oi(c,i);for(var m=-1,S=c.length,k=!1;++m<S;){var R=Io(c[m]);if(!(k=i!=null&&f(i,R)))break;i=i[R]}return k||++m!=S?k:(S=i==null?0:i.length,!!S&&Hf(S)&&ei(R,S)&&(et(i)||Ta(i)))}function P4(i){var c=i.length,f=new i.constructor(c);return c&&typeof i[0]=="string"&&Tt.call(i,"index")&&(f.index=i.index,f.input=i.input),f}function EA(i){return typeof i.constructor=="function"&&!vl(i)?Ps(ff(i)):{}}function O4(i,c,f){var m=i.constructor;switch(c){case he:return bv(i);case ce:case Ae:return new m(+i);case Ee:return g4(i,f);case Xe:case ft:case xt:case bo:case Jt:case vn:case jr:case Gt:case hr:return sA(i,f);case Qe:return new m;case Ct:case L:return new m(i);case Dn:return m4(i);case Kt:return new m;case J:return v4(i)}}function M4(i,c){var f=c.length;if(!f)return i;var m=f-1;return c[m]=(f>1?"& ":"")+c[m],c=c.join(f>2?", ":" "),i.replace(ls,`{
84
+ */Ud.exports,function(t,e){(function(){var n,r="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",g=1,w=2,y=4,x=1,v=2,b=1,E=2,T=4,N=8,P=16,_=32,D=64,H=128,K=256,ee=512,W=30,de="...",se=800,he=16,q=1,Z=2,Y=3,oe=1/0,Q=9007199254740991,X=17976931348623157e292,$=NaN,te=4294967295,_e=te-1,ke=te>>>1,xe=[["ary",H],["bind",b],["bindKey",E],["curry",N],["curryRight",P],["flip",ee],["partial",_],["partialRight",D],["rearg",K]],Pe="[object Arguments]",Te="[object Array]",z="[object AsyncFunction]",ce="[object Boolean]",Ae="[object Date]",Ce="[object DOMException]",Ne="[object Error]",ne="[object Function]",Ve="[object GeneratorFunction]",Xe="[object Map]",Ct="[object Number]",Yt="[object Null]",bt="[object Object]",rn="[object Promise]",zt="[object Proxy]",Dn="[object RegExp]",Kt="[object Set]",L="[object String]",J="[object Symbol]",U="[object Undefined]",ae="[object WeakMap]",ye="[object WeakSet]",pe="[object ArrayBuffer]",Ee="[object DataView]",Qe="[object Float32Array]",ft="[object Float64Array]",xt="[object Int8Array]",bo="[object Int16Array]",Jt="[object Int32Array]",vn="[object Uint8Array]",jr="[object Uint8ClampedArray]",Gt="[object Uint16Array]",hr="[object Uint32Array]",Wr=/\b__p \+= '';/g,oa=/\b(__p \+=) '' \+/g,Je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zo=/&(?:amp|lt|gt|quot|#39);/g,Nc=/[&<>"']/g,xo=RegExp(zo.source),ia=RegExp(Nc.source),aa=/<%-([\s\S]+?)%>/g,ss=/<%([\s\S]+?)%>/g,Lu=/<%=([\s\S]+?)%>/g,sa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cs=/^\w*$/,Fu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pc=/[\\^$.*+?()[\]{}|]/g,$u=RegExp(Pc.source),Oc=/^\s+/,Hu=/\s/,ls=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Uu=/\{\n\/\* \[wrapped with (.+)\] \*/,ca=/,? & /,Bu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ds=/[()=,{}\[\]\/\s]/,Fm=/\\(\\)?/g,Vo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Mc=/\w*$/,Rc=/^[-+]0x[0-9a-f]+$/i,$m=/^0b[01]+$/i,Pt=/^\[object .+?Constructor\]$/,Dc=/^0o[0-7]+$/i,x0=/^(?:0|[1-9]\d*)$/,Hm=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Lc=/($^)/,Fc=/['\n\r\u2028\u2029\\]/g,la="\\ud800-\\udfff",us="\\u0300-\\u036f",zu="\\ufe20-\\ufe2f",Vu="\\u20d0-\\u20ff",$c=us+zu+Vu,Hc="\\u2700-\\u27bf",da="a-z\\xdf-\\xf6\\xf8-\\xff",Uc="\\xac\\xb1\\xd7\\xf7",Um="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fs="\\u2000-\\u206f",hs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Bc="A-Z\\xc0-\\xd6\\xd8-\\xde",Ku="\\ufe0e\\ufe0f",Ko=Uc+Um+fs+hs,ps="['’]",zc="["+la+"]",Vc="["+Ko+"]",gs="["+$c+"]",ms="\\d+",Gu="["+Hc+"]",Kc="["+da+"]",ua="[^"+la+Ko+ms+Hc+da+Bc+"]",So="\\ud83c[\\udffb-\\udfff]",fa="(?:"+gs+"|"+So+")",Gc="[^"+la+"]",jc="(?:\\ud83c[\\udde6-\\uddff]){2}",gt="[\\ud800-\\udbff][\\udc00-\\udfff]",qr="["+Bc+"]",ju="\\u200d",vs="(?:"+Kc+"|"+ua+")",Bm="(?:"+qr+"|"+ua+")",ha="(?:"+ps+"(?:d|ll|m|re|s|t|ve))?",Go="(?:"+ps+"(?:D|LL|M|RE|S|T|VE))?",Wc=fa+"?",zm="["+Ku+"]?",S0="(?:"+ju+"(?:"+[Gc,jc,gt].join("|")+")"+zm+Wc+")*",Vm="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_0="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wu=zm+Wc+S0,En="(?:"+[Gu,jc,gt].join("|")+")"+Wu,ys="(?:"+[Gc+gs+"?",gs,jc,gt,zc].join("|")+")",Km=RegExp(ps,"g"),pa=RegExp(gs,"g"),an=RegExp(So+"(?="+So+")|"+ys+Wu,"g"),qc=RegExp([qr+"?"+Kc+"+"+ha+"(?="+[Vc,qr,"$"].join("|")+")",Bm+"+"+Go+"(?="+[Vc,qr+vs,"$"].join("|")+")",qr+"?"+vs+"+"+ha,qr+"+"+Go,_0,Vm,ms,En].join("|"),"g"),_o=RegExp("["+ju+la+$c+Ku+"]"),Yc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ht=-1,Ot={};Ot[Qe]=Ot[ft]=Ot[xt]=Ot[bo]=Ot[Jt]=Ot[vn]=Ot[jr]=Ot[Gt]=Ot[hr]=!0,Ot[Pe]=Ot[Te]=Ot[pe]=Ot[ce]=Ot[Ee]=Ot[Ae]=Ot[Ne]=Ot[ne]=Ot[Xe]=Ot[Ct]=Ot[bt]=Ot[Dn]=Ot[Kt]=Ot[L]=Ot[ae]=!1;var It={};It[Pe]=It[Te]=It[pe]=It[Ee]=It[ce]=It[Ae]=It[Qe]=It[ft]=It[xt]=It[bo]=It[Jt]=It[Xe]=It[Ct]=It[bt]=It[Dn]=It[Kt]=It[L]=It[J]=It[vn]=It[jr]=It[Gt]=It[hr]=!0,It[Ne]=It[ne]=It[ae]=!1;var qu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Gm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},jm={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ws={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wm=parseFloat,qm=parseInt,Yu=typeof fo=="object"&&fo&&fo.Object===Object&&fo,Ju=typeof self=="object"&&self&&self.Object===Object&&self,sn=Yu||Ju||Function("return this")(),Cs=e&&!e.nodeType&&e,Yr=Cs&&!0&&t&&!t.nodeType&&t,Qu=Yr&&Yr.exports===Cs,Qc=Qu&&Yu.process,Qn=function(){try{var V=Yr&&Yr.require&&Yr.require("util").types;return V||Qc&&Qc.binding&&Qc.binding("util")}catch{}}(),Xu=Qn&&Qn.isArrayBuffer,ga=Qn&&Qn.isDate,Zu=Qn&&Qn.isMap,ef=Qn&&Qn.isRegExp,Xc=Qn&&Qn.isSet,tf=Qn&&Qn.isTypedArray;function Ln(V,le,re){switch(re.length){case 0:return V.call(le);case 1:return V.call(le,re[0]);case 2:return V.call(le,re[0],re[1]);case 3:return V.call(le,re[0],re[1],re[2])}return V.apply(le,re)}function Ym(V,le,re,De){for(var Ze=-1,vt=V==null?0:V.length;++Ze<vt;){var cn=V[Ze];le(De,cn,re(cn),V)}return De}function Xn(V,le){for(var re=-1,De=V==null?0:V.length;++re<De&&le(V[re],re,V)!==!1;);return V}function nf(V,le){for(var re=V==null?0:V.length;re--&&le(V[re],re,V)!==!1;);return V}function Jr(V,le){for(var re=-1,De=V==null?0:V.length;++re<De;)if(!le(V[re],re,V))return!1;return!0}function Zn(V,le){for(var re=-1,De=V==null?0:V.length,Ze=0,vt=[];++re<De;){var cn=V[re];le(cn,re,V)&&(vt[Ze++]=cn)}return vt}function bs(V,le){var re=V==null?0:V.length;return!!re&&Ai(V,le,0)>-1}function Qr(V,le,re){for(var De=-1,Ze=V==null?0:V.length;++De<Ze;)if(re(le,V[De]))return!0;return!1}function Lt(V,le){for(var re=-1,De=V==null?0:V.length,Ze=Array(De);++re<De;)Ze[re]=le(V[re],re,V);return Ze}function Eo(V,le){for(var re=-1,De=le.length,Ze=V.length;++re<De;)V[Ze+re]=le[re];return V}function ma(V,le,re,De){var Ze=-1,vt=V==null?0:V.length;for(De&&vt&&(re=V[++Ze]);++Ze<vt;)re=le(re,V[Ze],Ze,V);return re}function Jm(V,le,re,De){var Ze=V==null?0:V.length;for(De&&Ze&&(re=V[--Ze]);Ze--;)re=le(re,V[Ze],Ze,V);return re}function xs(V,le){for(var re=-1,De=V==null?0:V.length;++re<De;)if(le(V[re],re,V))return!0;return!1}var Ss=el("length");function Qm(V){return V.split("")}function Xm(V){return V.match(Bu)||[]}function rf(V,le,re){var De;return re(V,function(Ze,vt,cn){if(le(Ze,vt,cn))return De=vt,!1}),De}function va(V,le,re,De){for(var Ze=V.length,vt=re+(De?1:-1);De?vt--:++vt<Ze;)if(le(V[vt],vt,V))return vt;return-1}function Ai(V,le,re){return le===le?Qt(V,le,re):va(V,_s,re)}function of(V,le,re,De){for(var Ze=re-1,vt=V.length;++Ze<vt;)if(De(V[Ze],le))return Ze;return-1}function _s(V){return V!==V}function Zc(V,le){var re=V==null?0:V.length;return re?Es(V,le)/re:$}function el(V){return function(le){return le==null?n:le[V]}}function tl(V){return function(le){return V==null?n:V[le]}}function nl(V,le,re,De,Ze){return Ze(V,function(vt,cn,Rt){re=De?(De=!1,vt):le(re,vt,cn,Rt)}),re}function Zm(V,le){var re=V.length;for(V.sort(le);re--;)V[re]=V[re].value;return V}function Es(V,le){for(var re,De=-1,Ze=V.length;++De<Ze;){var vt=le(V[De]);vt!==n&&(re=re===n?vt:re+vt)}return re}function rl(V,le){for(var re=-1,De=Array(V);++re<V;)De[re]=le(re);return De}function jo(V,le){return Lt(le,function(re){return[re,V[re]]})}function Xr(V){return V&&V.slice(0,E0(V)+1).replace(Oc,"")}function dn(V){return function(le){return V(le)}}function ol(V,le){return Lt(le,function(re){return V[re]})}function Ii(V,le){return V.has(le)}function A(V,le){for(var re=-1,De=V.length;++re<De&&Ai(le,V[re],0)>-1;);return re}function O(V,le){for(var re=V.length;re--&&Ai(le,V[re],0)>-1;);return re}function G(V,le){for(var re=V.length,De=0;re--;)V[re]===le&&++De;return De}var fe=tl(qu),be=tl(Gm);function Ie(V){return"\\"+ws[V]}function Me(V,le){return V==null?n:V[le]}function Mt(V){return _o.test(V)}function Zr(V){return Yc.test(V)}function ya(V){for(var le,re=[];!(le=V.next()).done;)re.push(le.value);return re}function Ts(V){var le=-1,re=Array(V.size);return V.forEach(function(De,Ze){re[++le]=[Ze,De]}),re}function il(V,le){return function(re){return V(le(re))}}function er(V,le){for(var re=-1,De=V.length,Ze=0,vt=[];++re<De;){var cn=V[re];(cn===le||cn===p)&&(V[re]=p,vt[Ze++]=re)}return vt}function Wo(V){var le=-1,re=Array(V.size);return V.forEach(function(De){re[++le]=De}),re}function qo(V){var le=-1,re=Array(V.size);return V.forEach(function(De){re[++le]=[De,De]}),re}function Qt(V,le,re){for(var De=re-1,Ze=V.length;++De<Ze;)if(V[De]===le)return De;return-1}function Tn(V,le,re){for(var De=re+1;De--;)if(V[De]===le)return De;return De}function Cr(V){return Mt(V)?G3(V):Ss(V)}function eo(V){return Mt(V)?j3(V):Qm(V)}function E0(V){for(var le=V.length;le--&&Hu.test(V.charAt(le)););return le}var K3=tl(jm);function G3(V){for(var le=an.lastIndex=0;an.test(V);)++le;return le}function j3(V){return V.match(an)||[]}function W3(V){return V.match(qc)||[]}var q3=function V(le){le=le==null?sn:As.defaults(sn.Object(),le,As.pick(sn,Jc));var re=le.Array,De=le.Date,Ze=le.Error,vt=le.Function,cn=le.Math,Rt=le.Object,ev=le.RegExp,Y3=le.String,br=le.TypeError,af=re.prototype,J3=vt.prototype,Is=Rt.prototype,sf=le["__core-js_shared__"],cf=J3.toString,Tt=Is.hasOwnProperty,Q3=0,T0=function(){var i=/[^.]+$/.exec(sf&&sf.keys&&sf.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),lf=Is.toString,X3=cf.call(Rt),Z3=sn._,e5=ev("^"+cf.call(Tt).replace(Pc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),df=Qu?le.Buffer:n,ki=le.Symbol,uf=le.Uint8Array,A0=df?df.allocUnsafe:n,ff=il(Rt.getPrototypeOf,Rt),I0=Rt.create,k0=Is.propertyIsEnumerable,hf=af.splice,N0=ki?ki.isConcatSpreadable:n,al=ki?ki.iterator:n,wa=ki?ki.toStringTag:n,pf=function(){try{var i=_a(Rt,"defineProperty");return i({},"",{}),i}catch{}}(),t5=le.clearTimeout!==sn.clearTimeout&&le.clearTimeout,n5=De&&De.now!==sn.Date.now&&De.now,r5=le.setTimeout!==sn.setTimeout&&le.setTimeout,gf=cn.ceil,mf=cn.floor,tv=Rt.getOwnPropertySymbols,o5=df?df.isBuffer:n,P0=le.isFinite,i5=af.join,a5=il(Rt.keys,Rt),ln=cn.max,An=cn.min,s5=De.now,c5=le.parseInt,O0=cn.random,l5=af.reverse,nv=_a(le,"DataView"),sl=_a(le,"Map"),rv=_a(le,"Promise"),ks=_a(le,"Set"),cl=_a(le,"WeakMap"),ll=_a(Rt,"create"),vf=cl&&new cl,Ns={},d5=Ea(nv),u5=Ea(sl),f5=Ea(rv),h5=Ea(ks),p5=Ea(cl),yf=ki?ki.prototype:n,dl=yf?yf.valueOf:n,M0=yf?yf.toString:n;function I(i){if(jt(i)&&!et(i)&&!(i instanceof ut)){if(i instanceof xr)return i;if(Tt.call(i,"__wrapped__"))return RA(i)}return new xr(i)}var Ps=function(){function i(){}return function(c){if(!Vt(c))return{};if(I0)return I0(c);i.prototype=c;var f=new i;return i.prototype=n,f}}();function wf(){}function xr(i,c){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}I.templateSettings={escape:aa,evaluate:ss,interpolate:Lu,variable:"",imports:{_:I}},I.prototype=wf.prototype,I.prototype.constructor=I,xr.prototype=Ps(wf.prototype),xr.prototype.constructor=xr;function ut(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=te,this.__views__=[]}function g5(){var i=new ut(this.__wrapped__);return i.__actions__=tr(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=tr(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=tr(this.__views__),i}function m5(){if(this.__filtered__){var i=new ut(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function v5(){var i=this.__wrapped__.value(),c=this.__dir__,f=et(i),m=c<0,S=f?i.length:0,k=k4(0,S,this.__views__),R=k.start,F=k.end,j=F-R,me=m?F:R-1,ve=this.__iteratees__,we=ve.length,Oe=0,$e=An(j,this.__takeCount__);if(!f||!m&&S==j&&$e==j)return rA(i,this.__actions__);var je=[];e:for(;j--&&Oe<$e;){me+=c;for(var at=-1,We=i[me];++at<we;){var dt=ve[at],ht=dt.iteratee,mr=dt.type,Hn=ht(We);if(mr==Z)We=Hn;else if(!Hn){if(mr==q)continue e;break e}}je[Oe++]=We}return je}ut.prototype=Ps(wf.prototype),ut.prototype.constructor=ut;function Ca(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function y5(){this.__data__=ll?ll(null):{},this.size=0}function w5(i){var c=this.has(i)&&delete this.__data__[i];return this.size-=c?1:0,c}function C5(i){var c=this.__data__;if(ll){var f=c[i];return f===u?n:f}return Tt.call(c,i)?c[i]:n}function b5(i){var c=this.__data__;return ll?c[i]!==n:Tt.call(c,i)}function x5(i,c){var f=this.__data__;return this.size+=this.has(i)?0:1,f[i]=ll&&c===n?u:c,this}Ca.prototype.clear=y5,Ca.prototype.delete=w5,Ca.prototype.get=C5,Ca.prototype.has=b5,Ca.prototype.set=x5;function Yo(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function S5(){this.__data__=[],this.size=0}function _5(i){var c=this.__data__,f=Cf(c,i);if(f<0)return!1;var m=c.length-1;return f==m?c.pop():hf.call(c,f,1),--this.size,!0}function E5(i){var c=this.__data__,f=Cf(c,i);return f<0?n:c[f][1]}function T5(i){return Cf(this.__data__,i)>-1}function A5(i,c){var f=this.__data__,m=Cf(f,i);return m<0?(++this.size,f.push([i,c])):f[m][1]=c,this}Yo.prototype.clear=S5,Yo.prototype.delete=_5,Yo.prototype.get=E5,Yo.prototype.has=T5,Yo.prototype.set=A5;function Jo(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function I5(){this.size=0,this.__data__={hash:new Ca,map:new(sl||Yo),string:new Ca}}function k5(i){var c=Of(this,i).delete(i);return this.size-=c?1:0,c}function N5(i){return Of(this,i).get(i)}function P5(i){return Of(this,i).has(i)}function O5(i,c){var f=Of(this,i),m=f.size;return f.set(i,c),this.size+=f.size==m?0:1,this}Jo.prototype.clear=I5,Jo.prototype.delete=k5,Jo.prototype.get=N5,Jo.prototype.has=P5,Jo.prototype.set=O5;function ba(i){var c=-1,f=i==null?0:i.length;for(this.__data__=new Jo;++c<f;)this.add(i[c])}function M5(i){return this.__data__.set(i,u),this}function R5(i){return this.__data__.has(i)}ba.prototype.add=ba.prototype.push=M5,ba.prototype.has=R5;function to(i){var c=this.__data__=new Yo(i);this.size=c.size}function D5(){this.__data__=new Yo,this.size=0}function L5(i){var c=this.__data__,f=c.delete(i);return this.size=c.size,f}function F5(i){return this.__data__.get(i)}function $5(i){return this.__data__.has(i)}function H5(i,c){var f=this.__data__;if(f instanceof Yo){var m=f.__data__;if(!sl||m.length<o-1)return m.push([i,c]),this.size=++f.size,this;f=this.__data__=new Jo(m)}return f.set(i,c),this.size=f.size,this}to.prototype.clear=D5,to.prototype.delete=L5,to.prototype.get=F5,to.prototype.has=$5,to.prototype.set=H5;function R0(i,c){var f=et(i),m=!f&&Ta(i),S=!f&&!m&&Ri(i),k=!f&&!m&&!S&&Ds(i),R=f||m||S||k,F=R?rl(i.length,Y3):[],j=F.length;for(var me in i)(c||Tt.call(i,me))&&!(R&&(me=="length"||S&&(me=="offset"||me=="parent")||k&&(me=="buffer"||me=="byteLength"||me=="byteOffset")||ei(me,j)))&&F.push(me);return F}function D0(i){var c=i.length;return c?i[pv(0,c-1)]:n}function U5(i,c){return Mf(tr(i),xa(c,0,i.length))}function B5(i){return Mf(tr(i))}function ov(i,c,f){(f!==n&&!no(i[c],f)||f===n&&!(c in i))&&Qo(i,c,f)}function ul(i,c,f){var m=i[c];(!(Tt.call(i,c)&&no(m,f))||f===n&&!(c in i))&&Qo(i,c,f)}function Cf(i,c){for(var f=i.length;f--;)if(no(i[f][0],c))return f;return-1}function z5(i,c,f,m){return Ni(i,function(S,k,R){c(m,S,f(S),R)}),m}function L0(i,c){return i&&Ao(c,un(c),i)}function V5(i,c){return i&&Ao(c,rr(c),i)}function Qo(i,c,f){c=="__proto__"&&pf?pf(i,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):i[c]=f}function iv(i,c){for(var f=-1,m=c.length,S=re(m),k=i==null;++f<m;)S[f]=k?n:Hv(i,c[f]);return S}function xa(i,c,f){return i===i&&(f!==n&&(i=i<=f?i:f),c!==n&&(i=i>=c?i:c)),i}function Sr(i,c,f,m,S,k){var R,F=c&g,j=c&w,me=c&y;if(f&&(R=S?f(i,m,S,k):f(i)),R!==n)return R;if(!Vt(i))return i;var ve=et(i);if(ve){if(R=P4(i),!F)return tr(i,R)}else{var we=In(i),Oe=we==ne||we==Ve;if(Ri(i))return aA(i,F);if(we==bt||we==Pe||Oe&&!S){if(R=j||Oe?{}:EA(i),!F)return j?C4(i,V5(R,i)):w4(i,L0(R,i))}else{if(!It[we])return S?i:{};R=O4(i,we,F)}}k||(k=new to);var $e=k.get(i);if($e)return $e;k.set(i,R),eI(i)?i.forEach(function(We){R.add(Sr(We,c,f,We,i,k))}):XA(i)&&i.forEach(function(We,dt){R.set(dt,Sr(We,c,f,dt,i,k))});var je=me?j?Ev:_v:j?rr:un,at=ve?n:je(i);return Xn(at||i,function(We,dt){at&&(dt=We,We=i[dt]),ul(R,dt,Sr(We,c,f,dt,i,k))}),R}function K5(i){var c=un(i);return function(f){return F0(f,i,c)}}function F0(i,c,f){var m=f.length;if(i==null)return!m;for(i=Rt(i);m--;){var S=f[m],k=c[S],R=i[S];if(R===n&&!(S in i)||!k(R))return!1}return!0}function $0(i,c,f){if(typeof i!="function")throw new br(s);return yl(function(){i.apply(n,f)},c)}function fl(i,c,f,m){var S=-1,k=bs,R=!0,F=i.length,j=[],me=c.length;if(!F)return j;f&&(c=Lt(c,dn(f))),m?(k=Qr,R=!1):c.length>=o&&(k=Ii,R=!1,c=new ba(c));e:for(;++S<F;){var ve=i[S],we=f==null?ve:f(ve);if(ve=m||ve!==0?ve:0,R&&we===we){for(var Oe=me;Oe--;)if(c[Oe]===we)continue e;j.push(ve)}else k(c,we,m)||j.push(ve)}return j}var Ni=uA(To),H0=uA(sv,!0);function G5(i,c){var f=!0;return Ni(i,function(m,S,k){return f=!!c(m,S,k),f}),f}function bf(i,c,f){for(var m=-1,S=i.length;++m<S;){var k=i[m],R=c(k);if(R!=null&&(F===n?R===R&&!gr(R):f(R,F)))var F=R,j=k}return j}function j5(i,c,f,m){var S=i.length;for(f=it(f),f<0&&(f=-f>S?0:S+f),m=m===n||m>S?S:it(m),m<0&&(m+=S),m=f>m?0:nI(m);f<m;)i[f++]=c;return i}function U0(i,c){var f=[];return Ni(i,function(m,S,k){c(m,S,k)&&f.push(m)}),f}function yn(i,c,f,m,S){var k=-1,R=i.length;for(f||(f=R4),S||(S=[]);++k<R;){var F=i[k];c>0&&f(F)?c>1?yn(F,c-1,f,m,S):Eo(S,F):m||(S[S.length]=F)}return S}var av=fA(),B0=fA(!0);function To(i,c){return i&&av(i,c,un)}function sv(i,c){return i&&B0(i,c,un)}function xf(i,c){return Zn(c,function(f){return ti(i[f])})}function Sa(i,c){c=Oi(c,i);for(var f=0,m=c.length;i!=null&&f<m;)i=i[Io(c[f++])];return f&&f==m?i:n}function z0(i,c,f){var m=c(i);return et(i)?m:Eo(m,f(i))}function Fn(i){return i==null?i===n?U:Yt:wa&&wa in Rt(i)?I4(i):B4(i)}function cv(i,c){return i>c}function W5(i,c){return i!=null&&Tt.call(i,c)}function q5(i,c){return i!=null&&c in Rt(i)}function Y5(i,c,f){return i>=An(c,f)&&i<ln(c,f)}function lv(i,c,f){for(var m=f?Qr:bs,S=i[0].length,k=i.length,R=k,F=re(k),j=1/0,me=[];R--;){var ve=i[R];R&&c&&(ve=Lt(ve,dn(c))),j=An(ve.length,j),F[R]=!f&&(c||S>=120&&ve.length>=120)?new ba(R&&ve):n}ve=i[0];var we=-1,Oe=F[0];e:for(;++we<S&&me.length<j;){var $e=ve[we],je=c?c($e):$e;if($e=f||$e!==0?$e:0,!(Oe?Ii(Oe,je):m(me,je,f))){for(R=k;--R;){var at=F[R];if(!(at?Ii(at,je):m(i[R],je,f)))continue e}Oe&&Oe.push(je),me.push($e)}}return me}function J5(i,c,f,m){return To(i,function(S,k,R){c(m,f(S),k,R)}),m}function hl(i,c,f){c=Oi(c,i),i=kA(i,c);var m=i==null?i:i[Io(Er(c))];return m==null?n:Ln(m,i,f)}function V0(i){return jt(i)&&Fn(i)==Pe}function Q5(i){return jt(i)&&Fn(i)==pe}function X5(i){return jt(i)&&Fn(i)==Ae}function pl(i,c,f,m,S){return i===c?!0:i==null||c==null||!jt(i)&&!jt(c)?i!==i&&c!==c:Z5(i,c,f,m,pl,S)}function Z5(i,c,f,m,S,k){var R=et(i),F=et(c),j=R?Te:In(i),me=F?Te:In(c);j=j==Pe?bt:j,me=me==Pe?bt:me;var ve=j==bt,we=me==bt,Oe=j==me;if(Oe&&Ri(i)){if(!Ri(c))return!1;R=!0,ve=!1}if(Oe&&!ve)return k||(k=new to),R||Ds(i)?xA(i,c,f,m,S,k):T4(i,c,j,f,m,S,k);if(!(f&x)){var $e=ve&&Tt.call(i,"__wrapped__"),je=we&&Tt.call(c,"__wrapped__");if($e||je){var at=$e?i.value():i,We=je?c.value():c;return k||(k=new to),S(at,We,f,m,k)}}return Oe?(k||(k=new to),A4(i,c,f,m,S,k)):!1}function e4(i){return jt(i)&&In(i)==Xe}function dv(i,c,f,m){var S=f.length,k=S,R=!m;if(i==null)return!k;for(i=Rt(i);S--;){var F=f[S];if(R&&F[2]?F[1]!==i[F[0]]:!(F[0]in i))return!1}for(;++S<k;){F=f[S];var j=F[0],me=i[j],ve=F[1];if(R&&F[2]){if(me===n&&!(j in i))return!1}else{var we=new to;if(m)var Oe=m(me,ve,j,i,c,we);if(!(Oe===n?pl(ve,me,x|v,m,we):Oe))return!1}}return!0}function K0(i){if(!Vt(i)||L4(i))return!1;var c=ti(i)?e5:Pt;return c.test(Ea(i))}function t4(i){return jt(i)&&Fn(i)==Dn}function n4(i){return jt(i)&&In(i)==Kt}function r4(i){return jt(i)&&Hf(i.length)&&!!Ot[Fn(i)]}function G0(i){return typeof i=="function"?i:i==null?or:typeof i=="object"?et(i)?q0(i[0],i[1]):W0(i):hI(i)}function uv(i){if(!vl(i))return a5(i);var c=[];for(var f in Rt(i))Tt.call(i,f)&&f!="constructor"&&c.push(f);return c}function o4(i){if(!Vt(i))return U4(i);var c=vl(i),f=[];for(var m in i)m=="constructor"&&(c||!Tt.call(i,m))||f.push(m);return f}function fv(i,c){return i<c}function j0(i,c){var f=-1,m=nr(i)?re(i.length):[];return Ni(i,function(S,k,R){m[++f]=c(S,k,R)}),m}function W0(i){var c=Av(i);return c.length==1&&c[0][2]?AA(c[0][0],c[0][1]):function(f){return f===i||dv(f,i,c)}}function q0(i,c){return kv(i)&&TA(c)?AA(Io(i),c):function(f){var m=Hv(f,i);return m===n&&m===c?Uv(f,i):pl(c,m,x|v)}}function Sf(i,c,f,m,S){i!==c&&av(c,function(k,R){if(S||(S=new to),Vt(k))i4(i,c,R,f,Sf,m,S);else{var F=m?m(Pv(i,R),k,R+"",i,c,S):n;F===n&&(F=k),ov(i,R,F)}},rr)}function i4(i,c,f,m,S,k,R){var F=Pv(i,f),j=Pv(c,f),me=R.get(j);if(me){ov(i,f,me);return}var ve=k?k(F,j,f+"",i,c,R):n,we=ve===n;if(we){var Oe=et(j),$e=!Oe&&Ri(j),je=!Oe&&!$e&&Ds(j);ve=j,Oe||$e||je?et(F)?ve=F:Xt(F)?ve=tr(F):$e?(we=!1,ve=aA(j,!0)):je?(we=!1,ve=sA(j,!0)):ve=[]:wl(j)||Ta(j)?(ve=F,Ta(F)?ve=rI(F):(!Vt(F)||ti(F))&&(ve=EA(j))):we=!1}we&&(R.set(j,ve),S(ve,j,m,k,R),R.delete(j)),ov(i,f,ve)}function Y0(i,c){var f=i.length;if(f)return c+=c<0?f:0,ei(c,f)?i[c]:n}function J0(i,c,f){c.length?c=Lt(c,function(k){return et(k)?function(R){return Sa(R,k.length===1?k[0]:k)}:k}):c=[or];var m=-1;c=Lt(c,dn(Ke()));var S=j0(i,function(k,R,F){var j=Lt(c,function(me){return me(k)});return{criteria:j,index:++m,value:k}});return Zm(S,function(k,R){return y4(k,R,f)})}function a4(i,c){return Q0(i,c,function(f,m){return Uv(i,m)})}function Q0(i,c,f){for(var m=-1,S=c.length,k={};++m<S;){var R=c[m],F=Sa(i,R);f(F,R)&&gl(k,Oi(R,i),F)}return k}function s4(i){return function(c){return Sa(c,i)}}function hv(i,c,f,m){var S=m?of:Ai,k=-1,R=c.length,F=i;for(i===c&&(c=tr(c)),f&&(F=Lt(i,dn(f)));++k<R;)for(var j=0,me=c[k],ve=f?f(me):me;(j=S(F,ve,j,m))>-1;)F!==i&&hf.call(F,j,1),hf.call(i,j,1);return i}function X0(i,c){for(var f=i?c.length:0,m=f-1;f--;){var S=c[f];if(f==m||S!==k){var k=S;ei(S)?hf.call(i,S,1):vv(i,S)}}return i}function pv(i,c){return i+mf(O0()*(c-i+1))}function c4(i,c,f,m){for(var S=-1,k=ln(gf((c-i)/(f||1)),0),R=re(k);k--;)R[m?k:++S]=i,i+=f;return R}function gv(i,c){var f="";if(!i||c<1||c>Q)return f;do c%2&&(f+=i),c=mf(c/2),c&&(i+=i);while(c);return f}function ct(i,c){return Ov(IA(i,c,or),i+"")}function l4(i){return D0(Ls(i))}function d4(i,c){var f=Ls(i);return Mf(f,xa(c,0,f.length))}function gl(i,c,f,m){if(!Vt(i))return i;c=Oi(c,i);for(var S=-1,k=c.length,R=k-1,F=i;F!=null&&++S<k;){var j=Io(c[S]),me=f;if(j==="__proto__"||j==="constructor"||j==="prototype")return i;if(S!=R){var ve=F[j];me=m?m(ve,j,F):n,me===n&&(me=Vt(ve)?ve:ei(c[S+1])?[]:{})}ul(F,j,me),F=F[j]}return i}var Z0=vf?function(i,c){return vf.set(i,c),i}:or,u4=pf?function(i,c){return pf(i,"toString",{configurable:!0,enumerable:!1,value:zv(c),writable:!0})}:or;function f4(i){return Mf(Ls(i))}function _r(i,c,f){var m=-1,S=i.length;c<0&&(c=-c>S?0:S+c),f=f>S?S:f,f<0&&(f+=S),S=c>f?0:f-c>>>0,c>>>=0;for(var k=re(S);++m<S;)k[m]=i[m+c];return k}function h4(i,c){var f;return Ni(i,function(m,S,k){return f=c(m,S,k),!f}),!!f}function _f(i,c,f){var m=0,S=i==null?m:i.length;if(typeof c=="number"&&c===c&&S<=ke){for(;m<S;){var k=m+S>>>1,R=i[k];R!==null&&!gr(R)&&(f?R<=c:R<c)?m=k+1:S=k}return S}return mv(i,c,or,f)}function mv(i,c,f,m){var S=0,k=i==null?0:i.length;if(k===0)return 0;c=f(c);for(var R=c!==c,F=c===null,j=gr(c),me=c===n;S<k;){var ve=mf((S+k)/2),we=f(i[ve]),Oe=we!==n,$e=we===null,je=we===we,at=gr(we);if(R)var We=m||je;else me?We=je&&(m||Oe):F?We=je&&Oe&&(m||!$e):j?We=je&&Oe&&!$e&&(m||!at):$e||at?We=!1:We=m?we<=c:we<c;We?S=ve+1:k=ve}return An(k,_e)}function eA(i,c){for(var f=-1,m=i.length,S=0,k=[];++f<m;){var R=i[f],F=c?c(R):R;if(!f||!no(F,j)){var j=F;k[S++]=R===0?0:R}}return k}function tA(i){return typeof i=="number"?i:gr(i)?$:+i}function pr(i){if(typeof i=="string")return i;if(et(i))return Lt(i,pr)+"";if(gr(i))return M0?M0.call(i):"";var c=i+"";return c=="0"&&1/i==-1/0?"-0":c}function Pi(i,c,f){var m=-1,S=bs,k=i.length,R=!0,F=[],j=F;if(f)R=!1,S=Qr;else if(k>=o){var me=c?null:_4(i);if(me)return Wo(me);R=!1,S=Ii,j=new ba}else j=c?[]:F;e:for(;++m<k;){var ve=i[m],we=c?c(ve):ve;if(ve=f||ve!==0?ve:0,R&&we===we){for(var Oe=j.length;Oe--;)if(j[Oe]===we)continue e;c&&j.push(we),F.push(ve)}else S(j,we,f)||(j!==F&&j.push(we),F.push(ve))}return F}function vv(i,c){return c=Oi(c,i),i=kA(i,c),i==null||delete i[Io(Er(c))]}function nA(i,c,f,m){return gl(i,c,f(Sa(i,c)),m)}function Ef(i,c,f,m){for(var S=i.length,k=m?S:-1;(m?k--:++k<S)&&c(i[k],k,i););return f?_r(i,m?0:k,m?k+1:S):_r(i,m?k+1:0,m?S:k)}function rA(i,c){var f=i;return f instanceof ut&&(f=f.value()),ma(c,function(m,S){return S.func.apply(S.thisArg,Eo([m],S.args))},f)}function yv(i,c,f){var m=i.length;if(m<2)return m?Pi(i[0]):[];for(var S=-1,k=re(m);++S<m;)for(var R=i[S],F=-1;++F<m;)F!=S&&(k[S]=fl(k[S]||R,i[F],c,f));return Pi(yn(k,1),c,f)}function oA(i,c,f){for(var m=-1,S=i.length,k=c.length,R={};++m<S;){var F=m<k?c[m]:n;f(R,i[m],F)}return R}function wv(i){return Xt(i)?i:[]}function Cv(i){return typeof i=="function"?i:or}function Oi(i,c){return et(i)?i:kv(i,c)?[i]:MA(St(i))}var p4=ct;function Mi(i,c,f){var m=i.length;return f=f===n?m:f,!c&&f>=m?i:_r(i,c,f)}var iA=t5||function(i){return sn.clearTimeout(i)};function aA(i,c){if(c)return i.slice();var f=i.length,m=A0?A0(f):new i.constructor(f);return i.copy(m),m}function bv(i){var c=new i.constructor(i.byteLength);return new uf(c).set(new uf(i)),c}function g4(i,c){var f=c?bv(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.byteLength)}function m4(i){var c=new i.constructor(i.source,Mc.exec(i));return c.lastIndex=i.lastIndex,c}function v4(i){return dl?Rt(dl.call(i)):{}}function sA(i,c){var f=c?bv(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.length)}function cA(i,c){if(i!==c){var f=i!==n,m=i===null,S=i===i,k=gr(i),R=c!==n,F=c===null,j=c===c,me=gr(c);if(!F&&!me&&!k&&i>c||k&&R&&j&&!F&&!me||m&&R&&j||!f&&j||!S)return 1;if(!m&&!k&&!me&&i<c||me&&f&&S&&!m&&!k||F&&f&&S||!R&&S||!j)return-1}return 0}function y4(i,c,f){for(var m=-1,S=i.criteria,k=c.criteria,R=S.length,F=f.length;++m<R;){var j=cA(S[m],k[m]);if(j){if(m>=F)return j;var me=f[m];return j*(me=="desc"?-1:1)}}return i.index-c.index}function lA(i,c,f,m){for(var S=-1,k=i.length,R=f.length,F=-1,j=c.length,me=ln(k-R,0),ve=re(j+me),we=!m;++F<j;)ve[F]=c[F];for(;++S<R;)(we||S<k)&&(ve[f[S]]=i[S]);for(;me--;)ve[F++]=i[S++];return ve}function dA(i,c,f,m){for(var S=-1,k=i.length,R=-1,F=f.length,j=-1,me=c.length,ve=ln(k-F,0),we=re(ve+me),Oe=!m;++S<ve;)we[S]=i[S];for(var $e=S;++j<me;)we[$e+j]=c[j];for(;++R<F;)(Oe||S<k)&&(we[$e+f[R]]=i[S++]);return we}function tr(i,c){var f=-1,m=i.length;for(c||(c=re(m));++f<m;)c[f]=i[f];return c}function Ao(i,c,f,m){var S=!f;f||(f={});for(var k=-1,R=c.length;++k<R;){var F=c[k],j=m?m(f[F],i[F],F,f,i):n;j===n&&(j=i[F]),S?Qo(f,F,j):ul(f,F,j)}return f}function w4(i,c){return Ao(i,Iv(i),c)}function C4(i,c){return Ao(i,SA(i),c)}function Tf(i,c){return function(f,m){var S=et(f)?Ym:z5,k=c?c():{};return S(f,i,Ke(m,2),k)}}function Os(i){return ct(function(c,f){var m=-1,S=f.length,k=S>1?f[S-1]:n,R=S>2?f[2]:n;for(k=i.length>3&&typeof k=="function"?(S--,k):n,R&&$n(f[0],f[1],R)&&(k=S<3?n:k,S=1),c=Rt(c);++m<S;){var F=f[m];F&&i(c,F,m,k)}return c})}function uA(i,c){return function(f,m){if(f==null)return f;if(!nr(f))return i(f,m);for(var S=f.length,k=c?S:-1,R=Rt(f);(c?k--:++k<S)&&m(R[k],k,R)!==!1;);return f}}function fA(i){return function(c,f,m){for(var S=-1,k=Rt(c),R=m(c),F=R.length;F--;){var j=R[i?F:++S];if(f(k[j],j,k)===!1)break}return c}}function b4(i,c,f){var m=c&b,S=ml(i);function k(){var R=this&&this!==sn&&this instanceof k?S:i;return R.apply(m?f:this,arguments)}return k}function hA(i){return function(c){c=St(c);var f=Mt(c)?eo(c):n,m=f?f[0]:c.charAt(0),S=f?Mi(f,1).join(""):c.slice(1);return m[i]()+S}}function Ms(i){return function(c){return ma(uI(dI(c).replace(Km,"")),i,"")}}function ml(i){return function(){var c=arguments;switch(c.length){case 0:return new i;case 1:return new i(c[0]);case 2:return new i(c[0],c[1]);case 3:return new i(c[0],c[1],c[2]);case 4:return new i(c[0],c[1],c[2],c[3]);case 5:return new i(c[0],c[1],c[2],c[3],c[4]);case 6:return new i(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new i(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=Ps(i.prototype),m=i.apply(f,c);return Vt(m)?m:f}}function x4(i,c,f){var m=ml(i);function S(){for(var k=arguments.length,R=re(k),F=k,j=Rs(S);F--;)R[F]=arguments[F];var me=k<3&&R[0]!==j&&R[k-1]!==j?[]:er(R,j);if(k-=me.length,k<f)return yA(i,c,Af,S.placeholder,n,R,me,n,n,f-k);var ve=this&&this!==sn&&this instanceof S?m:i;return Ln(ve,this,R)}return S}function pA(i){return function(c,f,m){var S=Rt(c);if(!nr(c)){var k=Ke(f,3);c=un(c),f=function(F){return k(S[F],F,S)}}var R=i(c,f,m);return R>-1?S[k?c[R]:R]:n}}function gA(i){return Zo(function(c){var f=c.length,m=f,S=xr.prototype.thru;for(i&&c.reverse();m--;){var k=c[m];if(typeof k!="function")throw new br(s);if(S&&!R&&Pf(k)=="wrapper")var R=new xr([],!0)}for(m=R?m:f;++m<f;){k=c[m];var F=Pf(k),j=F=="wrapper"?Tv(k):n;j&&Nv(j[0])&&j[1]==(H|N|_|K)&&!j[4].length&&j[9]==1?R=R[Pf(j[0])].apply(R,j[3]):R=k.length==1&&Nv(k)?R[F]():R.thru(k)}return function(){var me=arguments,ve=me[0];if(R&&me.length==1&&et(ve))return R.plant(ve).value();for(var we=0,Oe=f?c[we].apply(this,me):ve;++we<f;)Oe=c[we].call(this,Oe);return Oe}})}function Af(i,c,f,m,S,k,R,F,j,me){var ve=c&H,we=c&b,Oe=c&E,$e=c&(N|P),je=c&ee,at=Oe?n:ml(i);function We(){for(var dt=arguments.length,ht=re(dt),mr=dt;mr--;)ht[mr]=arguments[mr];if($e)var Hn=Rs(We),vr=G(ht,Hn);if(m&&(ht=lA(ht,m,S,$e)),k&&(ht=dA(ht,k,R,$e)),dt-=vr,$e&&dt<me){var Zt=er(ht,Hn);return yA(i,c,Af,We.placeholder,f,ht,Zt,F,j,me-dt)}var ro=we?f:this,ri=Oe?ro[i]:i;return dt=ht.length,F?ht=z4(ht,F):je&&dt>1&&ht.reverse(),ve&&j<dt&&(ht.length=j),this&&this!==sn&&this instanceof We&&(ri=at||ml(ri)),ri.apply(ro,ht)}return We}function mA(i,c){return function(f,m){return J5(f,i,c(m),{})}}function If(i,c){return function(f,m){var S;if(f===n&&m===n)return c;if(f!==n&&(S=f),m!==n){if(S===n)return m;typeof f=="string"||typeof m=="string"?(f=pr(f),m=pr(m)):(f=tA(f),m=tA(m)),S=i(f,m)}return S}}function xv(i){return Zo(function(c){return c=Lt(c,dn(Ke())),ct(function(f){var m=this;return i(c,function(S){return Ln(S,m,f)})})})}function kf(i,c){c=c===n?" ":pr(c);var f=c.length;if(f<2)return f?gv(c,i):c;var m=gv(c,gf(i/Cr(c)));return Mt(c)?Mi(eo(m),0,i).join(""):m.slice(0,i)}function S4(i,c,f,m){var S=c&b,k=ml(i);function R(){for(var F=-1,j=arguments.length,me=-1,ve=m.length,we=re(ve+j),Oe=this&&this!==sn&&this instanceof R?k:i;++me<ve;)we[me]=m[me];for(;j--;)we[me++]=arguments[++F];return Ln(Oe,S?f:this,we)}return R}function vA(i){return function(c,f,m){return m&&typeof m!="number"&&$n(c,f,m)&&(f=m=n),c=ni(c),f===n?(f=c,c=0):f=ni(f),m=m===n?c<f?1:-1:ni(m),c4(c,f,m,i)}}function Nf(i){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=Tr(c),f=Tr(f)),i(c,f)}}function yA(i,c,f,m,S,k,R,F,j,me){var ve=c&N,we=ve?R:n,Oe=ve?n:R,$e=ve?k:n,je=ve?n:k;c|=ve?_:D,c&=~(ve?D:_),c&T||(c&=-4);var at=[i,c,S,$e,we,je,Oe,F,j,me],We=f.apply(n,at);return Nv(i)&&NA(We,at),We.placeholder=m,PA(We,i,c)}function Sv(i){var c=cn[i];return function(f,m){if(f=Tr(f),m=m==null?0:An(it(m),292),m&&P0(f)){var S=(St(f)+"e").split("e"),k=c(S[0]+"e"+(+S[1]+m));return S=(St(k)+"e").split("e"),+(S[0]+"e"+(+S[1]-m))}return c(f)}}var _4=ks&&1/Wo(new ks([,-0]))[1]==oe?function(i){return new ks(i)}:Gv;function wA(i){return function(c){var f=In(c);return f==Xe?Ts(c):f==Kt?qo(c):jo(c,i(c))}}function Xo(i,c,f,m,S,k,R,F){var j=c&E;if(!j&&typeof i!="function")throw new br(s);var me=m?m.length:0;if(me||(c&=-97,m=S=n),R=R===n?R:ln(it(R),0),F=F===n?F:it(F),me-=S?S.length:0,c&D){var ve=m,we=S;m=S=n}var Oe=j?n:Tv(i),$e=[i,c,f,m,S,ve,we,k,R,F];if(Oe&&H4($e,Oe),i=$e[0],c=$e[1],f=$e[2],m=$e[3],S=$e[4],F=$e[9]=$e[9]===n?j?0:i.length:ln($e[9]-me,0),!F&&c&(N|P)&&(c&=-25),!c||c==b)var je=b4(i,c,f);else c==N||c==P?je=x4(i,c,F):(c==_||c==(b|_))&&!S.length?je=S4(i,c,f,m):je=Af.apply(n,$e);var at=Oe?Z0:NA;return PA(at(je,$e),i,c)}function CA(i,c,f,m){return i===n||no(i,Is[f])&&!Tt.call(m,f)?c:i}function bA(i,c,f,m,S,k){return Vt(i)&&Vt(c)&&(k.set(c,i),Sf(i,c,n,bA,k),k.delete(c)),i}function E4(i){return wl(i)?n:i}function xA(i,c,f,m,S,k){var R=f&x,F=i.length,j=c.length;if(F!=j&&!(R&&j>F))return!1;var me=k.get(i),ve=k.get(c);if(me&&ve)return me==c&&ve==i;var we=-1,Oe=!0,$e=f&v?new ba:n;for(k.set(i,c),k.set(c,i);++we<F;){var je=i[we],at=c[we];if(m)var We=R?m(at,je,we,c,i,k):m(je,at,we,i,c,k);if(We!==n){if(We)continue;Oe=!1;break}if($e){if(!xs(c,function(dt,ht){if(!Ii($e,ht)&&(je===dt||S(je,dt,f,m,k)))return $e.push(ht)})){Oe=!1;break}}else if(!(je===at||S(je,at,f,m,k))){Oe=!1;break}}return k.delete(i),k.delete(c),Oe}function T4(i,c,f,m,S,k,R){switch(f){case Ee:if(i.byteLength!=c.byteLength||i.byteOffset!=c.byteOffset)return!1;i=i.buffer,c=c.buffer;case pe:return!(i.byteLength!=c.byteLength||!k(new uf(i),new uf(c)));case ce:case Ae:case Ct:return no(+i,+c);case Ne:return i.name==c.name&&i.message==c.message;case Dn:case L:return i==c+"";case Xe:var F=Ts;case Kt:var j=m&x;if(F||(F=Wo),i.size!=c.size&&!j)return!1;var me=R.get(i);if(me)return me==c;m|=v,R.set(i,c);var ve=xA(F(i),F(c),m,S,k,R);return R.delete(i),ve;case J:if(dl)return dl.call(i)==dl.call(c)}return!1}function A4(i,c,f,m,S,k){var R=f&x,F=_v(i),j=F.length,me=_v(c),ve=me.length;if(j!=ve&&!R)return!1;for(var we=j;we--;){var Oe=F[we];if(!(R?Oe in c:Tt.call(c,Oe)))return!1}var $e=k.get(i),je=k.get(c);if($e&&je)return $e==c&&je==i;var at=!0;k.set(i,c),k.set(c,i);for(var We=R;++we<j;){Oe=F[we];var dt=i[Oe],ht=c[Oe];if(m)var mr=R?m(ht,dt,Oe,c,i,k):m(dt,ht,Oe,i,c,k);if(!(mr===n?dt===ht||S(dt,ht,f,m,k):mr)){at=!1;break}We||(We=Oe=="constructor")}if(at&&!We){var Hn=i.constructor,vr=c.constructor;Hn!=vr&&"constructor"in i&&"constructor"in c&&!(typeof Hn=="function"&&Hn instanceof Hn&&typeof vr=="function"&&vr instanceof vr)&&(at=!1)}return k.delete(i),k.delete(c),at}function Zo(i){return Ov(IA(i,n,FA),i+"")}function _v(i){return z0(i,un,Iv)}function Ev(i){return z0(i,rr,SA)}var Tv=vf?function(i){return vf.get(i)}:Gv;function Pf(i){for(var c=i.name+"",f=Ns[c],m=Tt.call(Ns,c)?f.length:0;m--;){var S=f[m],k=S.func;if(k==null||k==i)return S.name}return c}function Rs(i){var c=Tt.call(I,"placeholder")?I:i;return c.placeholder}function Ke(){var i=I.iteratee||Vv;return i=i===Vv?G0:i,arguments.length?i(arguments[0],arguments[1]):i}function Of(i,c){var f=i.__data__;return D4(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Av(i){for(var c=un(i),f=c.length;f--;){var m=c[f],S=i[m];c[f]=[m,S,TA(S)]}return c}function _a(i,c){var f=Me(i,c);return K0(f)?f:n}function I4(i){var c=Tt.call(i,wa),f=i[wa];try{i[wa]=n;var m=!0}catch{}var S=lf.call(i);return m&&(c?i[wa]=f:delete i[wa]),S}var Iv=tv?function(i){return i==null?[]:(i=Rt(i),Zn(tv(i),function(c){return k0.call(i,c)}))}:jv,SA=tv?function(i){for(var c=[];i;)Eo(c,Iv(i)),i=ff(i);return c}:jv,In=Fn;(nv&&In(new nv(new ArrayBuffer(1)))!=Ee||sl&&In(new sl)!=Xe||rv&&In(rv.resolve())!=rn||ks&&In(new ks)!=Kt||cl&&In(new cl)!=ae)&&(In=function(i){var c=Fn(i),f=c==bt?i.constructor:n,m=f?Ea(f):"";if(m)switch(m){case d5:return Ee;case u5:return Xe;case f5:return rn;case h5:return Kt;case p5:return ae}return c});function k4(i,c,f){for(var m=-1,S=f.length;++m<S;){var k=f[m],R=k.size;switch(k.type){case"drop":i+=R;break;case"dropRight":c-=R;break;case"take":c=An(c,i+R);break;case"takeRight":i=ln(i,c-R);break}}return{start:i,end:c}}function N4(i){var c=i.match(Uu);return c?c[1].split(ca):[]}function _A(i,c,f){c=Oi(c,i);for(var m=-1,S=c.length,k=!1;++m<S;){var R=Io(c[m]);if(!(k=i!=null&&f(i,R)))break;i=i[R]}return k||++m!=S?k:(S=i==null?0:i.length,!!S&&Hf(S)&&ei(R,S)&&(et(i)||Ta(i)))}function P4(i){var c=i.length,f=new i.constructor(c);return c&&typeof i[0]=="string"&&Tt.call(i,"index")&&(f.index=i.index,f.input=i.input),f}function EA(i){return typeof i.constructor=="function"&&!vl(i)?Ps(ff(i)):{}}function O4(i,c,f){var m=i.constructor;switch(c){case pe:return bv(i);case ce:case Ae:return new m(+i);case Ee:return g4(i,f);case Qe:case ft:case xt:case bo:case Jt:case vn:case jr:case Gt:case hr:return sA(i,f);case Xe:return new m;case Ct:case L:return new m(i);case Dn:return m4(i);case Kt:return new m;case J:return v4(i)}}function M4(i,c){var f=c.length;if(!f)return i;var m=f-1;return c[m]=(f>1?"& ":"")+c[m],c=c.join(f>2?", ":" "),i.replace(ls,`{
85
85
  /* [wrapped with `+c+`] */
86
- `)}function R4(i){return et(i)||Ta(i)||!!(N0&&i&&i[N0])}function ei(i,c){var f=typeof i;return c=c??Q,!!c&&(f=="number"||f!="symbol"&&x0.test(i))&&i>-1&&i%1==0&&i<c}function $n(i,c,f){if(!Vt(f))return!1;var m=typeof c;return(m=="number"?nr(f)&&ei(c,f.length):m=="string"&&c in f)?no(f[c],i):!1}function kv(i,c){if(et(i))return!1;var f=typeof i;return f=="number"||f=="symbol"||f=="boolean"||i==null||gr(i)?!0:cs.test(i)||!sa.test(i)||c!=null&&i in Rt(c)}function D4(i){var c=typeof i;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?i!=="__proto__":i===null}function Nv(i){var c=Pf(i),f=I[c];if(typeof f!="function"||!(c in ut.prototype))return!1;if(i===f)return!0;var m=Tv(f);return!!m&&i===m[0]}function L4(i){return!!T0&&T0 in i}var F4=sf?ti:Wv;function vl(i){var c=i&&i.constructor,f=typeof c=="function"&&c.prototype||Is;return i===f}function TA(i){return i===i&&!Vt(i)}function AA(i,c){return function(f){return f==null?!1:f[i]===c&&(c!==n||i in Rt(f))}}function $4(i){var c=Ff(i,function(m){return f.size===h&&f.clear(),m}),f=c.cache;return c}function H4(i,c){var f=i[1],m=c[1],S=f|m,k=S<(b|E|H),R=m==H&&f==N||m==H&&f==K&&i[7].length<=c[8]||m==(H|K)&&c[7].length<=c[8]&&f==N;if(!(k||R))return i;m&b&&(i[2]=c[2],S|=f&b?0:T);var F=c[3];if(F){var j=i[3];i[3]=j?lA(j,F,c[4]):F,i[4]=j?er(i[3],p):c[4]}return F=c[5],F&&(j=i[5],i[5]=j?dA(j,F,c[6]):F,i[6]=j?er(i[5],p):c[6]),F=c[7],F&&(i[7]=F),m&H&&(i[8]=i[8]==null?c[8]:An(i[8],c[8])),i[9]==null&&(i[9]=c[9]),i[0]=c[0],i[1]=S,i}function U4(i){var c=[];if(i!=null)for(var f in Rt(i))c.push(f);return c}function B4(i){return lf.call(i)}function IA(i,c,f){return c=ln(c===n?i.length-1:c,0),function(){for(var m=arguments,S=-1,k=ln(m.length-c,0),R=re(k);++S<k;)R[S]=m[c+S];S=-1;for(var F=re(c+1);++S<c;)F[S]=m[S];return F[c]=f(R),Ln(i,this,F)}}function kA(i,c){return c.length<2?i:Sa(i,_r(c,0,-1))}function z4(i,c){for(var f=i.length,m=An(c.length,f),S=tr(i);m--;){var k=c[m];i[m]=ei(k,f)?S[k]:n}return i}function Pv(i,c){if(!(c==="constructor"&&typeof i[c]=="function")&&c!="__proto__")return i[c]}var NA=OA(Z0),yl=r5||function(i,c){return sn.setTimeout(i,c)},Ov=OA(u4);function PA(i,c,f){var m=c+"";return Ov(i,M4(m,V4(N4(m),f)))}function OA(i){var c=0,f=0;return function(){var m=s5(),S=fe-(m-f);if(f=m,S>0){if(++c>=se)return arguments[0]}else c=0;return i.apply(n,arguments)}}function Mf(i,c){var f=-1,m=i.length,S=m-1;for(c=c===n?m:c;++f<c;){var k=pv(f,S),R=i[k];i[k]=i[f],i[f]=R}return i.length=c,i}var MA=$4(function(i){var c=[];return i.charCodeAt(0)===46&&c.push(""),i.replace(Fu,function(f,m,S,k){c.push(S?k.replace(Fm,"$1"):m||f)}),c});function Io(i){if(typeof i=="string"||gr(i))return i;var c=i+"";return c=="0"&&1/i==-1/0?"-0":c}function Ea(i){if(i!=null){try{return cf.call(i)}catch{}try{return i+""}catch{}}return""}function V4(i,c){return Xn(xe,function(f){var m="_."+f[0];c&f[1]&&!bs(i,m)&&i.push(m)}),i.sort()}function RA(i){if(i instanceof ut)return i.clone();var c=new xr(i.__wrapped__,i.__chain__);return c.__actions__=tr(i.__actions__),c.__index__=i.__index__,c.__values__=i.__values__,c}function K4(i,c,f){(f?$n(i,c,f):c===n)?c=1:c=ln(it(c),0);var m=i==null?0:i.length;if(!m||c<1)return[];for(var S=0,k=0,R=re(gf(m/c));S<m;)R[k++]=_r(i,S,S+=c);return R}function G4(i){for(var c=-1,f=i==null?0:i.length,m=0,S=[];++c<f;){var k=i[c];k&&(S[m++]=k)}return S}function j4(){var i=arguments.length;if(!i)return[];for(var c=re(i-1),f=arguments[0],m=i;m--;)c[m-1]=arguments[m];return Eo(et(f)?tr(f):[f],yn(c,1))}var W4=ct(function(i,c){return Xt(i)?fl(i,yn(c,1,Xt,!0)):[]}),q4=ct(function(i,c){var f=Er(c);return Xt(f)&&(f=n),Xt(i)?fl(i,yn(c,1,Xt,!0),Ke(f,2)):[]}),Y4=ct(function(i,c){var f=Er(c);return Xt(f)&&(f=n),Xt(i)?fl(i,yn(c,1,Xt,!0),n,f):[]});function J4(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:it(c),_r(i,c<0?0:c,m)):[]}function Q4(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:it(c),c=m-c,_r(i,0,c<0?0:c)):[]}function X4(i,c){return i&&i.length?Ef(i,Ke(c,3),!0,!0):[]}function Z4(i,c){return i&&i.length?Ef(i,Ke(c,3),!0):[]}function ez(i,c,f,m){var S=i==null?0:i.length;return S?(f&&typeof f!="number"&&$n(i,c,f)&&(f=0,m=S),j5(i,c,f,m)):[]}function DA(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var S=f==null?0:it(f);return S<0&&(S=ln(m+S,0)),va(i,Ke(c,3),S)}function LA(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var S=m-1;return f!==n&&(S=it(f),S=f<0?ln(m+S,0):An(S,m-1)),va(i,Ke(c,3),S,!0)}function FA(i){var c=i==null?0:i.length;return c?yn(i,1):[]}function tz(i){var c=i==null?0:i.length;return c?yn(i,oe):[]}function nz(i,c){var f=i==null?0:i.length;return f?(c=c===n?1:it(c),yn(i,c)):[]}function rz(i){for(var c=-1,f=i==null?0:i.length,m={};++c<f;){var S=i[c];m[S[0]]=S[1]}return m}function $A(i){return i&&i.length?i[0]:n}function oz(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var S=f==null?0:it(f);return S<0&&(S=ln(m+S,0)),Ai(i,c,S)}function iz(i){var c=i==null?0:i.length;return c?_r(i,0,-1):[]}var az=ct(function(i){var c=Lt(i,wv);return c.length&&c[0]===i[0]?lv(c):[]}),sz=ct(function(i){var c=Er(i),f=Lt(i,wv);return c===Er(f)?c=n:f.pop(),f.length&&f[0]===i[0]?lv(f,Ke(c,2)):[]}),cz=ct(function(i){var c=Er(i),f=Lt(i,wv);return c=typeof c=="function"?c:n,c&&f.pop(),f.length&&f[0]===i[0]?lv(f,n,c):[]});function lz(i,c){return i==null?"":i5.call(i,c)}function Er(i){var c=i==null?0:i.length;return c?i[c-1]:n}function dz(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var S=m;return f!==n&&(S=it(f),S=S<0?ln(m+S,0):An(S,m-1)),c===c?Tn(i,c,S):va(i,_s,S,!0)}function uz(i,c){return i&&i.length?Y0(i,it(c)):n}var fz=ct(HA);function HA(i,c){return i&&i.length&&c&&c.length?hv(i,c):i}function hz(i,c,f){return i&&i.length&&c&&c.length?hv(i,c,Ke(f,2)):i}function pz(i,c,f){return i&&i.length&&c&&c.length?hv(i,c,n,f):i}var gz=Zo(function(i,c){var f=i==null?0:i.length,m=iv(i,c);return X0(i,Lt(c,function(S){return ei(S,f)?+S:S}).sort(cA)),m});function mz(i,c){var f=[];if(!(i&&i.length))return f;var m=-1,S=[],k=i.length;for(c=Ke(c,3);++m<k;){var R=i[m];c(R,m,i)&&(f.push(R),S.push(m))}return X0(i,S),f}function Mv(i){return i==null?i:l5.call(i)}function vz(i,c,f){var m=i==null?0:i.length;return m?(f&&typeof f!="number"&&$n(i,c,f)?(c=0,f=m):(c=c==null?0:it(c),f=f===n?m:it(f)),_r(i,c,f)):[]}function yz(i,c){return _f(i,c)}function wz(i,c,f){return mv(i,c,Ke(f,2))}function Cz(i,c){var f=i==null?0:i.length;if(f){var m=_f(i,c);if(m<f&&no(i[m],c))return m}return-1}function bz(i,c){return _f(i,c,!0)}function xz(i,c,f){return mv(i,c,Ke(f,2),!0)}function Sz(i,c){var f=i==null?0:i.length;if(f){var m=_f(i,c,!0)-1;if(no(i[m],c))return m}return-1}function _z(i){return i&&i.length?eA(i):[]}function Ez(i,c){return i&&i.length?eA(i,Ke(c,2)):[]}function Tz(i){var c=i==null?0:i.length;return c?_r(i,1,c):[]}function Az(i,c,f){return i&&i.length?(c=f||c===n?1:it(c),_r(i,0,c<0?0:c)):[]}function Iz(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:it(c),c=m-c,_r(i,c<0?0:c,m)):[]}function kz(i,c){return i&&i.length?Ef(i,Ke(c,3),!1,!0):[]}function Nz(i,c){return i&&i.length?Ef(i,Ke(c,3)):[]}var Pz=ct(function(i){return Pi(yn(i,1,Xt,!0))}),Oz=ct(function(i){var c=Er(i);return Xt(c)&&(c=n),Pi(yn(i,1,Xt,!0),Ke(c,2))}),Mz=ct(function(i){var c=Er(i);return c=typeof c=="function"?c:n,Pi(yn(i,1,Xt,!0),n,c)});function Rz(i){return i&&i.length?Pi(i):[]}function Dz(i,c){return i&&i.length?Pi(i,Ke(c,2)):[]}function Lz(i,c){return c=typeof c=="function"?c:n,i&&i.length?Pi(i,n,c):[]}function Rv(i){if(!(i&&i.length))return[];var c=0;return i=Zn(i,function(f){if(Xt(f))return c=ln(f.length,c),!0}),rl(c,function(f){return Lt(i,el(f))})}function UA(i,c){if(!(i&&i.length))return[];var f=Rv(i);return c==null?f:Lt(f,function(m){return Ln(c,n,m)})}var Fz=ct(function(i,c){return Xt(i)?fl(i,c):[]}),$z=ct(function(i){return yv(Zn(i,Xt))}),Hz=ct(function(i){var c=Er(i);return Xt(c)&&(c=n),yv(Zn(i,Xt),Ke(c,2))}),Uz=ct(function(i){var c=Er(i);return c=typeof c=="function"?c:n,yv(Zn(i,Xt),n,c)}),Bz=ct(Rv);function zz(i,c){return oA(i||[],c||[],ul)}function Vz(i,c){return oA(i||[],c||[],gl)}var Kz=ct(function(i){var c=i.length,f=c>1?i[c-1]:n;return f=typeof f=="function"?(i.pop(),f):n,UA(i,f)});function BA(i){var c=I(i);return c.__chain__=!0,c}function Gz(i,c){return c(i),i}function Rf(i,c){return c(i)}var jz=Zo(function(i){var c=i.length,f=c?i[0]:0,m=this.__wrapped__,S=function(k){return iv(k,i)};return c>1||this.__actions__.length||!(m instanceof ut)||!ei(f)?this.thru(S):(m=m.slice(f,+f+(c?1:0)),m.__actions__.push({func:Rf,args:[S],thisArg:n}),new xr(m,this.__chain__).thru(function(k){return c&&!k.length&&k.push(n),k}))});function Wz(){return BA(this)}function qz(){return new xr(this.value(),this.__chain__)}function Yz(){this.__values__===n&&(this.__values__=tI(this.value()));var i=this.__index__>=this.__values__.length,c=i?n:this.__values__[this.__index__++];return{done:i,value:c}}function Jz(){return this}function Qz(i){for(var c,f=this;f instanceof wf;){var m=RA(f);m.__index__=0,m.__values__=n,c?S.__wrapped__=m:c=m;var S=m;f=f.__wrapped__}return S.__wrapped__=i,c}function Xz(){var i=this.__wrapped__;if(i instanceof ut){var c=i;return this.__actions__.length&&(c=new ut(this)),c=c.reverse(),c.__actions__.push({func:Rf,args:[Mv],thisArg:n}),new xr(c,this.__chain__)}return this.thru(Mv)}function Zz(){return rA(this.__wrapped__,this.__actions__)}var eV=Tf(function(i,c,f){Tt.call(i,f)?++i[f]:Qo(i,f,1)});function tV(i,c,f){var m=et(i)?Jr:G5;return f&&$n(i,c,f)&&(c=n),m(i,Ke(c,3))}function nV(i,c){var f=et(i)?Zn:U0;return f(i,Ke(c,3))}var rV=pA(DA),oV=pA(LA);function iV(i,c){return yn(Df(i,c),1)}function aV(i,c){return yn(Df(i,c),oe)}function sV(i,c,f){return f=f===n?1:it(f),yn(Df(i,c),f)}function zA(i,c){var f=et(i)?Xn:Ni;return f(i,Ke(c,3))}function VA(i,c){var f=et(i)?nf:H0;return f(i,Ke(c,3))}var cV=Tf(function(i,c,f){Tt.call(i,f)?i[f].push(c):Qo(i,f,[c])});function lV(i,c,f,m){i=nr(i)?i:Ls(i),f=f&&!m?it(f):0;var S=i.length;return f<0&&(f=ln(S+f,0)),Uf(i)?f<=S&&i.indexOf(c,f)>-1:!!S&&Ai(i,c,f)>-1}var dV=ct(function(i,c,f){var m=-1,S=typeof c=="function",k=nr(i)?re(i.length):[];return Ni(i,function(R){k[++m]=S?Ln(c,R,f):hl(R,c,f)}),k}),uV=Tf(function(i,c,f){Qo(i,f,c)});function Df(i,c){var f=et(i)?Lt:j0;return f(i,Ke(c,3))}function fV(i,c,f,m){return i==null?[]:(et(c)||(c=c==null?[]:[c]),f=m?n:f,et(f)||(f=f==null?[]:[f]),J0(i,c,f))}var hV=Tf(function(i,c,f){i[f?0:1].push(c)},function(){return[[],[]]});function pV(i,c,f){var m=et(i)?ma:nl,S=arguments.length<3;return m(i,Ke(c,4),f,S,Ni)}function gV(i,c,f){var m=et(i)?Jm:nl,S=arguments.length<3;return m(i,Ke(c,4),f,S,H0)}function mV(i,c){var f=et(i)?Zn:U0;return f(i,$f(Ke(c,3)))}function vV(i){var c=et(i)?D0:l4;return c(i)}function yV(i,c,f){(f?$n(i,c,f):c===n)?c=1:c=it(c);var m=et(i)?U5:d4;return m(i,c)}function wV(i){var c=et(i)?B5:f4;return c(i)}function CV(i){if(i==null)return 0;if(nr(i))return Uf(i)?Cr(i):i.length;var c=In(i);return c==Qe||c==Kt?i.size:uv(i).length}function bV(i,c,f){var m=et(i)?xs:h4;return f&&$n(i,c,f)&&(c=n),m(i,Ke(c,3))}var xV=ct(function(i,c){if(i==null)return[];var f=c.length;return f>1&&$n(i,c[0],c[1])?c=[]:f>2&&$n(c[0],c[1],c[2])&&(c=[c[0]]),J0(i,yn(c,1),[])}),Lf=n5||function(){return sn.Date.now()};function SV(i,c){if(typeof c!="function")throw new br(s);return i=it(i),function(){if(--i<1)return c.apply(this,arguments)}}function KA(i,c,f){return c=f?n:c,c=i&&c==null?i.length:c,Xo(i,H,n,n,n,n,c)}function GA(i,c){var f;if(typeof c!="function")throw new br(s);return i=it(i),function(){return--i>0&&(f=c.apply(this,arguments)),i<=1&&(c=n),f}}var Dv=ct(function(i,c,f){var m=b;if(f.length){var S=er(f,Rs(Dv));m|=_}return Xo(i,m,c,f,S)}),jA=ct(function(i,c,f){var m=b|E;if(f.length){var S=er(f,Rs(jA));m|=_}return Xo(c,m,i,f,S)});function WA(i,c,f){c=f?n:c;var m=Xo(i,N,n,n,n,n,n,c);return m.placeholder=WA.placeholder,m}function qA(i,c,f){c=f?n:c;var m=Xo(i,P,n,n,n,n,n,c);return m.placeholder=qA.placeholder,m}function YA(i,c,f){var m,S,k,R,F,j,me=0,ve=!1,we=!1,Oe=!0;if(typeof i!="function")throw new br(s);c=Tr(c)||0,Vt(f)&&(ve=!!f.leading,we="maxWait"in f,k=we?ln(Tr(f.maxWait)||0,c):k,Oe="trailing"in f?!!f.trailing:Oe);function $e(Zt){var ro=m,ri=S;return m=S=n,me=Zt,R=i.apply(ri,ro),R}function je(Zt){return me=Zt,F=yl(dt,c),ve?$e(Zt):R}function at(Zt){var ro=Zt-j,ri=Zt-me,pI=c-ro;return we?An(pI,k-ri):pI}function We(Zt){var ro=Zt-j,ri=Zt-me;return j===n||ro>=c||ro<0||we&&ri>=k}function dt(){var Zt=Lf();if(We(Zt))return ht(Zt);F=yl(dt,at(Zt))}function ht(Zt){return F=n,Oe&&m?$e(Zt):(m=S=n,R)}function mr(){F!==n&&iA(F),me=0,m=j=S=F=n}function Hn(){return F===n?R:ht(Lf())}function vr(){var Zt=Lf(),ro=We(Zt);if(m=arguments,S=this,j=Zt,ro){if(F===n)return je(j);if(we)return iA(F),F=yl(dt,c),$e(j)}return F===n&&(F=yl(dt,c)),R}return vr.cancel=mr,vr.flush=Hn,vr}var _V=ct(function(i,c){return $0(i,1,c)}),EV=ct(function(i,c,f){return $0(i,Tr(c)||0,f)});function TV(i){return Xo(i,ee)}function Ff(i,c){if(typeof i!="function"||c!=null&&typeof c!="function")throw new br(s);var f=function(){var m=arguments,S=c?c.apply(this,m):m[0],k=f.cache;if(k.has(S))return k.get(S);var R=i.apply(this,m);return f.cache=k.set(S,R)||k,R};return f.cache=new(Ff.Cache||Jo),f}Ff.Cache=Jo;function $f(i){if(typeof i!="function")throw new br(s);return function(){var c=arguments;switch(c.length){case 0:return!i.call(this);case 1:return!i.call(this,c[0]);case 2:return!i.call(this,c[0],c[1]);case 3:return!i.call(this,c[0],c[1],c[2])}return!i.apply(this,c)}}function AV(i){return GA(2,i)}var IV=p4(function(i,c){c=c.length==1&&et(c[0])?Lt(c[0],dn(Ke())):Lt(yn(c,1),dn(Ke()));var f=c.length;return ct(function(m){for(var S=-1,k=An(m.length,f);++S<k;)m[S]=c[S].call(this,m[S]);return Ln(i,this,m)})}),Lv=ct(function(i,c){var f=er(c,Rs(Lv));return Xo(i,_,n,c,f)}),JA=ct(function(i,c){var f=er(c,Rs(JA));return Xo(i,D,n,c,f)}),kV=Zo(function(i,c){return Xo(i,K,n,n,n,c)});function NV(i,c){if(typeof i!="function")throw new br(s);return c=c===n?c:it(c),ct(i,c)}function PV(i,c){if(typeof i!="function")throw new br(s);return c=c==null?0:ln(it(c),0),ct(function(f){var m=f[c],S=Mi(f,0,c);return m&&Eo(S,m),Ln(i,this,S)})}function OV(i,c,f){var m=!0,S=!0;if(typeof i!="function")throw new br(s);return Vt(f)&&(m="leading"in f?!!f.leading:m,S="trailing"in f?!!f.trailing:S),YA(i,c,{leading:m,maxWait:c,trailing:S})}function MV(i){return KA(i,1)}function RV(i,c){return Lv(Cv(c),i)}function DV(){if(!arguments.length)return[];var i=arguments[0];return et(i)?i:[i]}function LV(i){return Sr(i,y)}function FV(i,c){return c=typeof c=="function"?c:n,Sr(i,y,c)}function $V(i){return Sr(i,g|y)}function HV(i,c){return c=typeof c=="function"?c:n,Sr(i,g|y,c)}function UV(i,c){return c==null||F0(i,c,un(c))}function no(i,c){return i===c||i!==i&&c!==c}var BV=Nf(cv),zV=Nf(function(i,c){return i>=c}),Ta=V0(function(){return arguments}())?V0:function(i){return jt(i)&&Tt.call(i,"callee")&&!k0.call(i,"callee")},et=re.isArray,VV=Xu?dn(Xu):Q5;function nr(i){return i!=null&&Hf(i.length)&&!ti(i)}function Xt(i){return jt(i)&&nr(i)}function KV(i){return i===!0||i===!1||jt(i)&&Fn(i)==ce}var Ri=o5||Wv,GV=ga?dn(ga):X5;function jV(i){return jt(i)&&i.nodeType===1&&!wl(i)}function WV(i){if(i==null)return!0;if(nr(i)&&(et(i)||typeof i=="string"||typeof i.splice=="function"||Ri(i)||Ds(i)||Ta(i)))return!i.length;var c=In(i);if(c==Qe||c==Kt)return!i.size;if(vl(i))return!uv(i).length;for(var f in i)if(Tt.call(i,f))return!1;return!0}function qV(i,c){return pl(i,c)}function YV(i,c,f){f=typeof f=="function"?f:n;var m=f?f(i,c):n;return m===n?pl(i,c,n,f):!!m}function Fv(i){if(!jt(i))return!1;var c=Fn(i);return c==Ne||c==Ce||typeof i.message=="string"&&typeof i.name=="string"&&!wl(i)}function JV(i){return typeof i=="number"&&P0(i)}function ti(i){if(!Vt(i))return!1;var c=Fn(i);return c==ne||c==Ve||c==z||c==zt}function QA(i){return typeof i=="number"&&i==it(i)}function Hf(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Q}function Vt(i){var c=typeof i;return i!=null&&(c=="object"||c=="function")}function jt(i){return i!=null&&typeof i=="object"}var XA=Zu?dn(Zu):e4;function QV(i,c){return i===c||dv(i,c,Av(c))}function XV(i,c,f){return f=typeof f=="function"?f:n,dv(i,c,Av(c),f)}function ZV(i){return ZA(i)&&i!=+i}function eK(i){if(F4(i))throw new Ze(a);return K0(i)}function tK(i){return i===null}function nK(i){return i==null}function ZA(i){return typeof i=="number"||jt(i)&&Fn(i)==Ct}function wl(i){if(!jt(i)||Fn(i)!=bt)return!1;var c=ff(i);if(c===null)return!0;var f=Tt.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&cf.call(f)==X3}var $v=ef?dn(ef):t4;function rK(i){return QA(i)&&i>=-9007199254740991&&i<=Q}var eI=Xc?dn(Xc):n4;function Uf(i){return typeof i=="string"||!et(i)&&jt(i)&&Fn(i)==L}function gr(i){return typeof i=="symbol"||jt(i)&&Fn(i)==J}var Ds=tf?dn(tf):r4;function oK(i){return i===n}function iK(i){return jt(i)&&In(i)==ae}function aK(i){return jt(i)&&Fn(i)==ye}var sK=Nf(fv),cK=Nf(function(i,c){return i<=c});function tI(i){if(!i)return[];if(nr(i))return Uf(i)?eo(i):tr(i);if(al&&i[al])return ya(i[al]());var c=In(i),f=c==Qe?Ts:c==Kt?Wo:Ls;return f(i)}function ni(i){if(!i)return i===0?i:0;if(i=Tr(i),i===oe||i===-1/0){var c=i<0?-1:1;return c*X}return i===i?i:0}function it(i){var c=ni(i),f=c%1;return c===c?f?c-f:c:0}function nI(i){return i?xa(it(i),0,te):0}function Tr(i){if(typeof i=="number")return i;if(gr(i))return $;if(Vt(i)){var c=typeof i.valueOf=="function"?i.valueOf():i;i=Vt(c)?c+"":c}if(typeof i!="string")return i===0?i:+i;i=Xr(i);var f=$m.test(i);return f||Dc.test(i)?qm(i.slice(2),f?2:8):Rc.test(i)?$:+i}function rI(i){return Ao(i,rr(i))}function lK(i){return i?xa(it(i),-9007199254740991,Q):i===0?i:0}function St(i){return i==null?"":pr(i)}var dK=Os(function(i,c){if(vl(c)||nr(c)){Ao(c,un(c),i);return}for(var f in c)Tt.call(c,f)&&ul(i,f,c[f])}),oI=Os(function(i,c){Ao(c,rr(c),i)}),Bf=Os(function(i,c,f,m){Ao(c,rr(c),i,m)}),uK=Os(function(i,c,f,m){Ao(c,un(c),i,m)}),fK=Zo(iv);function hK(i,c){var f=Ps(i);return c==null?f:L0(f,c)}var pK=ct(function(i,c){i=Rt(i);var f=-1,m=c.length,S=m>2?c[2]:n;for(S&&$n(c[0],c[1],S)&&(m=1);++f<m;)for(var k=c[f],R=rr(k),F=-1,j=R.length;++F<j;){var me=R[F],ve=i[me];(ve===n||no(ve,Is[me])&&!Tt.call(i,me))&&(i[me]=k[me])}return i}),gK=ct(function(i){return i.push(n,bA),Ln(iI,n,i)});function mK(i,c){return rf(i,Ke(c,3),To)}function vK(i,c){return rf(i,Ke(c,3),sv)}function yK(i,c){return i==null?i:av(i,Ke(c,3),rr)}function wK(i,c){return i==null?i:B0(i,Ke(c,3),rr)}function CK(i,c){return i&&To(i,Ke(c,3))}function bK(i,c){return i&&sv(i,Ke(c,3))}function xK(i){return i==null?[]:xf(i,un(i))}function SK(i){return i==null?[]:xf(i,rr(i))}function Hv(i,c,f){var m=i==null?n:Sa(i,c);return m===n?f:m}function _K(i,c){return i!=null&&_A(i,c,W5)}function Uv(i,c){return i!=null&&_A(i,c,q5)}var EK=mA(function(i,c,f){c!=null&&typeof c.toString!="function"&&(c=lf.call(c)),i[c]=f},zv(or)),TK=mA(function(i,c,f){c!=null&&typeof c.toString!="function"&&(c=lf.call(c)),Tt.call(i,c)?i[c].push(f):i[c]=[f]},Ke),AK=ct(hl);function un(i){return nr(i)?R0(i):uv(i)}function rr(i){return nr(i)?R0(i,!0):o4(i)}function IK(i,c){var f={};return c=Ke(c,3),To(i,function(m,S,k){Qo(f,c(m,S,k),m)}),f}function kK(i,c){var f={};return c=Ke(c,3),To(i,function(m,S,k){Qo(f,S,c(m,S,k))}),f}var NK=Os(function(i,c,f){Sf(i,c,f)}),iI=Os(function(i,c,f,m){Sf(i,c,f,m)}),PK=Zo(function(i,c){var f={};if(i==null)return f;var m=!1;c=Lt(c,function(k){return k=Oi(k,i),m||(m=k.length>1),k}),Ao(i,Ev(i),f),m&&(f=Sr(f,g|w|y,E4));for(var S=c.length;S--;)vv(f,c[S]);return f});function OK(i,c){return aI(i,$f(Ke(c)))}var MK=Zo(function(i,c){return i==null?{}:a4(i,c)});function aI(i,c){if(i==null)return{};var f=Lt(Ev(i),function(m){return[m]});return c=Ke(c),Q0(i,f,function(m,S){return c(m,S[0])})}function RK(i,c,f){c=Oi(c,i);var m=-1,S=c.length;for(S||(S=1,i=n);++m<S;){var k=i==null?n:i[Io(c[m])];k===n&&(m=S,k=f),i=ti(k)?k.call(i):k}return i}function DK(i,c,f){return i==null?i:gl(i,c,f)}function LK(i,c,f,m){return m=typeof m=="function"?m:n,i==null?i:gl(i,c,f,m)}var sI=wA(un),cI=wA(rr);function FK(i,c,f){var m=et(i),S=m||Ri(i)||Ds(i);if(c=Ke(c,4),f==null){var k=i&&i.constructor;S?f=m?new k:[]:Vt(i)?f=ti(k)?Ps(ff(i)):{}:f={}}return(S?Xn:To)(i,function(R,F,j){return c(f,R,F,j)}),f}function $K(i,c){return i==null?!0:vv(i,c)}function HK(i,c,f){return i==null?i:nA(i,c,Cv(f))}function UK(i,c,f,m){return m=typeof m=="function"?m:n,i==null?i:nA(i,c,Cv(f),m)}function Ls(i){return i==null?[]:ol(i,un(i))}function BK(i){return i==null?[]:ol(i,rr(i))}function zK(i,c,f){return f===n&&(f=c,c=n),f!==n&&(f=Tr(f),f=f===f?f:0),c!==n&&(c=Tr(c),c=c===c?c:0),xa(Tr(i),c,f)}function VK(i,c,f){return c=ni(c),f===n?(f=c,c=0):f=ni(f),i=Tr(i),Y5(i,c,f)}function KK(i,c,f){if(f&&typeof f!="boolean"&&$n(i,c,f)&&(c=f=n),f===n&&(typeof c=="boolean"?(f=c,c=n):typeof i=="boolean"&&(f=i,i=n)),i===n&&c===n?(i=0,c=1):(i=ni(i),c===n?(c=i,i=0):c=ni(c)),i>c){var m=i;i=c,c=m}if(f||i%1||c%1){var S=O0();return An(i+S*(c-i+Wm("1e-"+((S+"").length-1))),c)}return pv(i,c)}var GK=Ms(function(i,c,f){return c=c.toLowerCase(),i+(f?lI(c):c)});function lI(i){return Bv(St(i).toLowerCase())}function dI(i){return i=St(i),i&&i.replace(Hm,pe).replace(pa,"")}function jK(i,c,f){i=St(i),c=pr(c);var m=i.length;f=f===n?m:xa(it(f),0,m);var S=f;return f-=c.length,f>=0&&i.slice(f,S)==c}function WK(i){return i=St(i),i&&ia.test(i)?i.replace(Nc,be):i}function qK(i){return i=St(i),i&&$u.test(i)?i.replace(Pc,"\\$&"):i}var YK=Ms(function(i,c,f){return i+(f?"-":"")+c.toLowerCase()}),JK=Ms(function(i,c,f){return i+(f?" ":"")+c.toLowerCase()}),QK=hA("toLowerCase");function XK(i,c,f){i=St(i),c=it(c);var m=c?Cr(i):0;if(!c||m>=c)return i;var S=(c-m)/2;return kf(mf(S),f)+i+kf(gf(S),f)}function ZK(i,c,f){i=St(i),c=it(c);var m=c?Cr(i):0;return c&&m<c?i+kf(c-m,f):i}function eG(i,c,f){i=St(i),c=it(c);var m=c?Cr(i):0;return c&&m<c?kf(c-m,f)+i:i}function tG(i,c,f){return f||c==null?c=0:c&&(c=+c),c5(St(i).replace(Oc,""),c||0)}function nG(i,c,f){return(f?$n(i,c,f):c===n)?c=1:c=it(c),gv(St(i),c)}function rG(){var i=arguments,c=St(i[0]);return i.length<3?c:c.replace(i[1],i[2])}var oG=Ms(function(i,c,f){return i+(f?"_":"")+c.toLowerCase()});function iG(i,c,f){return f&&typeof f!="number"&&$n(i,c,f)&&(c=f=n),f=f===n?te:f>>>0,f?(i=St(i),i&&(typeof c=="string"||c!=null&&!$v(c))&&(c=pr(c),!c&&Mt(i))?Mi(eo(i),0,f):i.split(c,f)):[]}var aG=Ms(function(i,c,f){return i+(f?" ":"")+Bv(c)});function sG(i,c,f){return i=St(i),f=f==null?0:xa(it(f),0,i.length),c=pr(c),i.slice(f,f+c.length)==c}function cG(i,c,f){var m=I.templateSettings;f&&$n(i,c,f)&&(c=n),i=St(i),c=Bf({},c,m,CA);var S=Bf({},c.imports,m.imports,CA),k=un(S),R=ol(S,k),F,j,me=0,ve=c.interpolate||Lc,we="__p += '",Oe=ev((c.escape||Lc).source+"|"+ve.source+"|"+(ve===Lu?Vo:Lc).source+"|"+(c.evaluate||Lc).source+"|$","g"),$e="//# sourceURL="+(Tt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ht+"]")+`
86
+ `)}function R4(i){return et(i)||Ta(i)||!!(N0&&i&&i[N0])}function ei(i,c){var f=typeof i;return c=c??Q,!!c&&(f=="number"||f!="symbol"&&x0.test(i))&&i>-1&&i%1==0&&i<c}function $n(i,c,f){if(!Vt(f))return!1;var m=typeof c;return(m=="number"?nr(f)&&ei(c,f.length):m=="string"&&c in f)?no(f[c],i):!1}function kv(i,c){if(et(i))return!1;var f=typeof i;return f=="number"||f=="symbol"||f=="boolean"||i==null||gr(i)?!0:cs.test(i)||!sa.test(i)||c!=null&&i in Rt(c)}function D4(i){var c=typeof i;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?i!=="__proto__":i===null}function Nv(i){var c=Pf(i),f=I[c];if(typeof f!="function"||!(c in ut.prototype))return!1;if(i===f)return!0;var m=Tv(f);return!!m&&i===m[0]}function L4(i){return!!T0&&T0 in i}var F4=sf?ti:Wv;function vl(i){var c=i&&i.constructor,f=typeof c=="function"&&c.prototype||Is;return i===f}function TA(i){return i===i&&!Vt(i)}function AA(i,c){return function(f){return f==null?!1:f[i]===c&&(c!==n||i in Rt(f))}}function $4(i){var c=Ff(i,function(m){return f.size===h&&f.clear(),m}),f=c.cache;return c}function H4(i,c){var f=i[1],m=c[1],S=f|m,k=S<(b|E|H),R=m==H&&f==N||m==H&&f==K&&i[7].length<=c[8]||m==(H|K)&&c[7].length<=c[8]&&f==N;if(!(k||R))return i;m&b&&(i[2]=c[2],S|=f&b?0:T);var F=c[3];if(F){var j=i[3];i[3]=j?lA(j,F,c[4]):F,i[4]=j?er(i[3],p):c[4]}return F=c[5],F&&(j=i[5],i[5]=j?dA(j,F,c[6]):F,i[6]=j?er(i[5],p):c[6]),F=c[7],F&&(i[7]=F),m&H&&(i[8]=i[8]==null?c[8]:An(i[8],c[8])),i[9]==null&&(i[9]=c[9]),i[0]=c[0],i[1]=S,i}function U4(i){var c=[];if(i!=null)for(var f in Rt(i))c.push(f);return c}function B4(i){return lf.call(i)}function IA(i,c,f){return c=ln(c===n?i.length-1:c,0),function(){for(var m=arguments,S=-1,k=ln(m.length-c,0),R=re(k);++S<k;)R[S]=m[c+S];S=-1;for(var F=re(c+1);++S<c;)F[S]=m[S];return F[c]=f(R),Ln(i,this,F)}}function kA(i,c){return c.length<2?i:Sa(i,_r(c,0,-1))}function z4(i,c){for(var f=i.length,m=An(c.length,f),S=tr(i);m--;){var k=c[m];i[m]=ei(k,f)?S[k]:n}return i}function Pv(i,c){if(!(c==="constructor"&&typeof i[c]=="function")&&c!="__proto__")return i[c]}var NA=OA(Z0),yl=r5||function(i,c){return sn.setTimeout(i,c)},Ov=OA(u4);function PA(i,c,f){var m=c+"";return Ov(i,M4(m,V4(N4(m),f)))}function OA(i){var c=0,f=0;return function(){var m=s5(),S=he-(m-f);if(f=m,S>0){if(++c>=se)return arguments[0]}else c=0;return i.apply(n,arguments)}}function Mf(i,c){var f=-1,m=i.length,S=m-1;for(c=c===n?m:c;++f<c;){var k=pv(f,S),R=i[k];i[k]=i[f],i[f]=R}return i.length=c,i}var MA=$4(function(i){var c=[];return i.charCodeAt(0)===46&&c.push(""),i.replace(Fu,function(f,m,S,k){c.push(S?k.replace(Fm,"$1"):m||f)}),c});function Io(i){if(typeof i=="string"||gr(i))return i;var c=i+"";return c=="0"&&1/i==-1/0?"-0":c}function Ea(i){if(i!=null){try{return cf.call(i)}catch{}try{return i+""}catch{}}return""}function V4(i,c){return Xn(xe,function(f){var m="_."+f[0];c&f[1]&&!bs(i,m)&&i.push(m)}),i.sort()}function RA(i){if(i instanceof ut)return i.clone();var c=new xr(i.__wrapped__,i.__chain__);return c.__actions__=tr(i.__actions__),c.__index__=i.__index__,c.__values__=i.__values__,c}function K4(i,c,f){(f?$n(i,c,f):c===n)?c=1:c=ln(it(c),0);var m=i==null?0:i.length;if(!m||c<1)return[];for(var S=0,k=0,R=re(gf(m/c));S<m;)R[k++]=_r(i,S,S+=c);return R}function G4(i){for(var c=-1,f=i==null?0:i.length,m=0,S=[];++c<f;){var k=i[c];k&&(S[m++]=k)}return S}function j4(){var i=arguments.length;if(!i)return[];for(var c=re(i-1),f=arguments[0],m=i;m--;)c[m-1]=arguments[m];return Eo(et(f)?tr(f):[f],yn(c,1))}var W4=ct(function(i,c){return Xt(i)?fl(i,yn(c,1,Xt,!0)):[]}),q4=ct(function(i,c){var f=Er(c);return Xt(f)&&(f=n),Xt(i)?fl(i,yn(c,1,Xt,!0),Ke(f,2)):[]}),Y4=ct(function(i,c){var f=Er(c);return Xt(f)&&(f=n),Xt(i)?fl(i,yn(c,1,Xt,!0),n,f):[]});function J4(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:it(c),_r(i,c<0?0:c,m)):[]}function Q4(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:it(c),c=m-c,_r(i,0,c<0?0:c)):[]}function X4(i,c){return i&&i.length?Ef(i,Ke(c,3),!0,!0):[]}function Z4(i,c){return i&&i.length?Ef(i,Ke(c,3),!0):[]}function ez(i,c,f,m){var S=i==null?0:i.length;return S?(f&&typeof f!="number"&&$n(i,c,f)&&(f=0,m=S),j5(i,c,f,m)):[]}function DA(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var S=f==null?0:it(f);return S<0&&(S=ln(m+S,0)),va(i,Ke(c,3),S)}function LA(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var S=m-1;return f!==n&&(S=it(f),S=f<0?ln(m+S,0):An(S,m-1)),va(i,Ke(c,3),S,!0)}function FA(i){var c=i==null?0:i.length;return c?yn(i,1):[]}function tz(i){var c=i==null?0:i.length;return c?yn(i,oe):[]}function nz(i,c){var f=i==null?0:i.length;return f?(c=c===n?1:it(c),yn(i,c)):[]}function rz(i){for(var c=-1,f=i==null?0:i.length,m={};++c<f;){var S=i[c];m[S[0]]=S[1]}return m}function $A(i){return i&&i.length?i[0]:n}function oz(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var S=f==null?0:it(f);return S<0&&(S=ln(m+S,0)),Ai(i,c,S)}function iz(i){var c=i==null?0:i.length;return c?_r(i,0,-1):[]}var az=ct(function(i){var c=Lt(i,wv);return c.length&&c[0]===i[0]?lv(c):[]}),sz=ct(function(i){var c=Er(i),f=Lt(i,wv);return c===Er(f)?c=n:f.pop(),f.length&&f[0]===i[0]?lv(f,Ke(c,2)):[]}),cz=ct(function(i){var c=Er(i),f=Lt(i,wv);return c=typeof c=="function"?c:n,c&&f.pop(),f.length&&f[0]===i[0]?lv(f,n,c):[]});function lz(i,c){return i==null?"":i5.call(i,c)}function Er(i){var c=i==null?0:i.length;return c?i[c-1]:n}function dz(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var S=m;return f!==n&&(S=it(f),S=S<0?ln(m+S,0):An(S,m-1)),c===c?Tn(i,c,S):va(i,_s,S,!0)}function uz(i,c){return i&&i.length?Y0(i,it(c)):n}var fz=ct(HA);function HA(i,c){return i&&i.length&&c&&c.length?hv(i,c):i}function hz(i,c,f){return i&&i.length&&c&&c.length?hv(i,c,Ke(f,2)):i}function pz(i,c,f){return i&&i.length&&c&&c.length?hv(i,c,n,f):i}var gz=Zo(function(i,c){var f=i==null?0:i.length,m=iv(i,c);return X0(i,Lt(c,function(S){return ei(S,f)?+S:S}).sort(cA)),m});function mz(i,c){var f=[];if(!(i&&i.length))return f;var m=-1,S=[],k=i.length;for(c=Ke(c,3);++m<k;){var R=i[m];c(R,m,i)&&(f.push(R),S.push(m))}return X0(i,S),f}function Mv(i){return i==null?i:l5.call(i)}function vz(i,c,f){var m=i==null?0:i.length;return m?(f&&typeof f!="number"&&$n(i,c,f)?(c=0,f=m):(c=c==null?0:it(c),f=f===n?m:it(f)),_r(i,c,f)):[]}function yz(i,c){return _f(i,c)}function wz(i,c,f){return mv(i,c,Ke(f,2))}function Cz(i,c){var f=i==null?0:i.length;if(f){var m=_f(i,c);if(m<f&&no(i[m],c))return m}return-1}function bz(i,c){return _f(i,c,!0)}function xz(i,c,f){return mv(i,c,Ke(f,2),!0)}function Sz(i,c){var f=i==null?0:i.length;if(f){var m=_f(i,c,!0)-1;if(no(i[m],c))return m}return-1}function _z(i){return i&&i.length?eA(i):[]}function Ez(i,c){return i&&i.length?eA(i,Ke(c,2)):[]}function Tz(i){var c=i==null?0:i.length;return c?_r(i,1,c):[]}function Az(i,c,f){return i&&i.length?(c=f||c===n?1:it(c),_r(i,0,c<0?0:c)):[]}function Iz(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:it(c),c=m-c,_r(i,c<0?0:c,m)):[]}function kz(i,c){return i&&i.length?Ef(i,Ke(c,3),!1,!0):[]}function Nz(i,c){return i&&i.length?Ef(i,Ke(c,3)):[]}var Pz=ct(function(i){return Pi(yn(i,1,Xt,!0))}),Oz=ct(function(i){var c=Er(i);return Xt(c)&&(c=n),Pi(yn(i,1,Xt,!0),Ke(c,2))}),Mz=ct(function(i){var c=Er(i);return c=typeof c=="function"?c:n,Pi(yn(i,1,Xt,!0),n,c)});function Rz(i){return i&&i.length?Pi(i):[]}function Dz(i,c){return i&&i.length?Pi(i,Ke(c,2)):[]}function Lz(i,c){return c=typeof c=="function"?c:n,i&&i.length?Pi(i,n,c):[]}function Rv(i){if(!(i&&i.length))return[];var c=0;return i=Zn(i,function(f){if(Xt(f))return c=ln(f.length,c),!0}),rl(c,function(f){return Lt(i,el(f))})}function UA(i,c){if(!(i&&i.length))return[];var f=Rv(i);return c==null?f:Lt(f,function(m){return Ln(c,n,m)})}var Fz=ct(function(i,c){return Xt(i)?fl(i,c):[]}),$z=ct(function(i){return yv(Zn(i,Xt))}),Hz=ct(function(i){var c=Er(i);return Xt(c)&&(c=n),yv(Zn(i,Xt),Ke(c,2))}),Uz=ct(function(i){var c=Er(i);return c=typeof c=="function"?c:n,yv(Zn(i,Xt),n,c)}),Bz=ct(Rv);function zz(i,c){return oA(i||[],c||[],ul)}function Vz(i,c){return oA(i||[],c||[],gl)}var Kz=ct(function(i){var c=i.length,f=c>1?i[c-1]:n;return f=typeof f=="function"?(i.pop(),f):n,UA(i,f)});function BA(i){var c=I(i);return c.__chain__=!0,c}function Gz(i,c){return c(i),i}function Rf(i,c){return c(i)}var jz=Zo(function(i){var c=i.length,f=c?i[0]:0,m=this.__wrapped__,S=function(k){return iv(k,i)};return c>1||this.__actions__.length||!(m instanceof ut)||!ei(f)?this.thru(S):(m=m.slice(f,+f+(c?1:0)),m.__actions__.push({func:Rf,args:[S],thisArg:n}),new xr(m,this.__chain__).thru(function(k){return c&&!k.length&&k.push(n),k}))});function Wz(){return BA(this)}function qz(){return new xr(this.value(),this.__chain__)}function Yz(){this.__values__===n&&(this.__values__=tI(this.value()));var i=this.__index__>=this.__values__.length,c=i?n:this.__values__[this.__index__++];return{done:i,value:c}}function Jz(){return this}function Qz(i){for(var c,f=this;f instanceof wf;){var m=RA(f);m.__index__=0,m.__values__=n,c?S.__wrapped__=m:c=m;var S=m;f=f.__wrapped__}return S.__wrapped__=i,c}function Xz(){var i=this.__wrapped__;if(i instanceof ut){var c=i;return this.__actions__.length&&(c=new ut(this)),c=c.reverse(),c.__actions__.push({func:Rf,args:[Mv],thisArg:n}),new xr(c,this.__chain__)}return this.thru(Mv)}function Zz(){return rA(this.__wrapped__,this.__actions__)}var eV=Tf(function(i,c,f){Tt.call(i,f)?++i[f]:Qo(i,f,1)});function tV(i,c,f){var m=et(i)?Jr:G5;return f&&$n(i,c,f)&&(c=n),m(i,Ke(c,3))}function nV(i,c){var f=et(i)?Zn:U0;return f(i,Ke(c,3))}var rV=pA(DA),oV=pA(LA);function iV(i,c){return yn(Df(i,c),1)}function aV(i,c){return yn(Df(i,c),oe)}function sV(i,c,f){return f=f===n?1:it(f),yn(Df(i,c),f)}function zA(i,c){var f=et(i)?Xn:Ni;return f(i,Ke(c,3))}function VA(i,c){var f=et(i)?nf:H0;return f(i,Ke(c,3))}var cV=Tf(function(i,c,f){Tt.call(i,f)?i[f].push(c):Qo(i,f,[c])});function lV(i,c,f,m){i=nr(i)?i:Ls(i),f=f&&!m?it(f):0;var S=i.length;return f<0&&(f=ln(S+f,0)),Uf(i)?f<=S&&i.indexOf(c,f)>-1:!!S&&Ai(i,c,f)>-1}var dV=ct(function(i,c,f){var m=-1,S=typeof c=="function",k=nr(i)?re(i.length):[];return Ni(i,function(R){k[++m]=S?Ln(c,R,f):hl(R,c,f)}),k}),uV=Tf(function(i,c,f){Qo(i,f,c)});function Df(i,c){var f=et(i)?Lt:j0;return f(i,Ke(c,3))}function fV(i,c,f,m){return i==null?[]:(et(c)||(c=c==null?[]:[c]),f=m?n:f,et(f)||(f=f==null?[]:[f]),J0(i,c,f))}var hV=Tf(function(i,c,f){i[f?0:1].push(c)},function(){return[[],[]]});function pV(i,c,f){var m=et(i)?ma:nl,S=arguments.length<3;return m(i,Ke(c,4),f,S,Ni)}function gV(i,c,f){var m=et(i)?Jm:nl,S=arguments.length<3;return m(i,Ke(c,4),f,S,H0)}function mV(i,c){var f=et(i)?Zn:U0;return f(i,$f(Ke(c,3)))}function vV(i){var c=et(i)?D0:l4;return c(i)}function yV(i,c,f){(f?$n(i,c,f):c===n)?c=1:c=it(c);var m=et(i)?U5:d4;return m(i,c)}function wV(i){var c=et(i)?B5:f4;return c(i)}function CV(i){if(i==null)return 0;if(nr(i))return Uf(i)?Cr(i):i.length;var c=In(i);return c==Xe||c==Kt?i.size:uv(i).length}function bV(i,c,f){var m=et(i)?xs:h4;return f&&$n(i,c,f)&&(c=n),m(i,Ke(c,3))}var xV=ct(function(i,c){if(i==null)return[];var f=c.length;return f>1&&$n(i,c[0],c[1])?c=[]:f>2&&$n(c[0],c[1],c[2])&&(c=[c[0]]),J0(i,yn(c,1),[])}),Lf=n5||function(){return sn.Date.now()};function SV(i,c){if(typeof c!="function")throw new br(s);return i=it(i),function(){if(--i<1)return c.apply(this,arguments)}}function KA(i,c,f){return c=f?n:c,c=i&&c==null?i.length:c,Xo(i,H,n,n,n,n,c)}function GA(i,c){var f;if(typeof c!="function")throw new br(s);return i=it(i),function(){return--i>0&&(f=c.apply(this,arguments)),i<=1&&(c=n),f}}var Dv=ct(function(i,c,f){var m=b;if(f.length){var S=er(f,Rs(Dv));m|=_}return Xo(i,m,c,f,S)}),jA=ct(function(i,c,f){var m=b|E;if(f.length){var S=er(f,Rs(jA));m|=_}return Xo(c,m,i,f,S)});function WA(i,c,f){c=f?n:c;var m=Xo(i,N,n,n,n,n,n,c);return m.placeholder=WA.placeholder,m}function qA(i,c,f){c=f?n:c;var m=Xo(i,P,n,n,n,n,n,c);return m.placeholder=qA.placeholder,m}function YA(i,c,f){var m,S,k,R,F,j,me=0,ve=!1,we=!1,Oe=!0;if(typeof i!="function")throw new br(s);c=Tr(c)||0,Vt(f)&&(ve=!!f.leading,we="maxWait"in f,k=we?ln(Tr(f.maxWait)||0,c):k,Oe="trailing"in f?!!f.trailing:Oe);function $e(Zt){var ro=m,ri=S;return m=S=n,me=Zt,R=i.apply(ri,ro),R}function je(Zt){return me=Zt,F=yl(dt,c),ve?$e(Zt):R}function at(Zt){var ro=Zt-j,ri=Zt-me,pI=c-ro;return we?An(pI,k-ri):pI}function We(Zt){var ro=Zt-j,ri=Zt-me;return j===n||ro>=c||ro<0||we&&ri>=k}function dt(){var Zt=Lf();if(We(Zt))return ht(Zt);F=yl(dt,at(Zt))}function ht(Zt){return F=n,Oe&&m?$e(Zt):(m=S=n,R)}function mr(){F!==n&&iA(F),me=0,m=j=S=F=n}function Hn(){return F===n?R:ht(Lf())}function vr(){var Zt=Lf(),ro=We(Zt);if(m=arguments,S=this,j=Zt,ro){if(F===n)return je(j);if(we)return iA(F),F=yl(dt,c),$e(j)}return F===n&&(F=yl(dt,c)),R}return vr.cancel=mr,vr.flush=Hn,vr}var _V=ct(function(i,c){return $0(i,1,c)}),EV=ct(function(i,c,f){return $0(i,Tr(c)||0,f)});function TV(i){return Xo(i,ee)}function Ff(i,c){if(typeof i!="function"||c!=null&&typeof c!="function")throw new br(s);var f=function(){var m=arguments,S=c?c.apply(this,m):m[0],k=f.cache;if(k.has(S))return k.get(S);var R=i.apply(this,m);return f.cache=k.set(S,R)||k,R};return f.cache=new(Ff.Cache||Jo),f}Ff.Cache=Jo;function $f(i){if(typeof i!="function")throw new br(s);return function(){var c=arguments;switch(c.length){case 0:return!i.call(this);case 1:return!i.call(this,c[0]);case 2:return!i.call(this,c[0],c[1]);case 3:return!i.call(this,c[0],c[1],c[2])}return!i.apply(this,c)}}function AV(i){return GA(2,i)}var IV=p4(function(i,c){c=c.length==1&&et(c[0])?Lt(c[0],dn(Ke())):Lt(yn(c,1),dn(Ke()));var f=c.length;return ct(function(m){for(var S=-1,k=An(m.length,f);++S<k;)m[S]=c[S].call(this,m[S]);return Ln(i,this,m)})}),Lv=ct(function(i,c){var f=er(c,Rs(Lv));return Xo(i,_,n,c,f)}),JA=ct(function(i,c){var f=er(c,Rs(JA));return Xo(i,D,n,c,f)}),kV=Zo(function(i,c){return Xo(i,K,n,n,n,c)});function NV(i,c){if(typeof i!="function")throw new br(s);return c=c===n?c:it(c),ct(i,c)}function PV(i,c){if(typeof i!="function")throw new br(s);return c=c==null?0:ln(it(c),0),ct(function(f){var m=f[c],S=Mi(f,0,c);return m&&Eo(S,m),Ln(i,this,S)})}function OV(i,c,f){var m=!0,S=!0;if(typeof i!="function")throw new br(s);return Vt(f)&&(m="leading"in f?!!f.leading:m,S="trailing"in f?!!f.trailing:S),YA(i,c,{leading:m,maxWait:c,trailing:S})}function MV(i){return KA(i,1)}function RV(i,c){return Lv(Cv(c),i)}function DV(){if(!arguments.length)return[];var i=arguments[0];return et(i)?i:[i]}function LV(i){return Sr(i,y)}function FV(i,c){return c=typeof c=="function"?c:n,Sr(i,y,c)}function $V(i){return Sr(i,g|y)}function HV(i,c){return c=typeof c=="function"?c:n,Sr(i,g|y,c)}function UV(i,c){return c==null||F0(i,c,un(c))}function no(i,c){return i===c||i!==i&&c!==c}var BV=Nf(cv),zV=Nf(function(i,c){return i>=c}),Ta=V0(function(){return arguments}())?V0:function(i){return jt(i)&&Tt.call(i,"callee")&&!k0.call(i,"callee")},et=re.isArray,VV=Xu?dn(Xu):Q5;function nr(i){return i!=null&&Hf(i.length)&&!ti(i)}function Xt(i){return jt(i)&&nr(i)}function KV(i){return i===!0||i===!1||jt(i)&&Fn(i)==ce}var Ri=o5||Wv,GV=ga?dn(ga):X5;function jV(i){return jt(i)&&i.nodeType===1&&!wl(i)}function WV(i){if(i==null)return!0;if(nr(i)&&(et(i)||typeof i=="string"||typeof i.splice=="function"||Ri(i)||Ds(i)||Ta(i)))return!i.length;var c=In(i);if(c==Xe||c==Kt)return!i.size;if(vl(i))return!uv(i).length;for(var f in i)if(Tt.call(i,f))return!1;return!0}function qV(i,c){return pl(i,c)}function YV(i,c,f){f=typeof f=="function"?f:n;var m=f?f(i,c):n;return m===n?pl(i,c,n,f):!!m}function Fv(i){if(!jt(i))return!1;var c=Fn(i);return c==Ne||c==Ce||typeof i.message=="string"&&typeof i.name=="string"&&!wl(i)}function JV(i){return typeof i=="number"&&P0(i)}function ti(i){if(!Vt(i))return!1;var c=Fn(i);return c==ne||c==Ve||c==z||c==zt}function QA(i){return typeof i=="number"&&i==it(i)}function Hf(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Q}function Vt(i){var c=typeof i;return i!=null&&(c=="object"||c=="function")}function jt(i){return i!=null&&typeof i=="object"}var XA=Zu?dn(Zu):e4;function QV(i,c){return i===c||dv(i,c,Av(c))}function XV(i,c,f){return f=typeof f=="function"?f:n,dv(i,c,Av(c),f)}function ZV(i){return ZA(i)&&i!=+i}function eK(i){if(F4(i))throw new Ze(a);return K0(i)}function tK(i){return i===null}function nK(i){return i==null}function ZA(i){return typeof i=="number"||jt(i)&&Fn(i)==Ct}function wl(i){if(!jt(i)||Fn(i)!=bt)return!1;var c=ff(i);if(c===null)return!0;var f=Tt.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&cf.call(f)==X3}var $v=ef?dn(ef):t4;function rK(i){return QA(i)&&i>=-9007199254740991&&i<=Q}var eI=Xc?dn(Xc):n4;function Uf(i){return typeof i=="string"||!et(i)&&jt(i)&&Fn(i)==L}function gr(i){return typeof i=="symbol"||jt(i)&&Fn(i)==J}var Ds=tf?dn(tf):r4;function oK(i){return i===n}function iK(i){return jt(i)&&In(i)==ae}function aK(i){return jt(i)&&Fn(i)==ye}var sK=Nf(fv),cK=Nf(function(i,c){return i<=c});function tI(i){if(!i)return[];if(nr(i))return Uf(i)?eo(i):tr(i);if(al&&i[al])return ya(i[al]());var c=In(i),f=c==Xe?Ts:c==Kt?Wo:Ls;return f(i)}function ni(i){if(!i)return i===0?i:0;if(i=Tr(i),i===oe||i===-1/0){var c=i<0?-1:1;return c*X}return i===i?i:0}function it(i){var c=ni(i),f=c%1;return c===c?f?c-f:c:0}function nI(i){return i?xa(it(i),0,te):0}function Tr(i){if(typeof i=="number")return i;if(gr(i))return $;if(Vt(i)){var c=typeof i.valueOf=="function"?i.valueOf():i;i=Vt(c)?c+"":c}if(typeof i!="string")return i===0?i:+i;i=Xr(i);var f=$m.test(i);return f||Dc.test(i)?qm(i.slice(2),f?2:8):Rc.test(i)?$:+i}function rI(i){return Ao(i,rr(i))}function lK(i){return i?xa(it(i),-9007199254740991,Q):i===0?i:0}function St(i){return i==null?"":pr(i)}var dK=Os(function(i,c){if(vl(c)||nr(c)){Ao(c,un(c),i);return}for(var f in c)Tt.call(c,f)&&ul(i,f,c[f])}),oI=Os(function(i,c){Ao(c,rr(c),i)}),Bf=Os(function(i,c,f,m){Ao(c,rr(c),i,m)}),uK=Os(function(i,c,f,m){Ao(c,un(c),i,m)}),fK=Zo(iv);function hK(i,c){var f=Ps(i);return c==null?f:L0(f,c)}var pK=ct(function(i,c){i=Rt(i);var f=-1,m=c.length,S=m>2?c[2]:n;for(S&&$n(c[0],c[1],S)&&(m=1);++f<m;)for(var k=c[f],R=rr(k),F=-1,j=R.length;++F<j;){var me=R[F],ve=i[me];(ve===n||no(ve,Is[me])&&!Tt.call(i,me))&&(i[me]=k[me])}return i}),gK=ct(function(i){return i.push(n,bA),Ln(iI,n,i)});function mK(i,c){return rf(i,Ke(c,3),To)}function vK(i,c){return rf(i,Ke(c,3),sv)}function yK(i,c){return i==null?i:av(i,Ke(c,3),rr)}function wK(i,c){return i==null?i:B0(i,Ke(c,3),rr)}function CK(i,c){return i&&To(i,Ke(c,3))}function bK(i,c){return i&&sv(i,Ke(c,3))}function xK(i){return i==null?[]:xf(i,un(i))}function SK(i){return i==null?[]:xf(i,rr(i))}function Hv(i,c,f){var m=i==null?n:Sa(i,c);return m===n?f:m}function _K(i,c){return i!=null&&_A(i,c,W5)}function Uv(i,c){return i!=null&&_A(i,c,q5)}var EK=mA(function(i,c,f){c!=null&&typeof c.toString!="function"&&(c=lf.call(c)),i[c]=f},zv(or)),TK=mA(function(i,c,f){c!=null&&typeof c.toString!="function"&&(c=lf.call(c)),Tt.call(i,c)?i[c].push(f):i[c]=[f]},Ke),AK=ct(hl);function un(i){return nr(i)?R0(i):uv(i)}function rr(i){return nr(i)?R0(i,!0):o4(i)}function IK(i,c){var f={};return c=Ke(c,3),To(i,function(m,S,k){Qo(f,c(m,S,k),m)}),f}function kK(i,c){var f={};return c=Ke(c,3),To(i,function(m,S,k){Qo(f,S,c(m,S,k))}),f}var NK=Os(function(i,c,f){Sf(i,c,f)}),iI=Os(function(i,c,f,m){Sf(i,c,f,m)}),PK=Zo(function(i,c){var f={};if(i==null)return f;var m=!1;c=Lt(c,function(k){return k=Oi(k,i),m||(m=k.length>1),k}),Ao(i,Ev(i),f),m&&(f=Sr(f,g|w|y,E4));for(var S=c.length;S--;)vv(f,c[S]);return f});function OK(i,c){return aI(i,$f(Ke(c)))}var MK=Zo(function(i,c){return i==null?{}:a4(i,c)});function aI(i,c){if(i==null)return{};var f=Lt(Ev(i),function(m){return[m]});return c=Ke(c),Q0(i,f,function(m,S){return c(m,S[0])})}function RK(i,c,f){c=Oi(c,i);var m=-1,S=c.length;for(S||(S=1,i=n);++m<S;){var k=i==null?n:i[Io(c[m])];k===n&&(m=S,k=f),i=ti(k)?k.call(i):k}return i}function DK(i,c,f){return i==null?i:gl(i,c,f)}function LK(i,c,f,m){return m=typeof m=="function"?m:n,i==null?i:gl(i,c,f,m)}var sI=wA(un),cI=wA(rr);function FK(i,c,f){var m=et(i),S=m||Ri(i)||Ds(i);if(c=Ke(c,4),f==null){var k=i&&i.constructor;S?f=m?new k:[]:Vt(i)?f=ti(k)?Ps(ff(i)):{}:f={}}return(S?Xn:To)(i,function(R,F,j){return c(f,R,F,j)}),f}function $K(i,c){return i==null?!0:vv(i,c)}function HK(i,c,f){return i==null?i:nA(i,c,Cv(f))}function UK(i,c,f,m){return m=typeof m=="function"?m:n,i==null?i:nA(i,c,Cv(f),m)}function Ls(i){return i==null?[]:ol(i,un(i))}function BK(i){return i==null?[]:ol(i,rr(i))}function zK(i,c,f){return f===n&&(f=c,c=n),f!==n&&(f=Tr(f),f=f===f?f:0),c!==n&&(c=Tr(c),c=c===c?c:0),xa(Tr(i),c,f)}function VK(i,c,f){return c=ni(c),f===n?(f=c,c=0):f=ni(f),i=Tr(i),Y5(i,c,f)}function KK(i,c,f){if(f&&typeof f!="boolean"&&$n(i,c,f)&&(c=f=n),f===n&&(typeof c=="boolean"?(f=c,c=n):typeof i=="boolean"&&(f=i,i=n)),i===n&&c===n?(i=0,c=1):(i=ni(i),c===n?(c=i,i=0):c=ni(c)),i>c){var m=i;i=c,c=m}if(f||i%1||c%1){var S=O0();return An(i+S*(c-i+Wm("1e-"+((S+"").length-1))),c)}return pv(i,c)}var GK=Ms(function(i,c,f){return c=c.toLowerCase(),i+(f?lI(c):c)});function lI(i){return Bv(St(i).toLowerCase())}function dI(i){return i=St(i),i&&i.replace(Hm,fe).replace(pa,"")}function jK(i,c,f){i=St(i),c=pr(c);var m=i.length;f=f===n?m:xa(it(f),0,m);var S=f;return f-=c.length,f>=0&&i.slice(f,S)==c}function WK(i){return i=St(i),i&&ia.test(i)?i.replace(Nc,be):i}function qK(i){return i=St(i),i&&$u.test(i)?i.replace(Pc,"\\$&"):i}var YK=Ms(function(i,c,f){return i+(f?"-":"")+c.toLowerCase()}),JK=Ms(function(i,c,f){return i+(f?" ":"")+c.toLowerCase()}),QK=hA("toLowerCase");function XK(i,c,f){i=St(i),c=it(c);var m=c?Cr(i):0;if(!c||m>=c)return i;var S=(c-m)/2;return kf(mf(S),f)+i+kf(gf(S),f)}function ZK(i,c,f){i=St(i),c=it(c);var m=c?Cr(i):0;return c&&m<c?i+kf(c-m,f):i}function eG(i,c,f){i=St(i),c=it(c);var m=c?Cr(i):0;return c&&m<c?kf(c-m,f)+i:i}function tG(i,c,f){return f||c==null?c=0:c&&(c=+c),c5(St(i).replace(Oc,""),c||0)}function nG(i,c,f){return(f?$n(i,c,f):c===n)?c=1:c=it(c),gv(St(i),c)}function rG(){var i=arguments,c=St(i[0]);return i.length<3?c:c.replace(i[1],i[2])}var oG=Ms(function(i,c,f){return i+(f?"_":"")+c.toLowerCase()});function iG(i,c,f){return f&&typeof f!="number"&&$n(i,c,f)&&(c=f=n),f=f===n?te:f>>>0,f?(i=St(i),i&&(typeof c=="string"||c!=null&&!$v(c))&&(c=pr(c),!c&&Mt(i))?Mi(eo(i),0,f):i.split(c,f)):[]}var aG=Ms(function(i,c,f){return i+(f?" ":"")+Bv(c)});function sG(i,c,f){return i=St(i),f=f==null?0:xa(it(f),0,i.length),c=pr(c),i.slice(f,f+c.length)==c}function cG(i,c,f){var m=I.templateSettings;f&&$n(i,c,f)&&(c=n),i=St(i),c=Bf({},c,m,CA);var S=Bf({},c.imports,m.imports,CA),k=un(S),R=ol(S,k),F,j,me=0,ve=c.interpolate||Lc,we="__p += '",Oe=ev((c.escape||Lc).source+"|"+ve.source+"|"+(ve===Lu?Vo:Lc).source+"|"+(c.evaluate||Lc).source+"|$","g"),$e="//# sourceURL="+(Tt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ht+"]")+`
87
87
  `;i.replace(Oe,function(We,dt,ht,mr,Hn,vr){return ht||(ht=mr),we+=i.slice(me,vr).replace(Fc,Ie),dt&&(F=!0,we+=`' +
88
88
  __e(`+dt+`) +
89
89
  '`),Hn&&(j=!0,we+=`';
@@ -201,7 +201,7 @@ function print() { __p += __j.call(arguments, '') }
201
201
  * This source code is licensed under the ISC license.
202
202
  * See the LICENSE file in the root directory of this source tree.
203
203
  */const lg=Sn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Bx(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=Bx(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function zx(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=Bx(t))&&(r&&(r+=" "),r+=e);return r}function WD(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}WD(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
204
- `);var dg=t=>typeof t=="number"&&!isNaN(t),oc=t=>typeof t=="string",Vx=t=>typeof t=="function",qD=t=>oc(t)||dg(t),YD=t=>M.isValidElement(t)||oc(t)||Vx(t)||dg(t),JD=1,Kx=()=>`${JD++}`,ho=new Map,ug=[],Gx=new Set,jx=()=>ho.size>0,QD=(t,{containerId:e})=>{var n;return(n=ho.get(e||1))==null?void 0:n.toasts.get(t)};function XD(t,e){var n;if(e)return!!((n=ho.get(e))!=null&&n.isToastActive(t));let r=!1;return ho.forEach(o=>{o.isToastActive(t)&&(r=!0)}),r}function ZD(t){if(!jx()){ug=ug.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||qD(t))ho.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=ho.get(t.containerId);e?e.removeToast(t.id):ho.forEach(n=>{n.removeToast(t.id)})}}var eL=(t={})=>{ho.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function tL(t,e){YD(t)&&(jx()||ug.push({content:t,options:e}),ho.forEach(n=>{n.buildToast(t,e)}))}function Wx(t,e){ho.forEach(n=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===n.id)&&n.toggle(t,e==null?void 0:e.id)})}function nL(t){return Gx.add(t),()=>{Gx.delete(t)}}function rL(t){return t&&(oc(t.toastId)||dg(t.toastId))?t.toastId:Kx()}function ic(t,e){return tL(t,e),e.toastId}function zd(t,e){return{...e,type:e&&e.type||t,toastId:rL(e)}}function Vd(t){return(e,n)=>ic(e,zd(t,n))}function st(t,e){return ic(t,zd("default",e))}st.loading=(t,e)=>ic(t,zd("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function oL(t,{pending:e,error:n,success:r},o){let a;e&&(a=oc(e)?st.loading(e,o):st.loading(e.render,{...o,...e}));let s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(h,p,g)=>{if(p==null){st.dismiss(a);return}let w={type:h,...s,...o,data:g},y=oc(p)?{render:p}:p;return a?st.update(a,{...w,...y}):st(y.render,{...w,...y}),g},u=Vx(t)?t():t;return u.then(h=>l("success",r,h)).catch(h=>l("error",n,h)),u}st.promise=oL,st.success=Vd("success"),st.info=Vd("info"),st.error=Vd("error"),st.warning=Vd("warning"),st.warn=st.warning,st.dark=(t,e)=>ic(t,zd("default",{theme:"dark",...e}));function iL(t){ZD(t)}st.dismiss=iL,st.clearWaitingQueue=eL,st.isActive=XD,st.update=(t,e={})=>{let n=QD(t,e);if(n){let{props:r,content:o}=n,a={delay:100,...r,...e,toastId:e.toastId||t,updateId:Kx()};a.toastId!==t&&(a.staleId=t);let s=a.render||o;delete a.render,ic(s,a)}},st.done=t=>{st.update(t,{progress:1})},st.onChange=nL,st.play=t=>Wx(!0,t),st.pause=t=>Wx(!1,t);const aL={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"},sL=t=>t==="SummaryOfSuggestedAI"||t==="KeywordAISuggestion"||t==="SuggestedAICategories",fg=t=>t==="fullPath"||t==="createAt"||t==="creator"||t==="creatorId"||t==="DataSource"||t==="AccessLevel"||t==="category"||t==="fileName",cL={STARTING:"Đang bắt đầu",IN_PROGRESS:"Đang đồng bộ",COMPLETE:"Đồng bộ thành công",FAILED:"Đồng bộ thất bại",STOPPING:"Đang dừng",STOPPED:"Đã dừng"},lL=t=>cL[t]||t;function mi(t){const e=dL(t),n=C.forwardRef((r,o)=>{const{children:a,...s}=r,l=C.Children.toArray(a),u=l.find(fL);if(u){const h=u.props.children,p=l.map(g=>g===u?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:g);return d.jsx(e,{...s,ref:o,children:C.isValidElement(h)?C.cloneElement(h,void 0,p):null})}return d.jsx(e,{...s,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}var qx=mi("Slot");function dL(t){const e=C.forwardRef((n,r)=>{const{children:o,...a}=n;if(C.isValidElement(o)){const s=pL(o),l=hL(a,o.props);return o.type!==C.Fragment&&(l.ref=r?FC(r,s):s),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var uL=Symbol("radix.slottable");function fL(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===uL}function hL(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function pL(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const hg="-",gL=t=>{const e=vL(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{const l=s.split(hg);return l[0]===""&&l.length!==1&&l.shift(),Yx(l,e)||mL(s)},getConflictingClassGroupIds:(s,l)=>{const u=n[s]||[];return l&&r[s]?[...u,...r[s]]:u}}},Yx=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?Yx(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const a=t.join(hg);return(s=e.validators.find(({validator:l})=>l(a)))==null?void 0:s.classGroupId},Jx=/^\[(.+)\]$/,mL=t=>{if(Jx.test(t)){const e=Jx.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},vL=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return wL(Object.entries(t.classGroups),n).forEach(([a,s])=>{pg(s,r,a,e)}),r},pg=(t,e,n,r)=>{t.forEach(o=>{if(typeof o=="string"){const a=o===""?e:Qx(e,o);a.classGroupId=n;return}if(typeof o=="function"){if(yL(o)){pg(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,s])=>{pg(s,Qx(e,a),n,r)})})},Qx=(t,e)=>{let n=t;return e.split(hg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},yL=t=>t.isThemeGetter,wL=(t,e)=>e?t.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,l])=>[e+s,l])):a);return[n,o]}):t,CL=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const o=(a,s)=>{n.set(a,s),e++,e>t&&(e=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return o(a,s),s},set(a,s){n.has(a)?n.set(a,s):o(a,s)}}},Xx="!",bL=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,o=e[0],a=e.length,s=l=>{const u=[];let h=0,p=0,g;for(let b=0;b<l.length;b++){let E=l[b];if(h===0){if(E===o&&(r||l.slice(b,b+a)===e)){u.push(l.slice(p,b)),p=b+a;continue}if(E==="/"){g=b;continue}}E==="["?h++:E==="]"&&h--}const w=u.length===0?l:l.substring(p),y=w.startsWith(Xx),x=y?w.substring(1):w,v=g&&g>p?g-p:void 0;return{modifiers:u,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:s}):s},xL=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},SL=t=>({cache:CL(t.cacheSize),parseClassName:bL(t),...gL(t)}),_L=/\s+/,EL=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,a=[],s=t.trim().split(_L);let l="";for(let u=s.length-1;u>=0;u-=1){const h=s[u],{modifiers:p,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:y}=n(h);let x=!!y,v=r(x?w.substring(0,y):w);if(!v){if(!x){l=h+(l.length>0?" "+l:l);continue}if(v=r(w),!v){l=h+(l.length>0?" "+l:l);continue}x=!1}const b=xL(p).join(":"),E=g?b+Xx:b,T=E+v;if(a.includes(T))continue;a.push(T);const N=o(v,x);for(let P=0;P<N.length;++P){const _=N[P];a.push(E+_)}l=h+(l.length>0?" "+l:l)}return l};function TL(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=Zx(e))&&(r&&(r+=" "),r+=n);return r}const Zx=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=Zx(t[r]))&&(n&&(n+=" "),n+=e);return n};function AL(t,...e){let n,r,o,a=s;function s(u){const h=e.reduce((p,g)=>g(p),t());return n=SL(h),r=n.cache.get,o=n.cache.set,a=l,l(u)}function l(u){const h=r(u);if(h)return h;const p=EL(u,n);return o(u,p),p}return function(){return a(TL.apply(null,arguments))}}const Ft=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},eS=/^\[(?:([a-z-]+):)?(.+)\]$/i,IL=/^\d+\/\d+$/,kL=new Set(["px","full","screen"]),NL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PL=/\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$/,OL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ML=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fo=t=>Ya(t)||kL.has(t)||IL.test(t),vi=t=>Ja(t,"length",zL),Ya=t=>!!t&&!Number.isNaN(Number(t)),gg=t=>Ja(t,"number",Ya),ac=t=>!!t&&Number.isInteger(Number(t)),DL=t=>t.endsWith("%")&&Ya(t.slice(0,-1)),ot=t=>eS.test(t),yi=t=>NL.test(t),LL=new Set(["length","size","percentage"]),FL=t=>Ja(t,LL,tS),$L=t=>Ja(t,"position",tS),HL=new Set(["image","url"]),UL=t=>Ja(t,HL,KL),BL=t=>Ja(t,"",VL),sc=()=>!0,Ja=(t,e,n)=>{const r=eS.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},zL=t=>PL.test(t)&&!OL.test(t),tS=()=>!1,VL=t=>ML.test(t),KL=t=>RL.test(t),GL=AL(()=>{const t=Ft("colors"),e=Ft("spacing"),n=Ft("blur"),r=Ft("brightness"),o=Ft("borderColor"),a=Ft("borderRadius"),s=Ft("borderSpacing"),l=Ft("borderWidth"),u=Ft("contrast"),h=Ft("grayscale"),p=Ft("hueRotate"),g=Ft("invert"),w=Ft("gap"),y=Ft("gradientColorStops"),x=Ft("gradientColorStopPositions"),v=Ft("inset"),b=Ft("margin"),E=Ft("opacity"),T=Ft("padding"),N=Ft("saturate"),P=Ft("scale"),_=Ft("sepia"),D=Ft("skew"),H=Ft("space"),K=Ft("translate"),ee=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",ot,e],se=()=>[ot,e],fe=()=>["",Fo,vi],q=()=>["auto",Ya,ot],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",ot],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>[Ya,ot];return{cacheSize:500,separator:":",theme:{colors:[sc],spacing:[Fo,vi],blur:["none","",yi,ot],brightness:te(),borderColor:[t],borderRadius:["none","","full",yi,ot],borderSpacing:se(),borderWidth:fe(),contrast:te(),grayscale:X(),hueRotate:te(),invert:X(),gap:se(),gradientColorStops:[t],gradientColorStopPositions:[DL,vi],inset:de(),margin:de(),opacity:te(),padding:se(),saturate:te(),scale:te(),sepia:X(),skew:te(),space:se(),translate:se()},classGroups:{aspect:[{aspect:["auto","square","video",ot]}],container:["container"],columns:[{columns:[yi]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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(),ot]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ac,ot]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ot]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",ac,ot]}],"grid-cols":[{"grid-cols":[sc]}],"col-start-end":[{col:["auto",{span:["full",ac,ot]},ot]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[sc]}],"row-start-end":[{row:["auto",{span:[ac,ot]},ot]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ot]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ot]}],gap:[{gap:[w]}],"gap-x":[{"gap-x":[w]}],"gap-y":[{"gap-y":[w]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[H]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[H]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ot,e]}],"min-w":[{"min-w":[ot,e,"min","max","fit"]}],"max-w":[{"max-w":[ot,e,"none","full","min","max","fit","prose",{screen:[yi]},yi]}],h:[{h:[ot,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ot,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ot,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ot,e,"auto","min","max","fit"]}],"font-size":[{text:["base",yi,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gg]}],"font-family":[{font:[sc]}],"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",ot]}],"line-clamp":[{"line-clamp":["none",Ya,gg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fo,ot]}],"list-image":[{"list-image":["none",ot]}],"list-style-type":[{list:["none","disc","decimal",ot]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fo,vi]}],"underline-offset":[{"underline-offset":["auto",Fo,ot]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:se()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot]}],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",ot]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),$L]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},UL]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:Y()}],"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:["",...Y()]}],"outline-offset":[{"outline-offset":[Fo,ot]}],"outline-w":[{outline:[Fo,vi]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[Fo,vi]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",yi,BL]}],"shadow-color":[{shadow:[sc]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",yi,ot]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[g]}],saturate:[{saturate:[N]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ot]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",ot]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",ot]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[ac,ot]}],"translate-x":[{"translate-x":[K]}],"translate-y":[{"translate-y":[K]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ot]}],accent:[{accent:["auto",t]}],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",ot]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":se()}],"scroll-mx":[{"scroll-mx":se()}],"scroll-my":[{"scroll-my":se()}],"scroll-ms":[{"scroll-ms":se()}],"scroll-me":[{"scroll-me":se()}],"scroll-mt":[{"scroll-mt":se()}],"scroll-mr":[{"scroll-mr":se()}],"scroll-mb":[{"scroll-mb":se()}],"scroll-ml":[{"scroll-ml":se()}],"scroll-p":[{"scroll-p":se()}],"scroll-px":[{"scroll-px":se()}],"scroll-py":[{"scroll-py":se()}],"scroll-ps":[{"scroll-ps":se()}],"scroll-pe":[{"scroll-pe":se()}],"scroll-pt":[{"scroll-pt":se()}],"scroll-pr":[{"scroll-pr":se()}],"scroll-pb":[{"scroll-pb":se()}],"scroll-pl":[{"scroll-pl":se()}],"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",ot]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Fo,vi,gg]}],stroke:[{stroke:[t,"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 ze(...t){return GL(zx(t))}function Wi(){let t=localStorage.getItem("dataLogin"),e;try{t&&(t=JSON.parse(t),e=t.user)}catch(n){console.error("Error parsing dataLogin from localStorage:",n),t=null}return e}const Kd=C.forwardRef(({className:t,...e},n)=>d.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:ze("s3-explr-ui-breadcrumb",t),...e}));Kd.displayName="Breadcrumb";const Gd=C.forwardRef(({className:t,...e},n)=>d.jsx("ol",{ref:n,className:ze("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",t),...e}));Gd.displayName="BreadcrumbList";const cc=C.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:ze("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",t),...e}));cc.displayName="BreadcrumbItem";const lc=C.forwardRef(({asChild:t,className:e,...n},r)=>{const o=t?qx:"a";return d.jsx(o,{ref:r,className:ze("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",e),...n})});lc.displayName="BreadcrumbLink";const jL=C.forwardRef(({className:t,...e},n)=>d.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ze("font-normal text-foreground","s3-explr-ui-breadcrumb-page",t),...e}));jL.displayName="BreadcrumbPage";const jd=({children:t,className:e,...n})=>d.jsx("li",{role:"presentation","aria-hidden":"true",className:ze("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",e),...n,children:t??d.jsx(Hx,{})});jd.displayName="BreadcrumbSeparator";const nS=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,rS=zx,mg=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return rS(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=e,s=Object.keys(o).map(h=>{const p=n==null?void 0:n[h],g=a==null?void 0:a[h];if(p===null)return null;const w=nS(p)||nS(g);return o[h][w]}),l=n&&Object.entries(n).reduce((h,p)=>{let[g,w]=p;return w===void 0||(h[g]=w),h},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:w,...y}=p;return Object.entries(y).every(x=>{let[v,b]=x;return Array.isArray(b)?b.includes({...a,...l}[v]):{...a,...l}[v]===b})?[...h,g,w]:h},[]);return rS(t,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},oS=mg("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"}}),He=C.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...o},a)=>{const s=r?qx:"button";return d.jsx(s,{className:ze(oS({variant:e,size:n,className:t})),ref:a,...o})});He.displayName="Button";function iS(t){const e=C.useRef({value:t,previous:t});return C.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function vg(t){const[e,n]=C.useState(void 0);return tn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,h=Array.isArray(u)?u[0]:u;s=h.inlineSize,l=h.blockSize}else s=t.offsetWidth,l=t.offsetHeight;n({width:s,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Wd="Checkbox",[WL,$j]=yr(Wd),[qL,yg]=WL(Wd);function YL(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:a,form:s,name:l,onCheckedChange:u,required:h,value:p="on",internal_do_not_use_render:g}=t,[w,y]=ui({prop:n,defaultProp:o??!1,onChange:u,caller:Wd}),[x,v]=C.useState(null),[b,E]=C.useState(null),T=C.useRef(!1),N=x?!!s||!!x.closest("form"):!0,P={checked:w,disabled:a,setChecked:y,control:x,setControl:v,name:l,form:s,value:p,hasConsumerStoppedPropagationRef:T,required:h,defaultChecked:wi(o)?!1:o,isFormControl:N,bubbleInput:b,setBubbleInput:E};return d.jsx(qL,{scope:e,...P,children:JL(g)?g(P):r})}var aS="CheckboxTrigger",sS=C.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},o)=>{const{control:a,value:s,disabled:l,checked:u,required:h,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:w,isFormControl:y,bubbleInput:x}=yg(aS,t),v=rt(o,p),b=C.useRef(u);return C.useEffect(()=>{const E=a==null?void 0:a.form;if(E){const T=()=>g(b.current);return E.addEventListener("reset",T),()=>E.removeEventListener("reset",T)}},[a,g]),d.jsx(mt.button,{type:"button",role:"checkbox","aria-checked":wi(u)?"mixed":u,"aria-required":h,"data-state":fS(u),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:v,onKeyDown:Ue(e,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Ue(n,E=>{g(T=>wi(T)?!0:!T),x&&y&&(w.current=E.isPropagationStopped(),w.current||E.stopPropagation())})})});sS.displayName=aS;var wg=C.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:s,disabled:l,value:u,onCheckedChange:h,form:p,...g}=t;return d.jsx(YL,{__scopeCheckbox:n,checked:o,defaultChecked:a,disabled:l,required:s,onCheckedChange:h,name:r,form:p,value:u,internal_do_not_use_render:({isFormControl:w})=>d.jsxs(d.Fragment,{children:[d.jsx(sS,{...g,ref:e,__scopeCheckbox:n}),w&&d.jsx(uS,{__scopeCheckbox:n})]})})});wg.displayName=Wd;var cS="CheckboxIndicator",lS=C.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...o}=t,a=yg(cS,n);return d.jsx(Ro,{present:r||wi(a.checked)||a.checked===!0,children:d.jsx(mt.span,{"data-state":fS(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:e,style:{pointerEvents:"none",...t.style}})})});lS.displayName=cS;var dS="CheckboxBubbleInput",uS=C.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:s,required:l,disabled:u,name:h,value:p,form:g,bubbleInput:w,setBubbleInput:y}=yg(dS,t),x=rt(n,y),v=iS(a),b=vg(r);C.useEffect(()=>{const T=w;if(!T)return;const N=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(N,"checked").set,D=!o.current;if(v!==a&&_){const H=new Event("click",{bubbles:D});T.indeterminate=wi(a),_.call(T,wi(a)?!1:a),T.dispatchEvent(H)}},[w,v,a,o]);const E=C.useRef(wi(a)?!1:a);return d.jsx(mt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??E.current,required:l,disabled:u,name:h,value:p,form:g,...e,tabIndex:-1,ref:x,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});uS.displayName=dS;function JL(t){return typeof t=="function"}function wi(t){return t==="indeterminate"}function fS(t){return wi(t)?"indeterminate":t?"checked":"unchecked"}const dc=C.forwardRef(({className:t,...e},n)=>d.jsx(wg,{ref:n,className:ze("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",t),...e,children:d.jsx(lS,{className:ze("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:d.jsx($x,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));dc.displayName=wg.displayName;const lr=Qs,uc=lM,QL=dM,hS=C.forwardRef(({className:t,...e},n)=>d.jsx(Ga,{ref:n,className:ze("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",t),...e}));hS.displayName=Ga.displayName;const Vn=C.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(QL,{children:[d.jsx(hS,{}),d.jsxs(ja,{ref:r,className:ze("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",t),...n,children:[e,d.jsxs(kp,{className:ze("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:[d.jsx(lg,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),d.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Vn.displayName=ja.displayName;const Kn=({className:t,...e})=>d.jsx("div",{className:ze("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Kn.displayName="DialogHeader";const Fr=({className:t,...e})=>d.jsx("div",{className:ze("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Fr.displayName="DialogFooter";const Gn=C.forwardRef(({className:t,...e},n)=>d.jsx(Pb,{ref:n,className:ze("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",t),...e}));Gn.displayName=Pb.displayName;const Ci=C.forwardRef(({className:t,...e},n)=>d.jsx(Ob,{ref:n,className:ze("s3-explr-ui-dialog-description text-sm text-muted-foreground",t),...e}));Ci.displayName=Ob.displayName;const jn=C.forwardRef(({className:t,type:e,...n},r)=>d.jsx("input",{type:e,className:ze("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",t),ref:r,...n}));jn.displayName="Input";var XL="Label",pS=C.forwardRef((t,e)=>d.jsx(mt.label,{...t,ref:e,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pS.displayName=XL;var gS=pS;const ZL=mg("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"}}),wr=C.forwardRef(({className:t,variant:e,size:n,...r},o)=>d.jsx(gS,{ref:o,className:ze(ZL({variant:e,size:n}),t),...r}));wr.displayName=gS.displayName;const qd=({className:t,...e})=>d.jsx("nav",{role:"navigation","aria-label":"pagination",className:ze("mx-auto flex w-full justify-center",t),...e});qd.displayName="Pagination";const Yd=C.forwardRef(({className:t,...e},n)=>d.jsx("ul",{ref:n,className:ze("flex flex-row items-center gap-1",t),...e}));Yd.displayName="PaginationContent";const $r=C.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:ze("",t),...e}));$r.displayName="PaginationItem";const Qa=({className:t,isActive:e,size:n="icon",...r})=>d.jsx("a",{"aria-current":e?"page":void 0,className:ze(oS({variant:e?"outline":"ghost",size:n}),t),...r});Qa.displayName="PaginationLink";const Jd=({className:t,...e})=>d.jsxs(Qa,{"aria-label":"Go to previous page",size:"default",className:ze("gap-1 pl-2.5",t),...e,children:[d.jsx(BD,{className:"h-4 w-4"}),d.jsx("span",{children:"Previous"})]});Jd.displayName="PaginationPrevious";const Qd=({className:t,...e})=>d.jsxs(Qa,{"aria-label":"Go to next page",size:"default",className:ze("gap-1 pr-2.5",t),...e,children:[d.jsx("span",{children:"Next"}),d.jsx(Hx,{className:"h-4 w-4"})]});Qd.displayName="PaginationNext";const Xd=({className:t,...e})=>d.jsxs("span",{"aria-hidden":!0,className:ze("flex h-9 w-9 items-center justify-center",t),...e,children:[d.jsx(zD,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"More pages"})]});Xd.displayName="PaginationEllipsis";const Zd=C.forwardRef(({className:t,...e},n)=>d.jsx("div",{className:ze("relative w-full overflow-auto","s3-explr-ui-table-container"),children:d.jsx("table",{ref:n,className:ze("w-full caption-bottom text-sm","s3-explr-ui-table",t),...e})}));Zd.displayName="Table";const eu=C.forwardRef(({className:t,...e},n)=>d.jsx("thead",{ref:n,className:ze("[&_tr]:border-b","s3-explr-ui-table-header",t),...e}));eu.displayName="TableHeader";const tu=C.forwardRef(({className:t,...e},n)=>d.jsx("tbody",{ref:n,className:ze("[&_tr:last-child]:border-0","s3-explr-ui-table-body",t),...e}));tu.displayName="TableBody";const eF=C.forwardRef(({className:t,...e},n)=>d.jsx("tfoot",{ref:n,className:ze("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",t),...e}));eF.displayName="TableFooter";const Hr=C.forwardRef(({className:t,...e},n)=>d.jsx("tr",{ref:n,className:ze("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",t),...e}));Hr.displayName="TableRow";const po=C.forwardRef(({className:t,...e},n)=>d.jsx("th",{ref:n,className:ze("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",t),...e}));po.displayName="TableHead";const Wn=C.forwardRef(({className:t,...e},n)=>d.jsx("td",{ref:n,className:ze("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",t),...e}));Wn.displayName="TableCell";const tF=C.forwardRef(({className:t,...e},n)=>d.jsx("caption",{ref:n,className:ze("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",t),...e}));tF.displayName="TableCaption";function mS(t){const e=nF(t),n=C.forwardRef((r,o)=>{const{children:a,...s}=r,l=C.Children.toArray(a),u=l.find(oF);if(u){const h=u.props.children,p=l.map(g=>g===u?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:g);return d.jsx(e,{...s,ref:o,children:C.isValidElement(h)?C.cloneElement(h,void 0,p):null})}return d.jsx(e,{...s,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}function nF(t){const e=C.forwardRef((n,r)=>{const{children:o,...a}=n,s=C.isValidElement(o)?aF(o):void 0,l=rt(s,r);if(C.isValidElement(o)){const u=iF(a,o.props);return o.type!==C.Fragment&&(u.ref=l),C.cloneElement(o,u)}return C.Children.count(o)>1?C.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var rF=Symbol("radix.slottable");function oF(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===rF}function iF(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function aF(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function sF(t){const e=t+"CollectionProvider",[n,r]=yr(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:b,children:E}=v,T=M.useRef(null),N=M.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:N,collectionRef:T,children:E})};s.displayName=e;const l=t+"CollectionSlot",u=mS(l),h=M.forwardRef((v,b)=>{const{scope:E,children:T}=v,N=a(l,E),P=rt(b,N.collectionRef);return d.jsx(u,{ref:P,children:T})});h.displayName=l;const p=t+"CollectionItemSlot",g="data-radix-collection-item",w=mS(p),y=M.forwardRef((v,b)=>{const{scope:E,children:T,...N}=v,P=M.useRef(null),_=rt(b,P),D=a(p,E);return M.useEffect(()=>(D.itemMap.set(P,{ref:P,...N}),()=>void D.itemMap.delete(P))),d.jsx(w,{[g]:"",ref:_,children:T})});y.displayName=p;function x(v){const b=a(t+"CollectionConsumer",v);return M.useCallback(()=>{const T=b.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((D,H)=>N.indexOf(D.ref.current)-N.indexOf(H.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},x,r]}var cF=C.createContext(void 0);function Cg(t){const e=C.useContext(cF);return t||e||"ltr"}var bg="rovingFocusGroup.onEntryFocus",lF={bubbles:!1,cancelable:!0},fc="RovingFocusGroup",[xg,vS,dF]=sF(fc),[uF,yS]=yr(fc,[dF]),[fF,hF]=uF(fc),wS=C.forwardRef((t,e)=>d.jsx(xg.Provider,{scope:t.__scopeRovingFocusGroup,children:d.jsx(xg.Slot,{scope:t.__scopeRovingFocusGroup,children:d.jsx(pF,{...t,ref:e})})}));wS.displayName=fc;var pF=C.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...g}=t,w=C.useRef(null),y=rt(e,w),x=Cg(a),[v,b]=ui({prop:s,defaultProp:l??null,onChange:u,caller:fc}),[E,T]=C.useState(!1),N=gn(h),P=vS(n),_=C.useRef(!1),[D,H]=C.useState(0);return C.useEffect(()=>{const K=w.current;if(K)return K.addEventListener(bg,N),()=>K.removeEventListener(bg,N)},[N]),d.jsx(fF,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:v,onItemFocus:C.useCallback(K=>b(K),[b]),onItemShiftTab:C.useCallback(()=>T(!0),[]),onFocusableItemAdd:C.useCallback(()=>H(K=>K+1),[]),onFocusableItemRemove:C.useCallback(()=>H(K=>K-1),[]),children:d.jsx(mt.div,{tabIndex:E||D===0?-1:0,"data-orientation":r,...g,ref:y,style:{outline:"none",...t.style},onMouseDown:Ue(t.onMouseDown,()=>{_.current=!0}),onFocus:Ue(t.onFocus,K=>{const ee=!_.current;if(K.target===K.currentTarget&&ee&&!E){const W=new CustomEvent(bg,lF);if(K.currentTarget.dispatchEvent(W),!W.defaultPrevented){const de=P().filter(Y=>Y.focusable),se=de.find(Y=>Y.active),fe=de.find(Y=>Y.id===v),Z=[se,fe,...de].filter(Boolean).map(Y=>Y.ref.current);xS(Z,p)}}_.current=!1}),onBlur:Ue(t.onBlur,()=>T(!1))})})}),CS="RovingFocusGroupItem",bS=C.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...l}=t,u=Mo(),h=a||u,p=hF(CS,n),g=p.currentTabStopId===h,w=vS(n),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:v}=p;return C.useEffect(()=>{if(r)return y(),()=>x()},[r,y,x]),d.jsx(xg.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:d.jsx(mt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...l,ref:e,onMouseDown:Ue(t.onMouseDown,b=>{r?p.onItemFocus(h):b.preventDefault()}),onFocus:Ue(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:Ue(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){p.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const E=vF(b,p.orientation,p.dir);if(E!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let N=w().filter(P=>P.focusable).map(P=>P.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const P=N.indexOf(b.currentTarget);N=p.loop?yF(N,P+1):N.slice(P+1)}setTimeout(()=>xS(N))}}),children:typeof s=="function"?s({isCurrentTabStop:g,hasTabStop:v!=null}):s})})});bS.displayName=CS;var gF={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mF(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function vF(t,e,n){const r=mF(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gF[r]}function xS(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function yF(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var wF=wS,CF=bS,nu="Tabs",[bF,Hj]=yr(nu,[yS]),SS=yS(),[xF,Sg]=bF(nu),_S=C.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:l,activationMode:u="automatic",...h}=t,p=Cg(l),[g,w]=ui({prop:r,onChange:o,defaultProp:a??"",caller:nu});return d.jsx(xF,{scope:n,baseId:Mo(),value:g,onValueChange:w,orientation:s,dir:p,activationMode:u,children:d.jsx(mt.div,{dir:p,"data-orientation":s,...h,ref:e})})});_S.displayName=nu;var ES="TabsList",TS=C.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,a=Sg(ES,n),s=SS(n);return d.jsx(wF,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:d.jsx(mt.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:e})})});TS.displayName=ES;var AS="TabsTrigger",IS=C.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=t,s=Sg(AS,n),l=SS(n),u=PS(s.baseId,r),h=OS(s.baseId,r),p=r===s.value;return d.jsx(CF,{asChild:!0,...l,focusable:!o,active:p,children:d.jsx(mt.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":h,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...a,ref:e,onMouseDown:Ue(t.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?s.onValueChange(r):g.preventDefault()}),onKeyDown:Ue(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&s.onValueChange(r)}),onFocus:Ue(t.onFocus,()=>{const g=s.activationMode!=="manual";!p&&!o&&g&&s.onValueChange(r)})})})});IS.displayName=AS;var kS="TabsContent",NS=C.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...s}=t,l=Sg(kS,n),u=PS(l.baseId,r),h=OS(l.baseId,r),p=r===l.value,g=C.useRef(p);return C.useEffect(()=>{const w=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(w)},[]),d.jsx(Ro,{present:o||p,children:({present:w})=>d.jsx(mt.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!w,id:h,tabIndex:0,...s,ref:e,style:{...t.style,animationDuration:g.current?"0s":void 0},children:w&&a})})});NS.displayName=kS;function PS(t,e){return`${t}-trigger-${e}`}function OS(t,e){return`${t}-content-${e}`}var SF=_S,MS=TS,RS=IS,DS=NS;const _g=SF,ru=C.forwardRef(({className:t,...e},n)=>d.jsx(MS,{ref:n,className:ze("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));ru.displayName=MS.displayName;const qi=C.forwardRef(({className:t,...e},n)=>d.jsx(RS,{ref:n,className:ze("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",t),...e}));qi.displayName=RS.displayName;const Yi=C.forwardRef(({className:t,...e},n)=>d.jsx(DS,{ref:n,className:ze("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Yi.displayName=DS.displayName;const hc=C.forwardRef(({className:t,...e},n)=>d.jsx("textarea",{className:ze("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",t),ref:n,...e}));hc.displayName="Textarea";function LS(t){const e=_F(t),n=C.forwardRef((r,o)=>{const{children:a,...s}=r,l=C.Children.toArray(a),u=l.find(TF);if(u){const h=u.props.children,p=l.map(g=>g===u?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:g);return d.jsx(e,{...s,ref:o,children:C.isValidElement(h)?C.cloneElement(h,void 0,p):null})}return d.jsx(e,{...s,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}function _F(t){const e=C.forwardRef((n,r)=>{const{children:o,...a}=n,s=C.isValidElement(o)?IF(o):void 0,l=rt(s,r);if(C.isValidElement(o)){const u=AF(a,o.props);return o.type!==C.Fragment&&(u.ref=l),C.cloneElement(o,u)}return C.Children.count(o)>1?C.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var EF=Symbol("radix.slottable");function TF(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===EF}function AF(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function IF(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function kF(t){const e=t+"CollectionProvider",[n,r]=yr(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:b,children:E}=v,T=M.useRef(null),N=M.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:N,collectionRef:T,children:E})};s.displayName=e;const l=t+"CollectionSlot",u=LS(l),h=M.forwardRef((v,b)=>{const{scope:E,children:T}=v,N=a(l,E),P=rt(b,N.collectionRef);return d.jsx(u,{ref:P,children:T})});h.displayName=l;const p=t+"CollectionItemSlot",g="data-radix-collection-item",w=LS(p),y=M.forwardRef((v,b)=>{const{scope:E,children:T,...N}=v,P=M.useRef(null),_=rt(b,P),D=a(p,E);return M.useEffect(()=>(D.itemMap.set(P,{ref:P,...N}),()=>void D.itemMap.delete(P))),d.jsx(w,{[g]:"",ref:_,children:T})});y.displayName=p;function x(v){const b=a(t+"CollectionConsumer",v);return M.useCallback(()=>{const T=b.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((D,H)=>N.indexOf(D.ref.current)-N.indexOf(H.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},x,r]}var NF=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),PF="VisuallyHidden",Eg=C.forwardRef((t,e)=>d.jsx(mt.span,{...t,ref:e,style:{...NF,...t.style}}));Eg.displayName=PF;var Tg="ToastProvider",[Ag,OF,MF]=kF("Toast"),[FS,Uj]=yr("Toast",[MF]),[RF,ou]=FS(Tg),$S=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:s}=t,[l,u]=C.useState(null),[h,p]=C.useState(0),g=C.useRef(!1),w=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Tg}\`. Expected non-empty \`string\`.`),d.jsx(Ag.Provider,{scope:e,children:d.jsx(RF,{scope:e,label:n,duration:r,swipeDirection:o,swipeThreshold:a,toastCount:h,viewport:l,onViewportChange:u,onToastAdd:C.useCallback(()=>p(y=>y+1),[]),onToastRemove:C.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:w,children:s})})};$S.displayName=Tg;var HS="ToastViewport",DF=["F8"],Ig="toast.viewportPause",kg="toast.viewportResume",US=C.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=DF,label:o="Notifications ({hotkey})",...a}=t,s=ou(HS,n),l=OF(n),u=C.useRef(null),h=C.useRef(null),p=C.useRef(null),g=C.useRef(null),w=rt(e,g,s.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=s.toastCount>0;C.useEffect(()=>{const b=E=>{var N;r.length!==0&&r.every(P=>E[P]||E.code===P)&&((N=g.current)==null||N.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),C.useEffect(()=>{const b=u.current,E=g.current;if(x&&b&&E){const T=()=>{if(!s.isClosePausedRef.current){const D=new CustomEvent(Ig);E.dispatchEvent(D),s.isClosePausedRef.current=!0}},N=()=>{if(s.isClosePausedRef.current){const D=new CustomEvent(kg);E.dispatchEvent(D),s.isClosePausedRef.current=!1}},P=D=>{!b.contains(D.relatedTarget)&&N()},_=()=>{b.contains(document.activeElement)||N()};return b.addEventListener("focusin",T),b.addEventListener("focusout",P),b.addEventListener("pointermove",T),b.addEventListener("pointerleave",_),window.addEventListener("blur",T),window.addEventListener("focus",N),()=>{b.removeEventListener("focusin",T),b.removeEventListener("focusout",P),b.removeEventListener("pointermove",T),b.removeEventListener("pointerleave",_),window.removeEventListener("blur",T),window.removeEventListener("focus",N)}}},[x,s.isClosePausedRef]);const v=C.useCallback(({tabbingDirection:b})=>{const T=l().map(N=>{const P=N.ref.current,_=[P,...qF(P)];return b==="forwards"?_:_.reverse()});return(b==="forwards"?T.reverse():T).flat()},[l]);return C.useEffect(()=>{const b=g.current;if(b){const E=T=>{var _,D,H;const N=T.altKey||T.ctrlKey||T.metaKey;if(T.key==="Tab"&&!N){const K=document.activeElement,ee=T.shiftKey;if(T.target===b&&ee){(_=h.current)==null||_.focus();return}const se=v({tabbingDirection:ee?"backwards":"forwards"}),fe=se.findIndex(q=>q===K);Og(se.slice(fe+1))?T.preventDefault():ee?(D=h.current)==null||D.focus():(H=p.current)==null||H.focus()}};return b.addEventListener("keydown",E),()=>b.removeEventListener("keydown",E)}},[l,v]),d.jsxs(XO,{ref:u,role:"region","aria-label":o.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&d.jsx(Ng,{ref:h,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"forwards"});Og(b)}}),d.jsx(Ag.Slot,{scope:n,children:d.jsx(mt.ol,{tabIndex:-1,...a,ref:w})}),x&&d.jsx(Ng,{ref:p,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"backwards"});Og(b)}})]})});US.displayName=HS;var BS="ToastFocusProxy",Ng=C.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=t,a=ou(BS,n);return d.jsx(Eg,{"aria-hidden":!0,tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:s=>{var h;const l=s.relatedTarget;!((h=a.viewport)!=null&&h.contains(l))&&r()}})});Ng.displayName=BS;var pc="Toast",LF="toast.swipeStart",FF="toast.swipeMove",$F="toast.swipeCancel",HF="toast.swipeEnd",zS=C.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:a,...s}=t,[l,u]=ui({prop:r,defaultProp:o??!0,onChange:a,caller:pc});return d.jsx(Ro,{present:n||l,children:d.jsx(zF,{open:l,...s,ref:e,onClose:()=>u(!1),onPause:gn(t.onPause),onResume:gn(t.onResume),onSwipeStart:Ue(t.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ue(t.onSwipeMove,h=>{const{x:p,y:g}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Ue(t.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ue(t.onSwipeEnd,h=>{const{x:p,y:g}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});zS.displayName=pc;var[UF,BF]=FS(pc,{onClose(){}}),zF=C.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:a,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:h,onSwipeStart:p,onSwipeMove:g,onSwipeCancel:w,onSwipeEnd:y,...x}=t,v=ou(pc,n),[b,E]=C.useState(null),T=rt(e,q=>E(q)),N=C.useRef(null),P=C.useRef(null),_=o||v.duration,D=C.useRef(0),H=C.useRef(_),K=C.useRef(0),{onToastAdd:ee,onToastRemove:W}=v,de=gn(()=>{var Z;(b==null?void 0:b.contains(document.activeElement))&&((Z=v.viewport)==null||Z.focus()),s()}),se=C.useCallback(q=>{!q||q===1/0||(window.clearTimeout(K.current),D.current=new Date().getTime(),K.current=window.setTimeout(de,q))},[de]);C.useEffect(()=>{const q=v.viewport;if(q){const Z=()=>{se(H.current),h==null||h()},Y=()=>{const oe=new Date().getTime()-D.current;H.current=H.current-oe,window.clearTimeout(K.current),u==null||u()};return q.addEventListener(Ig,Y),q.addEventListener(kg,Z),()=>{q.removeEventListener(Ig,Y),q.removeEventListener(kg,Z)}}},[v.viewport,_,u,h,se]),C.useEffect(()=>{a&&!v.isClosePausedRef.current&&se(_)},[a,_,v.isClosePausedRef,se]),C.useEffect(()=>(ee(),()=>W()),[ee,W]);const fe=C.useMemo(()=>b?YS(b):null,[b]);return v.viewport?d.jsxs(d.Fragment,{children:[fe&&d.jsx(VF,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:fe}),d.jsx(UF,{scope:n,onClose:de,children:Aa.createPortal(d.jsx(Ag.ItemSlot,{scope:n,children:d.jsx(QO,{asChild:!0,onEscapeKeyDown:Ue(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||de(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(mt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":v.swipeDirection,...x,ref:T,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ue(t.onKeyDown,q=>{q.key==="Escape"&&(l==null||l(q.nativeEvent),q.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,de()))}),onPointerDown:Ue(t.onPointerDown,q=>{q.button===0&&(N.current={x:q.clientX,y:q.clientY})}),onPointerMove:Ue(t.onPointerMove,q=>{if(!N.current)return;const Z=q.clientX-N.current.x,Y=q.clientY-N.current.y,oe=!!P.current,Q=["left","right"].includes(v.swipeDirection),X=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,$=Q?X(0,Z):0,te=Q?0:X(0,Y),_e=q.pointerType==="touch"?10:2,ke={x:$,y:te},xe={originalEvent:q,delta:ke};oe?(P.current=ke,iu(FF,g,xe,{discrete:!1})):JS(ke,v.swipeDirection,_e)?(P.current=ke,iu(LF,p,xe,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(Z)>_e||Math.abs(Y)>_e)&&(N.current=null)}),onPointerUp:Ue(t.onPointerUp,q=>{const Z=P.current,Y=q.target;if(Y.hasPointerCapture(q.pointerId)&&Y.releasePointerCapture(q.pointerId),P.current=null,N.current=null,Z){const oe=q.currentTarget,Q={originalEvent:q,delta:Z};JS(Z,v.swipeDirection,v.swipeThreshold)?iu(HF,y,Q,{discrete:!0}):iu($F,w,Q,{discrete:!0}),oe.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),VF=t=>{const{__scopeToast:e,children:n,...r}=t,o=ou(pc,e),[a,s]=C.useState(!1),[l,u]=C.useState(!1);return jF(()=>s(!0)),C.useEffect(()=>{const h=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(h)},[]),l?null:d.jsx(ud,{asChild:!0,children:d.jsx(Eg,{...r,children:a&&d.jsxs(d.Fragment,{children:[o.label," ",n]})})})},KF="ToastTitle",VS=C.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(mt.div,{...r,ref:e})});VS.displayName=KF;var GF="ToastDescription",KS=C.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(mt.div,{...r,ref:e})});KS.displayName=GF;var GS="ToastAction",jS=C.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?d.jsx(qS,{altText:n,asChild:!0,children:d.jsx(Pg,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${GS}\`. Expected non-empty \`string\`.`),null)});jS.displayName=GS;var WS="ToastClose",Pg=C.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,o=BF(WS,n);return d.jsx(qS,{asChild:!0,children:d.jsx(mt.button,{type:"button",...r,ref:e,onClick:Ue(t.onClick,o.onClose)})})});Pg.displayName=WS;var qS=C.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...o}=t;return d.jsx(mt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:e})});function YS(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),WF(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!o)if(a){const s=r.dataset.radixToastAnnounceAlt;s&&e.push(s)}else e.push(...YS(r))}}),e}function iu(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?$C(o,a):o.dispatchEvent(a)}var JS=(t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),a=r>o;return e==="left"||e==="right"?a&&r>n:!a&&o>n};function jF(t=()=>{}){const e=gn(t);tn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function WF(t){return t.nodeType===t.ELEMENT_NODE}function qF(t){const e=[],n=document.createTreeWalker(t,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();)e.push(n.currentNode);return e}function Og(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var YF=$S,QS=US,XS=zS,ZS=VS,e_=KS,t_=jS,n_=Pg;const JF=YF,r_=C.forwardRef(({className:t,...e},n)=>d.jsx(QS,{ref:n,className:ze("s3-explr-ui-toast-viewport fixed top-0 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] z-[10000]",t),...e}));r_.displayName=QS.displayName;const QF=mg("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"}}),o_=C.forwardRef(({className:t,variant:e,...n},r)=>d.jsx(XS,{ref:r,className:ze(QF({variant:e}),t),...n}));o_.displayName=XS.displayName;const XF=C.forwardRef(({className:t,...e},n)=>d.jsx(t_,{ref:n,className:ze("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",t),...e}));XF.displayName=t_.displayName;const i_=C.forwardRef(({className:t,...e},n)=>d.jsx(n_,{ref:n,className:ze("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity duration-200 ease-in-out 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 font-bold",t),"toast-close":"",...e,children:d.jsx(lg,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));i_.displayName=n_.displayName;const a_=C.forwardRef(({className:t,...e},n)=>d.jsx(ZS,{ref:n,className:ze("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",t),...e}));a_.displayName=ZS.displayName;const s_=C.forwardRef(({className:t,...e},n)=>d.jsx(e_,{ref:n,className:ze("text-sm opacity-90 font-bold",t),...e}));s_.displayName=e_.displayName;const ZF=1,e2=1e6;let Mg=0;function t2(){return Mg=(Mg+1)%Number.MAX_SAFE_INTEGER,Mg.toString()}const Rg=new Map,c_=t=>{if(Rg.has(t))return;const e=setTimeout(()=>{Rg.delete(t),gc({type:"REMOVE_TOAST",toastId:t})},e2);Rg.set(t,e)},n2=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,ZF)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?c_(n):t.toasts.forEach(r=>{c_(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},au=[];let su={toasts:[]};function gc(t){su=n2(su,t),au.forEach(e=>{e(su)})}function r2({...t}){const e=t2(),n=o=>gc({type:"UPDATE_TOAST",toast:{...o,id:e}}),r=()=>gc({type:"DISMISS_TOAST",toastId:e});return gc({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}function mc(){const[t,e]=C.useState(su);return C.useEffect(()=>(au.push(e),()=>{const n=au.indexOf(e);n>-1&&au.splice(n,1)}),[t]),{...t,toast:r2,dismiss:n=>gc({type:"DISMISS_TOAST",toastId:n})}}function l_(){const{toasts:t}=mc();return d.jsxs(JF,{children:[t.map(function({id:e,title:n,description:r,action:o,...a}){return d.jsxs(o_,{...a,className:`s3-explr-ui-toast ${a.className||""}`,children:[d.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&d.jsx(a_,{className:"s3-explr-ui-toast-title",children:n}),r&&d.jsx(s_,{className:"s3-explr-ui-toast-description",children:r})]}),o&&d.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),d.jsx(i_,{className:"s3-explr-ui-toast-close"})]},e)}),d.jsx(r_,{className:"s3-explr-ui-toast-viewport"})]})}const o2=["top","right","bottom","left"],bi=Math.min,dr=Math.max,cu=Math.round,lu=Math.floor,go=t=>({x:t,y:t}),i2={left:"right",right:"left",bottom:"top",top:"bottom"},a2={start:"end",end:"start"};function Dg(t,e,n){return dr(t,bi(e,n))}function $o(t,e){return typeof t=="function"?t(e):t}function Ho(t){return t.split("-")[0]}function Xa(t){return t.split("-")[1]}function Lg(t){return t==="x"?"y":"x"}function Fg(t){return t==="y"?"height":"width"}function Uo(t){return["top","bottom"].includes(Ho(t))?"y":"x"}function $g(t){return Lg(Uo(t))}function s2(t,e,n){n===void 0&&(n=!1);const r=Xa(t),o=$g(t),a=Fg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=du(s)),[s,du(s)]}function c2(t){const e=du(t);return[Hg(t),e,Hg(e)]}function Hg(t){return t.replace(/start|end/g,e=>a2[e])}function l2(t,e,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?a:s;default:return[]}}function d2(t,e,n,r){const o=Xa(t);let a=l2(Ho(t),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),e&&(a=a.concat(a.map(Hg)))),a}function du(t){return t.replace(/left|right|bottom|top/g,e=>i2[e])}function u2(t){return{top:0,right:0,bottom:0,left:0,...t}}function d_(t){return typeof t!="number"?u2(t):{top:t,right:t,bottom:t,left:t}}function uu(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function u_(t,e,n){let{reference:r,floating:o}=t;const a=Uo(e),s=$g(e),l=Fg(s),u=Ho(e),h=a==="y",p=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,w=r[l]/2-o[l]/2;let y;switch(u){case"top":y={x:p,y:r.y-o.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:g};break;case"left":y={x:r.x-o.width,y:g};break;default:y={x:r.x,y:r.y}}switch(Xa(e)){case"start":y[s]-=w*(n&&h?-1:1);break;case"end":y[s]+=w*(n&&h?-1:1);break}return y}const f2=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,l=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(e));let h=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:g}=u_(h,r,u),w=r,y={},x=0;for(let v=0;v<l.length;v++){const{name:b,fn:E}=l[v],{x:T,y:N,data:P,reset:_}=await E({x:p,y:g,initialPlacement:r,placement:w,strategy:o,middlewareData:y,rects:h,platform:s,elements:{reference:t,floating:e}});p=T??p,g=N??g,y={...y,[b]:{...y[b],...P}},_&&x<=50&&(x++,typeof _=="object"&&(_.placement&&(w=_.placement),_.rects&&(h=_.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):_.rects),{x:p,y:g}=u_(h,w,u)),v=-1)}return{x:p,y:g,placement:w,strategy:o,middlewareData:y}};async function vc(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:a,rects:s,elements:l,strategy:u}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:w=!1,padding:y=0}=$o(e,t),x=d_(y),b=l[w?g==="floating"?"reference":"floating":g],E=uu(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:h,rootBoundary:p,strategy:u})),T=g==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),P=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},_=uu(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:T,offsetParent:N,strategy:u}):T);return{top:(E.top-_.top+x.top)/P.y,bottom:(_.bottom-E.bottom+x.bottom)/P.y,left:(E.left-_.left+x.left)/P.x,right:(_.right-E.right+x.right)/P.x}}const h2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:a,platform:s,elements:l,middlewareData:u}=e,{element:h,padding:p=0}=$o(t,e)||{};if(h==null)return{};const g=d_(p),w={x:n,y:r},y=$g(o),x=Fg(y),v=await s.getDimensions(h),b=y==="y",E=b?"top":"left",T=b?"bottom":"right",N=b?"clientHeight":"clientWidth",P=a.reference[x]+a.reference[y]-w[y]-a.floating[x],_=w[y]-a.reference[y],D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h));let H=D?D[N]:0;(!H||!await(s.isElement==null?void 0:s.isElement(D)))&&(H=l.floating[N]||a.floating[x]);const K=P/2-_/2,ee=H/2-v[x]/2-1,W=bi(g[E],ee),de=bi(g[T],ee),se=W,fe=H-v[x]-de,q=H/2-v[x]/2+K,Z=Dg(se,q,fe),Y=!u.arrow&&Xa(o)!=null&&q!==Z&&a.reference[x]/2-(q<se?W:de)-v[x]/2<0,oe=Y?q<se?q-se:q-fe:0;return{[y]:w[y]+oe,data:{[y]:Z,centerOffset:q-Z-oe,...Y&&{alignmentOffset:oe}},reset:Y}}}),p2=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:l,platform:u,elements:h}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:w,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=$o(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const E=Ho(o),T=Uo(l),N=Ho(l)===l,P=await(u.isRTL==null?void 0:u.isRTL(h.floating)),_=w||(N||!v?[du(l)]:c2(l)),D=x!=="none";!w&&D&&_.push(...d2(l,v,x,P));const H=[l,..._],K=await vc(e,b),ee=[];let W=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&ee.push(K[E]),g){const Z=s2(o,s,P);ee.push(K[Z[0]],K[Z[1]])}if(W=[...W,{placement:o,overflows:ee}],!ee.every(Z=>Z<=0)){var de,se;const Z=(((de=a.flip)==null?void 0:de.index)||0)+1,Y=H[Z];if(Y){var fe;const Q=g==="alignment"?T!==Uo(Y):!1,X=((fe=W[0])==null?void 0:fe.overflows[0])>0;if(!Q||X)return{data:{index:Z,overflows:W},reset:{placement:Y}}}let oe=(se=W.filter(Q=>Q.overflows[0]<=0).sort((Q,X)=>Q.overflows[1]-X.overflows[1])[0])==null?void 0:se.placement;if(!oe)switch(y){case"bestFit":{var q;const Q=(q=W.filter(X=>{if(D){const $=Uo(X.placement);return $===T||$==="y"}return!0}).map(X=>[X.placement,X.overflows.filter($=>$>0).reduce(($,te)=>$+te,0)]).sort((X,$)=>X[1]-$[1])[0])==null?void 0:q[0];Q&&(oe=Q);break}case"initialPlacement":oe=l;break}if(o!==oe)return{reset:{placement:oe}}}return{}}}};function f_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function h_(t){return o2.some(e=>t[e]>=0)}const g2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=$o(t,e);switch(r){case"referenceHidden":{const a=await vc(e,{...o,elementContext:"reference"}),s=f_(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:h_(s)}}}case"escaped":{const a=await vc(e,{...o,altBoundary:!0}),s=f_(a,n.floating);return{data:{escapedOffsets:s,escaped:h_(s)}}}default:return{}}}}};async function m2(t,e){const{placement:n,platform:r,elements:o}=t,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ho(n),l=Xa(n),u=Uo(n)==="y",h=["left","top"].includes(s)?-1:1,p=a&&u?-1:1,g=$o(e,t);let{mainAxis:w,crossAxis:y,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof x=="number"&&(y=l==="end"?x*-1:x),u?{x:y*p,y:w*h}:{x:w*h,y:y*p}}const v2=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:a,placement:s,middlewareData:l}=e,u=await m2(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:s}}}}},y2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x:E,y:T}=b;return{x:E,y:T}}},...u}=$o(t,e),h={x:n,y:r},p=await vc(e,u),g=Uo(Ho(o)),w=Lg(g);let y=h[w],x=h[g];if(a){const b=w==="y"?"top":"left",E=w==="y"?"bottom":"right",T=y+p[b],N=y-p[E];y=Dg(T,y,N)}if(s){const b=g==="y"?"top":"left",E=g==="y"?"bottom":"right",T=x+p[b],N=x-p[E];x=Dg(T,x,N)}const v=l.fn({...e,[w]:y,[g]:x});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[w]:a,[g]:s}}}}}},w2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=e,{offset:l=0,mainAxis:u=!0,crossAxis:h=!0}=$o(t,e),p={x:n,y:r},g=Uo(o),w=Lg(g);let y=p[w],x=p[g];const v=$o(l,e),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const N=w==="y"?"height":"width",P=a.reference[w]-a.floating[N]+b.mainAxis,_=a.reference[w]+a.reference[N]-b.mainAxis;y<P?y=P:y>_&&(y=_)}if(h){var E,T;const N=w==="y"?"width":"height",P=["top","left"].includes(Ho(o)),_=a.reference[g]-a.floating[N]+(P&&((E=s.offset)==null?void 0:E[g])||0)+(P?0:b.crossAxis),D=a.reference[g]+a.reference[N]+(P?0:((T=s.offset)==null?void 0:T[g])||0)-(P?b.crossAxis:0);x<_?x=_:x>D&&(x=D)}return{[w]:y,[g]:x}}}},C2=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:a,platform:s,elements:l}=e,{apply:u=()=>{},...h}=$o(t,e),p=await vc(e,h),g=Ho(o),w=Xa(o),y=Uo(o)==="y",{width:x,height:v}=a.floating;let b,E;g==="top"||g==="bottom"?(b=g,E=w===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(E=g,b=w==="end"?"top":"bottom");const T=v-p.top-p.bottom,N=x-p.left-p.right,P=bi(v-p[b],T),_=bi(x-p[E],N),D=!e.middlewareData.shift;let H=P,K=_;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(K=N),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(H=T),D&&!w){const W=dr(p.left,0),de=dr(p.right,0),se=dr(p.top,0),fe=dr(p.bottom,0);y?K=x-2*(W!==0||de!==0?W+de:dr(p.left,p.right)):H=v-2*(se!==0||fe!==0?se+fe:dr(p.top,p.bottom))}await u({...e,availableWidth:K,availableHeight:H});const ee=await s.getDimensions(l.floating);return x!==ee.width||v!==ee.height?{reset:{rects:!0}}:{}}}};function fu(){return typeof window<"u"}function Za(t){return p_(t)?(t.nodeName||"").toLowerCase():"#document"}function ur(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function mo(t){var e;return(e=(p_(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function p_(t){return fu()?t instanceof Node||t instanceof ur(t).Node:!1}function Ur(t){return fu()?t instanceof Element||t instanceof ur(t).Element:!1}function vo(t){return fu()?t instanceof HTMLElement||t instanceof ur(t).HTMLElement:!1}function g_(t){return!fu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ur(t).ShadowRoot}function yc(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Br(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function b2(t){return["table","td","th"].includes(Za(t))}function hu(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Ug(t){const e=Bg(),n=Ur(t)?Br(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function x2(t){let e=xi(t);for(;vo(e)&&!es(e);){if(Ug(e))return e;if(hu(e))return null;e=xi(e)}return null}function Bg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function es(t){return["html","body","#document"].includes(Za(t))}function Br(t){return ur(t).getComputedStyle(t)}function pu(t){return Ur(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xi(t){if(Za(t)==="html")return t;const e=t.assignedSlot||t.parentNode||g_(t)&&t.host||mo(t);return g_(e)?e.host:e}function m_(t){const e=xi(t);return es(e)?t.ownerDocument?t.ownerDocument.body:t.body:vo(e)&&yc(e)?e:m_(e)}function wc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=m_(t),a=o===((r=t.ownerDocument)==null?void 0:r.body),s=ur(o);if(a){const l=zg(s);return e.concat(s,s.visualViewport||[],yc(o)?o:[],l&&n?wc(l):[])}return e.concat(o,wc(o,[],n))}function zg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function v_(t){const e=Br(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=vo(t),a=o?t.offsetWidth:n,s=o?t.offsetHeight:r,l=cu(n)!==a||cu(r)!==s;return l&&(n=a,r=s),{width:n,height:r,$:l}}function Vg(t){return Ur(t)?t:t.contextElement}function ts(t){const e=Vg(t);if(!vo(e))return go(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:a}=v_(e);let s=(a?cu(n.width):n.width)/r,l=(a?cu(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const S2=go(0);function y_(t){const e=ur(t);return!Bg()||!e.visualViewport?S2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ur(t)?!1:e}function Ji(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),a=Vg(t);let s=go(1);e&&(r?Ur(r)&&(s=ts(r)):s=ts(t));const l=_2(a,n,r)?y_(a):go(0);let u=(o.left+l.x)/s.x,h=(o.top+l.y)/s.y,p=o.width/s.x,g=o.height/s.y;if(a){const w=ur(a),y=r&&Ur(r)?ur(r):r;let x=w,v=zg(x);for(;v&&r&&y!==x;){const b=ts(v),E=v.getBoundingClientRect(),T=Br(v),N=E.left+(v.clientLeft+parseFloat(T.paddingLeft))*b.x,P=E.top+(v.clientTop+parseFloat(T.paddingTop))*b.y;u*=b.x,h*=b.y,p*=b.x,g*=b.y,u+=N,h+=P,x=ur(v),v=zg(x)}}return uu({width:p,height:g,x:u,y:h})}function Kg(t,e){const n=pu(t).scrollLeft;return e?e.left+n:Ji(mo(t)).left+n}function w_(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),o=r.left+e.scrollLeft-(n?0:Kg(t,r)),a=r.top+e.scrollTop;return{x:o,y:a}}function E2(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const a=o==="fixed",s=mo(r),l=e?hu(e.floating):!1;if(r===s||l&&a)return n;let u={scrollLeft:0,scrollTop:0},h=go(1);const p=go(0),g=vo(r);if((g||!g&&!a)&&((Za(r)!=="body"||yc(s))&&(u=pu(r)),vo(r))){const y=Ji(r);h=ts(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const w=s&&!g&&!a?w_(s,u,!0):go(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-u.scrollLeft*h.x+p.x+w.x,y:n.y*h.y-u.scrollTop*h.y+p.y+w.y}}function T2(t){return Array.from(t.getClientRects())}function A2(t){const e=mo(t),n=pu(t),r=t.ownerDocument.body,o=dr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=dr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Kg(t);const l=-n.scrollTop;return Br(r).direction==="rtl"&&(s+=dr(e.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:l}}function I2(t,e){const n=ur(t),r=mo(t),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){a=o.width,s=o.height;const h=Bg();(!h||h&&e==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:a,height:s,x:l,y:u}}function k2(t,e){const n=Ji(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,a=vo(t)?ts(t):go(1),s=t.clientWidth*a.x,l=t.clientHeight*a.y,u=o*a.x,h=r*a.y;return{width:s,height:l,x:u,y:h}}function C_(t,e,n){let r;if(e==="viewport")r=I2(t,n);else if(e==="document")r=A2(mo(t));else if(Ur(e))r=k2(e,n);else{const o=y_(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return uu(r)}function b_(t,e){const n=xi(t);return n===e||!Ur(n)||es(n)?!1:Br(n).position==="fixed"||b_(n,e)}function N2(t,e){const n=e.get(t);if(n)return n;let r=wc(t,[],!1).filter(l=>Ur(l)&&Za(l)!=="body"),o=null;const a=Br(t).position==="fixed";let s=a?xi(t):t;for(;Ur(s)&&!es(s);){const l=Br(s),u=Ug(s);!u&&l.position==="fixed"&&(o=null),(a?!u&&!o:!u&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||yc(s)&&!u&&b_(t,s))?r=r.filter(p=>p!==s):o=l,s=xi(s)}return e.set(t,r),r}function P2(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?hu(e)?[]:N2(e,this._c):[].concat(n),r],l=s[0],u=s.reduce((h,p)=>{const g=C_(e,p,o);return h.top=dr(g.top,h.top),h.right=bi(g.right,h.right),h.bottom=bi(g.bottom,h.bottom),h.left=dr(g.left,h.left),h},C_(e,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function O2(t){const{width:e,height:n}=v_(t);return{width:e,height:n}}function M2(t,e,n){const r=vo(e),o=mo(e),a=n==="fixed",s=Ji(t,!0,a,e);let l={scrollLeft:0,scrollTop:0};const u=go(0);function h(){u.x=Kg(o)}if(r||!r&&!a)if((Za(e)!=="body"||yc(o))&&(l=pu(e)),r){const y=Ji(e,!0,a,e);u.x=y.x+e.clientLeft,u.y=y.y+e.clientTop}else o&&h();a&&!r&&o&&h();const p=o&&!r&&!a?w_(o,l):go(0),g=s.left+l.scrollLeft-u.x-p.x,w=s.top+l.scrollTop-u.y-p.y;return{x:g,y:w,width:s.width,height:s.height}}function Gg(t){return Br(t).position==="static"}function x_(t,e){if(!vo(t)||Br(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return mo(t)===n&&(n=n.ownerDocument.body),n}function S_(t,e){const n=ur(t);if(hu(t))return n;if(!vo(t)){let o=xi(t);for(;o&&!es(o);){if(Ur(o)&&!Gg(o))return o;o=xi(o)}return n}let r=x_(t,e);for(;r&&b2(r)&&Gg(r);)r=x_(r,e);return r&&es(r)&&Gg(r)&&!Ug(r)?n:r||x2(t)||n}const R2=async function(t){const e=this.getOffsetParent||S_,n=this.getDimensions,r=await n(t.floating);return{reference:M2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function D2(t){return Br(t).direction==="rtl"}const L2={convertOffsetParentRelativeRectToViewportRelativeRect:E2,getDocumentElement:mo,getClippingRect:P2,getOffsetParent:S_,getElementRects:R2,getClientRects:T2,getDimensions:O2,getScale:ts,isElement:Ur,isRTL:D2};function __(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function F2(t,e){let n=null,r;const o=mo(t);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),a();const h=t.getBoundingClientRect(),{left:p,top:g,width:w,height:y}=h;if(l||e(),!w||!y)return;const x=lu(g),v=lu(o.clientWidth-(p+w)),b=lu(o.clientHeight-(g+y)),E=lu(p),N={rootMargin:-x+"px "+-v+"px "+-b+"px "+-E+"px",threshold:dr(0,bi(1,u))||1};let P=!0;function _(D){const H=D[0].intersectionRatio;if(H!==u){if(!P)return s();H?s(!1,H):r=setTimeout(()=>{s(!1,1e-7)},1e3)}H===1&&!__(h,t.getBoundingClientRect())&&s(),P=!1}try{n=new IntersectionObserver(_,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(_,N)}n.observe(t)}return s(!0),a}function E_(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,h=Vg(t),p=o||a?[...h?wc(h):[],...wc(e)]:[];p.forEach(E=>{o&&E.addEventListener("scroll",n,{passive:!0}),a&&E.addEventListener("resize",n)});const g=h&&l?F2(h,n):null;let w=-1,y=null;s&&(y=new ResizeObserver(E=>{let[T]=E;T&&T.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(e)})),n()}),h&&!u&&y.observe(h),y.observe(e));let x,v=u?Ji(t):null;u&&b();function b(){const E=Ji(t);v&&!__(v,E)&&n(),v=E,x=requestAnimationFrame(b)}return n(),()=>{var E;p.forEach(T=>{o&&T.removeEventListener("scroll",n),a&&T.removeEventListener("resize",n)}),g==null||g(),(E=y)==null||E.disconnect(),y=null,u&&cancelAnimationFrame(x)}}const $2=v2,H2=y2,U2=p2,B2=C2,z2=g2,T_=h2,V2=w2,K2=(t,e,n)=>{const r=new Map,o={platform:L2,...n},a={...o.platform,_c:r};return f2(t,e,{...o,platform:a})};var gu=typeof document<"u"?M.useLayoutEffect:M.useEffect;function mu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!mu(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&t.$$typeof)&&!mu(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function A_(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function I_(t,e){const n=A_(t);return Math.round(e*n)/n}function jg(t){const e=C.useRef(t);return gu(()=>{e.current=t}),e}function k_(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:h}=t,[p,g]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[w,y]=C.useState(r);mu(w,r)||y(r);const[x,v]=C.useState(null),[b,E]=C.useState(null),T=C.useCallback(Q=>{Q!==D.current&&(D.current=Q,v(Q))},[]),N=C.useCallback(Q=>{Q!==H.current&&(H.current=Q,E(Q))},[]),P=a||x,_=s||b,D=C.useRef(null),H=C.useRef(null),K=C.useRef(p),ee=u!=null,W=jg(u),de=jg(o),se=jg(h),fe=C.useCallback(()=>{if(!D.current||!H.current)return;const Q={placement:e,strategy:n,middleware:w};de.current&&(Q.platform=de.current),K2(D.current,H.current,Q).then(X=>{const $={...X,isPositioned:se.current!==!1};q.current&&!mu(K.current,$)&&(K.current=$,Aa.flushSync(()=>{g($)}))})},[w,e,n,de,se]);gu(()=>{h===!1&&K.current.isPositioned&&(K.current.isPositioned=!1,g(Q=>({...Q,isPositioned:!1})))},[h]);const q=C.useRef(!1);gu(()=>(q.current=!0,()=>{q.current=!1}),[]),gu(()=>{if(P&&(D.current=P),_&&(H.current=_),P&&_){if(W.current)return W.current(P,_,fe);fe()}},[P,_,fe,W,ee]);const Z=C.useMemo(()=>({reference:D,floating:H,setReference:T,setFloating:N}),[T,N]),Y=C.useMemo(()=>({reference:P,floating:_}),[P,_]),oe=C.useMemo(()=>{const Q={position:n,left:0,top:0};if(!Y.floating)return Q;const X=I_(Y.floating,p.x),$=I_(Y.floating,p.y);return l?{...Q,transform:"translate("+X+"px, "+$+"px)",...A_(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:$}},[n,l,Y.floating,p.x,p.y]);return C.useMemo(()=>({...p,update:fe,refs:Z,elements:Y,floatingStyles:oe}),[p,fe,Z,Y,oe])}const G2=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?T_({element:r.current,padding:o}).fn(n):{}:r?T_({element:r,padding:o}).fn(n):{}}}},N_=(t,e)=>({...$2(t),options:[t,e]}),P_=(t,e)=>({...H2(t),options:[t,e]}),O_=(t,e)=>({...V2(t),options:[t,e]}),M_=(t,e)=>({...U2(t),options:[t,e]}),R_=(t,e)=>({...B2(t),options:[t,e]}),D_=(t,e)=>({...z2(t),options:[t,e]}),L_=(t,e)=>({...G2(t),options:[t,e]});var j2="Arrow",F_=C.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...a}=t;return d.jsx(mt.svg,{...a,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});F_.displayName=j2;var W2=F_,Wg="Popper",[$_,H_]=yr(Wg),[q2,U_]=$_(Wg),B_=t=>{const{__scopePopper:e,children:n}=t,[r,o]=C.useState(null);return d.jsx(q2,{scope:e,anchor:r,onAnchorChange:o,children:n})};B_.displayName=Wg;var z_="PopperAnchor",V_=C.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,a=U_(z_,n),s=C.useRef(null),l=rt(e,s);return C.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:d.jsx(mt.div,{...o,ref:l})});V_.displayName=z_;var qg="PopperContent",[Y2,J2]=$_(qg),K_=C.forwardRef((t,e)=>{var z,ce,Ae,Ce,Ne,ne;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:x,...v}=t,b=U_(qg,n),[E,T]=C.useState(null),N=rt(e,Ve=>T(Ve)),[P,_]=C.useState(null),D=vg(P),H=(D==null?void 0:D.width)??0,K=(D==null?void 0:D.height)??0,ee=r+(a!=="center"?"-"+a:""),W=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},de=Array.isArray(h)?h:[h],se=de.length>0,fe={padding:W,boundary:de.filter(X2),altBoundary:se},{refs:q,floatingStyles:Z,placement:Y,isPositioned:oe,middlewareData:Q}=k_({strategy:"fixed",placement:ee,whileElementsMounted:(...Ve)=>E_(...Ve,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[N_({mainAxis:o+K,alignmentAxis:s}),u&&P_({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?O_():void 0,...fe}),u&&M_({...fe}),R_({...fe,apply:({elements:Ve,rects:Qe,availableWidth:Ct,availableHeight:Yt})=>{const{width:bt,height:rn}=Qe.reference,zt=Ve.floating.style;zt.setProperty("--radix-popper-available-width",`${Ct}px`),zt.setProperty("--radix-popper-available-height",`${Yt}px`),zt.setProperty("--radix-popper-anchor-width",`${bt}px`),zt.setProperty("--radix-popper-anchor-height",`${rn}px`)}}),P&&L_({element:P,padding:l}),Z2({arrowWidth:H,arrowHeight:K}),w&&D_({strategy:"referenceHidden",...fe})]}),[X,$]=W_(Y),te=gn(x);tn(()=>{oe&&(te==null||te())},[oe,te]);const _e=(z=Q.arrow)==null?void 0:z.x,ke=(ce=Q.arrow)==null?void 0:ce.y,xe=((Ae=Q.arrow)==null?void 0:Ae.centerOffset)!==0,[Pe,Te]=C.useState();return tn(()=>{E&&Te(window.getComputedStyle(E).zIndex)},[E]),d.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:oe?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Pe,"--radix-popper-transform-origin":[(Ce=Q.transformOrigin)==null?void 0:Ce.x,(Ne=Q.transformOrigin)==null?void 0:Ne.y].join(" "),...((ne=Q.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(Y2,{scope:n,placedSide:X,onArrowChange:_,arrowX:_e,arrowY:ke,shouldHideArrow:xe,children:d.jsx(mt.div,{"data-side":X,"data-align":$,...v,ref:N,style:{...v.style,animation:oe?void 0:"none"}})})})});K_.displayName=qg;var G_="PopperArrow",Q2={top:"bottom",right:"left",bottom:"top",left:"right"},j_=C.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,a=J2(G_,r),s=Q2[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(W2,{...o,ref:n,style:{...o.style,display:"block"}})})});j_.displayName=G_;function X2(t){return t!==null}var Z2=t=>({name:"transformOrigin",options:t,fn(e){var b,E,T;const{placement:n,rects:r,middlewareData:o}=e,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,l=s?0:t.arrowWidth,u=s?0:t.arrowHeight,[h,p]=W_(n),g={start:"0%",center:"50%",end:"100%"}[p],w=(((E=o.arrow)==null?void 0:E.x)??0)+l/2,y=(((T=o.arrow)==null?void 0:T.y)??0)+u/2;let x="",v="";return h==="bottom"?(x=s?g:`${w}px`,v=`${-u}px`):h==="top"?(x=s?g:`${w}px`,v=`${r.floating.height+u}px`):h==="right"?(x=`${-u}px`,v=s?g:`${y}px`):h==="left"&&(x=`${r.floating.width+u}px`,v=s?g:`${y}px`),{data:{x,y:v}}}});function W_(t){const[e,n="center"]=t.split("-");return[e,n]}var e$=B_,t$=V_,n$=K_,r$=j_,o$=Symbol("radix.slottable");function i$(t){const e=({children:n})=>d.jsx(d.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=o$,e}var a$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),s$="VisuallyHidden",q_=C.forwardRef((t,e)=>d.jsx(mt.span,{...t,ref:e,style:{...a$,...t.style}}));q_.displayName=s$;var c$=q_,[vu,Bj]=yr("Tooltip",[H_]),yu=H_(),Y_="TooltipProvider",l$=700,Yg="tooltip.open",[d$,Jg]=vu(Y_),J_=t=>{const{__scopeTooltip:e,delayDuration:n=l$,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=t,s=C.useRef(!0),l=C.useRef(!1),u=C.useRef(0);return C.useEffect(()=>{const h=u.current;return()=>window.clearTimeout(h)},[]),d.jsx(d$,{scope:e,isOpenDelayedRef:s,delayDuration:n,onOpen:C.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:C.useCallback(h=>{l.current=h},[]),disableHoverableContent:o,children:a})};J_.displayName=Y_;var Cc="Tooltip",[u$,bc]=vu(Cc),Q_=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=t,u=Jg(Cc,t.__scopeTooltip),h=yu(e),[p,g]=C.useState(null),w=Mo(),y=C.useRef(0),x=s??u.disableHoverableContent,v=l??u.delayDuration,b=C.useRef(!1),[E,T]=ui({prop:r,defaultProp:o??!1,onChange:H=>{H?(u.onOpen(),document.dispatchEvent(new CustomEvent(Yg))):u.onClose(),a==null||a(H)},caller:Cc}),N=C.useMemo(()=>E?b.current?"delayed-open":"instant-open":"closed",[E]),P=C.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,T(!0)},[T]),_=C.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),D=C.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,T(!0),y.current=0},v)},[v,T]);return C.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),d.jsx(e$,{...h,children:d.jsx(u$,{scope:e,contentId:w,open:E,stateAttribute:N,trigger:p,onTriggerChange:g,onTriggerEnter:C.useCallback(()=>{u.isOpenDelayedRef.current?D():P()},[u.isOpenDelayedRef,D,P]),onTriggerLeave:C.useCallback(()=>{x?_():(window.clearTimeout(y.current),y.current=0)},[_,x]),onOpen:P,onClose:_,disableHoverableContent:x,children:n})})};Q_.displayName=Cc;var Qg="TooltipTrigger",X_=C.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=bc(Qg,n),a=Jg(Qg,n),s=yu(n),l=C.useRef(null),u=rt(e,l,o.onTriggerChange),h=C.useRef(!1),p=C.useRef(!1),g=C.useCallback(()=>h.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),d.jsx(t$,{asChild:!0,...s,children:d.jsx(mt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Ue(t.onPointerMove,w=>{w.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ue(t.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Ue(t.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ue(t.onFocus,()=>{h.current||o.onOpen()}),onBlur:Ue(t.onBlur,o.onClose),onClick:Ue(t.onClick,o.onClose)})})});X_.displayName=Qg;var Xg="TooltipPortal",[f$,h$]=vu(Xg,{forceMount:void 0}),Z_=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,a=bc(Xg,e);return d.jsx(f$,{scope:e,forceMount:n,children:d.jsx(Ro,{present:n||a.open,children:d.jsx(ud,{asChild:!0,container:o,children:r})})})};Z_.displayName=Xg;var ns="TooltipContent",eE=C.forwardRef((t,e)=>{const n=h$(ns,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=t,s=bc(ns,t.__scopeTooltip);return d.jsx(Ro,{present:r||s.open,children:s.disableHoverableContent?d.jsx(tE,{side:o,...a,ref:e}):d.jsx(p$,{side:o,...a,ref:e})})}),p$=C.forwardRef((t,e)=>{const n=bc(ns,t.__scopeTooltip),r=Jg(ns,t.__scopeTooltip),o=C.useRef(null),a=rt(e,o),[s,l]=C.useState(null),{trigger:u,onClose:h}=n,p=o.current,{onPointerInTransitChange:g}=r,w=C.useCallback(()=>{l(null),g(!1)},[g]),y=C.useCallback((x,v)=>{const b=x.currentTarget,E={x:x.clientX,y:x.clientY},T=w$(E,b.getBoundingClientRect()),N=C$(E,T),P=b$(v.getBoundingClientRect()),_=S$([...N,...P]);l(_),g(!0)},[g]);return C.useEffect(()=>()=>w(),[w]),C.useEffect(()=>{if(u&&p){const x=b=>y(b,p),v=b=>y(b,u);return u.addEventListener("pointerleave",x),p.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",x),p.removeEventListener("pointerleave",v)}}},[u,p,y,w]),C.useEffect(()=>{if(s){const x=v=>{const b=v.target,E={x:v.clientX,y:v.clientY},T=(u==null?void 0:u.contains(b))||(p==null?void 0:p.contains(b)),N=!x$(E,s);T?w():N&&(w(),h())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,p,s,h,w]),d.jsx(tE,{...t,ref:a})}),[g$,m$]=vu(Cc,{isInside:!1}),v$=i$("TooltipContent"),tE=C.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=t,u=bc(ns,n),h=yu(n),{onClose:p}=u;return C.useEffect(()=>(document.addEventListener(Yg,p),()=>document.removeEventListener(Yg,p)),[p]),C.useEffect(()=>{if(u.trigger){const g=w=>{const y=w.target;y!=null&&y.contains(u.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,p]),d.jsx(dd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:d.jsxs(n$,{"data-state":u.stateAttribute,...h,...l,ref:e,style:{...l.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:[d.jsx(v$,{children:r}),d.jsx(g$,{scope:n,isInside:!0,children:d.jsx(c$,{id:u.contentId,role:"tooltip",children:o||r})})]})})});eE.displayName=ns;var nE="TooltipArrow",y$=C.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=yu(n);return m$(nE,n).isInside?null:d.jsx(r$,{...o,...r,ref:e})});y$.displayName=nE;function w$(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function C$(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function b$(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function x$(t,e){const{x:n,y:r}=t;let o=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const l=e[a],u=e[s],h=l.x,p=l.y,g=u.x,w=u.y;p>r!=w>r&&n<(g-h)*(r-p)/(w-p)+h&&(o=!o)}return o}function S$(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),_$(e)}function _$(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var E$=J_,T$=Q_,A$=X_,I$=Z_,rE=eE;const qn=E$,Yn=T$,Jn=A$,On=C.forwardRef(({className:t,sideOffset:e=4,...n},r)=>d.jsx(I$,{children:d.jsx(rE,{ref:r,sideOffset:e,className:ze("z-[100001] 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",t),...n})}));On.displayName=rE.displayName;function k$({title:t,titleId:e,...n},r){return C.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":e},n),t?C.createElement("title",{id:e},t):null,C.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 N$=C.forwardRef(k$);var P$=function(t){return function(e,n){var r=M.useRef(!1);t(function(){return function(){r.current=!1}},[]),t(function(){if(!r.current)r.current=!0;else return e()},n)}},oE=function(t){return typeof t=="function"},iE=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const O$=P$(M.useEffect);function aE(t){var e=M.useRef(t);return e.current=t,e}var M$=function(t){iE&&(oE(t)||console.error("useUnmount expected parameter is a function, got ".concat(typeof t)));var e=aE(t);M.useEffect(function(){return function(){e.current()}},[])};function R$(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var sE=R$,D$=typeof fo=="object"&&fo&&fo.Object===Object&&fo,L$=D$,F$=L$,$$=typeof self=="object"&&self&&self.Object===Object&&self,H$=F$||$$||Function("return this")(),cE=H$,U$=cE,B$=function(){return U$.Date.now()},z$=B$,V$=/\s/;function K$(t){for(var e=t.length;e--&&V$.test(t.charAt(e)););return e}var G$=K$,j$=G$,W$=/^\s+/;function q$(t){return t&&t.slice(0,j$(t)+1).replace(W$,"")}var Y$=q$,J$=cE,Q$=J$.Symbol,lE=Q$,dE=lE,uE=Object.prototype,X$=uE.hasOwnProperty,Z$=uE.toString,xc=dE?dE.toStringTag:void 0;function eH(t){var e=X$.call(t,xc),n=t[xc];try{t[xc]=void 0;var r=!0}catch{}var o=Z$.call(t);return r&&(e?t[xc]=n:delete t[xc]),o}var tH=eH,nH=Object.prototype,rH=nH.toString;function oH(t){return rH.call(t)}var iH=oH,fE=lE,aH=tH,sH=iH,cH="[object Null]",lH="[object Undefined]",hE=fE?fE.toStringTag:void 0;function dH(t){return t==null?t===void 0?lH:cH:hE&&hE in Object(t)?aH(t):sH(t)}var uH=dH;function fH(t){return t!=null&&typeof t=="object"}var hH=fH,pH=uH,gH=hH,mH="[object Symbol]";function vH(t){return typeof t=="symbol"||gH(t)&&pH(t)==mH}var yH=vH,wH=Y$,pE=sE,CH=yH,gE=NaN,bH=/^[-+]0x[0-9a-f]+$/i,xH=/^0b[01]+$/i,SH=/^0o[0-7]+$/i,_H=parseInt;function EH(t){if(typeof t=="number")return t;if(CH(t))return gE;if(pE(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=pE(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=wH(t);var n=xH.test(t);return n||SH.test(t)?_H(t.slice(2),n?2:8):bH.test(t)?gE:+t}var TH=EH,AH=sE,Zg=z$,mE=TH,IH="Expected a function",kH=Math.max,NH=Math.min;function PH(t,e,n){var r,o,a,s,l,u,h=0,p=!1,g=!1,w=!0;if(typeof t!="function")throw new TypeError(IH);e=mE(e)||0,AH(n)&&(p=!!n.leading,g="maxWait"in n,a=g?kH(mE(n.maxWait)||0,e):a,w="trailing"in n?!!n.trailing:w);function y(D){var H=r,K=o;return r=o=void 0,h=D,s=t.apply(K,H),s}function x(D){return h=D,l=setTimeout(E,e),p?y(D):s}function v(D){var H=D-u,K=D-h,ee=e-H;return g?NH(ee,a-K):ee}function b(D){var H=D-u,K=D-h;return u===void 0||H>=e||H<0||g&&K>=a}function E(){var D=Zg();if(b(D))return T(D);l=setTimeout(E,v(D))}function T(D){return l=void 0,w&&r?y(D):(r=o=void 0,s)}function N(){l!==void 0&&clearTimeout(l),h=0,r=u=o=l=void 0}function P(){return l===void 0?s:T(Zg())}function _(){var D=Zg(),H=b(D);if(r=arguments,o=this,u=D,H){if(l===void 0)return x(u);if(g)return clearTimeout(l),l=setTimeout(E,e),y(u)}return l===void 0&&(l=setTimeout(E,e)),s}return _.cancel=N,_.flush=P,_}var OH=PH;const MH=Hd(OH);function RH(){var t=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,e=typeof self=="object"&&self&&self.Object===Object&&self;return t||e}RH()||(global.Date=Date);function DH(t,e){var n;iE&&(oE(t)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof t)));var r=aE(t),o=(n=e==null?void 0:e.wait)!==null&&n!==void 0?n:1e3,a=M.useMemo(function(){return MH(function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return r.current.apply(r,tb([],eb(s),!1))},o,e)},[]);return M$(function(){a.cancel()}),{run:a,cancel:a.cancel,flush:a.flush}}function LH(t,e,n){var r=eb(M.useState({}),2),o=r[0],a=r[1],s=DH(function(){a({})},n).run;M.useEffect(function(){return s()},e),O$(t,[o])}const FH=M.forwardRef(({onChange:t},e)=>{const n=M.useRef(null),[r,o]=M.useState("");return M.useImperativeHandle(e,()=>({setValue:a=>{var s;o(a),(s=n.current)==null||s.focus()}})),LH(()=>{t==null||t(r)},[r],{wait:300}),d.jsxs(d.Fragment,{children:[d.jsx(jn,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:a=>o(a.target.value),className:"pr-8"}),r&&d.jsx("button",{onClick:()=>{var a;o(""),(a=n.current)==null||a.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:d.jsx(N$,{className:"h-5 w-5"})})]})});var zr=(t=>(t.VIEW_DOCUMENT="VIEW_DOCUMENT",t.DOWNLOAD_DOCUMENT="DOWNLOAD_DOCUMENT",t.EDIT_DOCUMENT="EDIT_DOCUMENT",t.OWNER_DOCUMENT="OWNER_DOCUMENT",t))(zr||{});const $H=(t,e)=>{const[n,r]=M.useState([]),[o,a]=M.useState([]),[s,l]=M.useState([]),[u,h]=M.useState([]),{toast:p}=mc(),[g,w]=M.useState(!1),[y,x]=M.useState(!1),v=M.useCallback(async(P,_,D)=>{if(!y){x(!0);try{const H=await Le.post(t+"/document-permission/grandted",{path:P,grandtedBy:_,data:D});return H.status===200&&(p({title:"Phân quyền tài liệu thành công."}),await N(P)),H}catch{return null}finally{x(!1)}}},[]),b=M.useCallback(async()=>{var P;try{return(P=(await Le.get(e+"admin/users/get-all",{params:{limit:1e4}})).data||[])==null?void 0:P.filter(K=>K.role!=="MASTER_ADMIN")}catch(_){return console.error("Error fetchAllUsers",_),[]}},[]),E=M.useCallback(async()=>{try{return(await Le.get(e+"admin/group-users")).data.filter(_=>`${_.groupname}`.toUpperCase()!=="MASTER_ADMIN").map(_=>{var D;return{..._,users:((D=_.users)==null?void 0:D.length)||0}})}catch(P){return console.error("Error fetchAllGroups",P),[]}},[]),T=M.useCallback(async P=>{try{const D=(await Le.get(t+"/document-permission/grandted",{params:{path:P}})).data;return{usersShared:(D==null?void 0:D.users)||[],groupsShared:(D==null?void 0:D.groups)||[]}}catch(_){return console.error("Error fetchShared",_),{usersShared:[],groupsShared:[]}}},[]),N=M.useCallback(async P=>{if(g)return;w(!0);let[_,D,{usersShared:H,groupsShared:K}]=await Promise.all([b(),E(),T(P)]);_=_==null?void 0:_.filter(ee=>!(H!=null&&H.find(W=>W.userId===ee.id))),D=D==null?void 0:D.filter(ee=>!(K!=null&&K.find(W=>W.groupname===ee.groupname))),Array.isArray(_)&&r(_),Array.isArray(D)&&a(D),Array.isArray(H)&&l(H),Array.isArray(K)&&h(K),w(!1)},[]);return{users:n,groups:o,sharedUsers:s,sharedGroups:u,setUsers:r,setGroups:a,setSharedUsers:l,setSharedGroups:h,fetchData:N,loading:g,postGranted:v,loadingGrandted:y}},HH=({failureReasons:t,onNavigateToFile:e})=>{const n=u=>{if(e){const h=u.replace("s3://cts-llm-docs-bucket/","");e(h)}},r=u=>{const h=[];return u.forEach(p=>{try{JSON.parse(p).forEach(w=>{const y=w.match(/\[Files: ([^\]]+)\]/),x=w.match(/^([^[]+)/);if(y&&x&&y[1]&&x[1]){const v=y[1].split(", ").map(T=>T.trim()),b=x[1].trim().replace("Encountered error: ","");let E="unknown";b.includes("invalid metadata attributes")||b.includes("metadata quota")?E="metadata":b.includes("No metadata was provided")||b.includes("metadata file")?E="missing_metadata":b.includes("file size")||b.includes("exceeds")||b.includes("50 MB")?E="file_size":b.includes("format not supported")||b.includes("unsupported format")||b.includes("file type")?E="file_format":b.includes("embedding failed")||b.includes("EMBEDDING_FAILED")?E="embedding_failed":b.includes("indexing failed")||b.includes("INDEXING_FAILED")?E="indexing_failed":b.includes("access denied")||b.includes("AccessDeniedException")||b.includes("permission")?E="access_denied":(b.includes("quota")||b.includes("limit")||b.includes("ServiceQuotaExceededException"))&&(E="quota_exceeded"),h.push({errorMessage:b,files:v,errorType:E})}})}catch{h.push({errorMessage:p,files:[],errorType:"unknown"})}}),h},o=u=>{switch(u){case"metadata":return d.jsx(gi,{className:"h-4 w-4 text-orange-500"});case"missing_metadata":return d.jsx(cg,{className:"h-4 w-4 text-red-500"});case"file_size":return d.jsx(gi,{className:"h-4 w-4 text-yellow-500"});case"file_format":return d.jsx(cg,{className:"h-4 w-4 text-purple-500"});case"embedding_failed":return d.jsx(gi,{className:"h-4 w-4 text-red-600"});case"indexing_failed":return d.jsx(gi,{className:"h-4 w-4 text-red-600"});case"access_denied":return d.jsx(gi,{className:"h-4 w-4 text-red-700"});case"quota_exceeded":return d.jsx(gi,{className:"h-4 w-4 text-orange-600"});default:return d.jsx(gi,{className:"h-4 w-4 text-red-500"})}},a=u=>{switch(u){case"metadata":return"border-orange-200 bg-orange-50";case"missing_metadata":return"border-red-200 bg-red-50";case"file_size":return"border-yellow-200 bg-yellow-50";case"file_format":return"border-purple-200 bg-purple-50";case"embedding_failed":return"border-red-300 bg-red-100";case"indexing_failed":return"border-red-300 bg-red-100";case"access_denied":return"border-red-400 bg-red-100";case"quota_exceeded":return"border-orange-300 bg-orange-100";default:return"border-red-200 bg-red-50"}},s=u=>{switch(u){case"metadata":return"text-orange-800";case"missing_metadata":return"text-red-800";case"file_size":return"text-yellow-800";case"file_format":return"text-purple-800";case"embedding_failed":return"text-red-900";case"indexing_failed":return"text-red-900";case"access_denied":return"text-red-900";case"quota_exceeded":return"text-orange-900";default:return"text-red-800"}},l=r(t);return l.length===0?null:d.jsxs("div",{className:"border-t pt-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(gi,{className:"h-4 w-4 text-red-500"}),d.jsxs("p",{className:"text-red-600 font-medium",children:["Các file lỗi (",l.reduce((u,h)=>u+h.files.length,0)," file)"]})]}),d.jsx("div",{className:"space-y-3 max-h-80 overflow-y-auto",children:l.map((u,h)=>d.jsxs("div",{className:`p-3 rounded-lg border ${a(u.errorType)}`,children:[d.jsx("div",{className:"flex items-start justify-between",children:d.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[o(u.errorType),d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:`font-medium text-sm ${s(u.errorType)}`,children:u.errorMessage}),u.files.length>0&&d.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:[u.files.length," file bị ảnh hưởng"]})]})]})}),u.files.length>0&&d.jsxs("div",{className:"mt-3 pt-2 border-t border-gray-200",children:[d.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2",children:"Danh sách file lỗi:"}),d.jsx("div",{className:"max-h-32 overflow-y-auto space-y-1",children:u.files.map((p,g)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs p-2 bg-white/50 rounded hover:bg-white/80 transition-colors",children:[d.jsx(cg,{className:"h-3 w-3 text-red-400 flex-shrink-0"}),e?d.jsxs("button",{onClick:()=>n(p),className:"text-blue-600 hover:text-blue-800 underline break-all font-mono text-left flex-1 flex items-center gap-1",title:"Nhấp để điều hướng đến file",children:[d.jsx("span",{children:p.replace("s3://cts-llm-docs-bucket/","")}),d.jsx(VD,{className:"h-3 w-3 flex-shrink-0"})]}):d.jsx("span",{className:"text-gray-700 break-all font-mono",children:p.replace("s3://cts-llm-docs-bucket/","")})]},g))})]})]},h))})]})};var em={exports:{}},wu={exports:{}},yt={};/** @license React v16.13.1
204
+ `);var dg=t=>typeof t=="number"&&!isNaN(t),oc=t=>typeof t=="string",Vx=t=>typeof t=="function",qD=t=>oc(t)||dg(t),YD=t=>M.isValidElement(t)||oc(t)||Vx(t)||dg(t),JD=1,Kx=()=>`${JD++}`,ho=new Map,ug=[],Gx=new Set,jx=()=>ho.size>0,QD=(t,{containerId:e})=>{var n;return(n=ho.get(e||1))==null?void 0:n.toasts.get(t)};function XD(t,e){var n;if(e)return!!((n=ho.get(e))!=null&&n.isToastActive(t));let r=!1;return ho.forEach(o=>{o.isToastActive(t)&&(r=!0)}),r}function ZD(t){if(!jx()){ug=ug.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||qD(t))ho.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=ho.get(t.containerId);e?e.removeToast(t.id):ho.forEach(n=>{n.removeToast(t.id)})}}var eL=(t={})=>{ho.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function tL(t,e){YD(t)&&(jx()||ug.push({content:t,options:e}),ho.forEach(n=>{n.buildToast(t,e)}))}function Wx(t,e){ho.forEach(n=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===n.id)&&n.toggle(t,e==null?void 0:e.id)})}function nL(t){return Gx.add(t),()=>{Gx.delete(t)}}function rL(t){return t&&(oc(t.toastId)||dg(t.toastId))?t.toastId:Kx()}function ic(t,e){return tL(t,e),e.toastId}function zd(t,e){return{...e,type:e&&e.type||t,toastId:rL(e)}}function Vd(t){return(e,n)=>ic(e,zd(t,n))}function st(t,e){return ic(t,zd("default",e))}st.loading=(t,e)=>ic(t,zd("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function oL(t,{pending:e,error:n,success:r},o){let a;e&&(a=oc(e)?st.loading(e,o):st.loading(e.render,{...o,...e}));let s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(h,p,g)=>{if(p==null){st.dismiss(a);return}let w={type:h,...s,...o,data:g},y=oc(p)?{render:p}:p;return a?st.update(a,{...w,...y}):st(y.render,{...w,...y}),g},u=Vx(t)?t():t;return u.then(h=>l("success",r,h)).catch(h=>l("error",n,h)),u}st.promise=oL,st.success=Vd("success"),st.info=Vd("info"),st.error=Vd("error"),st.warning=Vd("warning"),st.warn=st.warning,st.dark=(t,e)=>ic(t,zd("default",{theme:"dark",...e}));function iL(t){ZD(t)}st.dismiss=iL,st.clearWaitingQueue=eL,st.isActive=XD,st.update=(t,e={})=>{let n=QD(t,e);if(n){let{props:r,content:o}=n,a={delay:100,...r,...e,toastId:e.toastId||t,updateId:Kx()};a.toastId!==t&&(a.staleId=t);let s=a.render||o;delete a.render,ic(s,a)}},st.done=t=>{st.update(t,{progress:1})},st.onChange=nL,st.play=t=>Wx(!0,t),st.pause=t=>Wx(!1,t);const aL={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"},sL=t=>t==="SummaryOfSuggestedAI"||t==="KeywordAISuggestion"||t==="SuggestedAICategories",fg=t=>t==="fullPath"||t==="createAt"||t==="creator"||t==="creatorId"||t==="DataSource"||t==="AccessLevel"||t==="category"||t==="fileName",cL={STARTING:"Đang bắt đầu",IN_PROGRESS:"Đang đồng bộ",COMPLETE:"Đồng bộ thành công",FAILED:"Đồng bộ thất bại",STOPPING:"Đang dừng",STOPPED:"Đã dừng"},lL=t=>cL[t]||t;function mi(t){const e=dL(t),n=C.forwardRef((r,o)=>{const{children:a,...s}=r,l=C.Children.toArray(a),u=l.find(fL);if(u){const h=u.props.children,p=l.map(g=>g===u?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:g);return d.jsx(e,{...s,ref:o,children:C.isValidElement(h)?C.cloneElement(h,void 0,p):null})}return d.jsx(e,{...s,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}var qx=mi("Slot");function dL(t){const e=C.forwardRef((n,r)=>{const{children:o,...a}=n;if(C.isValidElement(o)){const s=pL(o),l=hL(a,o.props);return o.type!==C.Fragment&&(l.ref=r?FC(r,s):s),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var uL=Symbol("radix.slottable");function fL(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===uL}function hL(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function pL(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const hg="-",gL=t=>{const e=vL(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{const l=s.split(hg);return l[0]===""&&l.length!==1&&l.shift(),Yx(l,e)||mL(s)},getConflictingClassGroupIds:(s,l)=>{const u=n[s]||[];return l&&r[s]?[...u,...r[s]]:u}}},Yx=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?Yx(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const a=t.join(hg);return(s=e.validators.find(({validator:l})=>l(a)))==null?void 0:s.classGroupId},Jx=/^\[(.+)\]$/,mL=t=>{if(Jx.test(t)){const e=Jx.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},vL=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return wL(Object.entries(t.classGroups),n).forEach(([a,s])=>{pg(s,r,a,e)}),r},pg=(t,e,n,r)=>{t.forEach(o=>{if(typeof o=="string"){const a=o===""?e:Qx(e,o);a.classGroupId=n;return}if(typeof o=="function"){if(yL(o)){pg(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,s])=>{pg(s,Qx(e,a),n,r)})})},Qx=(t,e)=>{let n=t;return e.split(hg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},yL=t=>t.isThemeGetter,wL=(t,e)=>e?t.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,l])=>[e+s,l])):a);return[n,o]}):t,CL=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const o=(a,s)=>{n.set(a,s),e++,e>t&&(e=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return o(a,s),s},set(a,s){n.has(a)?n.set(a,s):o(a,s)}}},Xx="!",bL=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,o=e[0],a=e.length,s=l=>{const u=[];let h=0,p=0,g;for(let b=0;b<l.length;b++){let E=l[b];if(h===0){if(E===o&&(r||l.slice(b,b+a)===e)){u.push(l.slice(p,b)),p=b+a;continue}if(E==="/"){g=b;continue}}E==="["?h++:E==="]"&&h--}const w=u.length===0?l:l.substring(p),y=w.startsWith(Xx),x=y?w.substring(1):w,v=g&&g>p?g-p:void 0;return{modifiers:u,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:s}):s},xL=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},SL=t=>({cache:CL(t.cacheSize),parseClassName:bL(t),...gL(t)}),_L=/\s+/,EL=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,a=[],s=t.trim().split(_L);let l="";for(let u=s.length-1;u>=0;u-=1){const h=s[u],{modifiers:p,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:y}=n(h);let x=!!y,v=r(x?w.substring(0,y):w);if(!v){if(!x){l=h+(l.length>0?" "+l:l);continue}if(v=r(w),!v){l=h+(l.length>0?" "+l:l);continue}x=!1}const b=xL(p).join(":"),E=g?b+Xx:b,T=E+v;if(a.includes(T))continue;a.push(T);const N=o(v,x);for(let P=0;P<N.length;++P){const _=N[P];a.push(E+_)}l=h+(l.length>0?" "+l:l)}return l};function TL(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=Zx(e))&&(r&&(r+=" "),r+=n);return r}const Zx=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=Zx(t[r]))&&(n&&(n+=" "),n+=e);return n};function AL(t,...e){let n,r,o,a=s;function s(u){const h=e.reduce((p,g)=>g(p),t());return n=SL(h),r=n.cache.get,o=n.cache.set,a=l,l(u)}function l(u){const h=r(u);if(h)return h;const p=EL(u,n);return o(u,p),p}return function(){return a(TL.apply(null,arguments))}}const Ft=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},eS=/^\[(?:([a-z-]+):)?(.+)\]$/i,IL=/^\d+\/\d+$/,kL=new Set(["px","full","screen"]),NL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PL=/\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$/,OL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ML=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fo=t=>Ya(t)||kL.has(t)||IL.test(t),vi=t=>Ja(t,"length",zL),Ya=t=>!!t&&!Number.isNaN(Number(t)),gg=t=>Ja(t,"number",Ya),ac=t=>!!t&&Number.isInteger(Number(t)),DL=t=>t.endsWith("%")&&Ya(t.slice(0,-1)),ot=t=>eS.test(t),yi=t=>NL.test(t),LL=new Set(["length","size","percentage"]),FL=t=>Ja(t,LL,tS),$L=t=>Ja(t,"position",tS),HL=new Set(["image","url"]),UL=t=>Ja(t,HL,KL),BL=t=>Ja(t,"",VL),sc=()=>!0,Ja=(t,e,n)=>{const r=eS.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},zL=t=>PL.test(t)&&!OL.test(t),tS=()=>!1,VL=t=>ML.test(t),KL=t=>RL.test(t),GL=AL(()=>{const t=Ft("colors"),e=Ft("spacing"),n=Ft("blur"),r=Ft("brightness"),o=Ft("borderColor"),a=Ft("borderRadius"),s=Ft("borderSpacing"),l=Ft("borderWidth"),u=Ft("contrast"),h=Ft("grayscale"),p=Ft("hueRotate"),g=Ft("invert"),w=Ft("gap"),y=Ft("gradientColorStops"),x=Ft("gradientColorStopPositions"),v=Ft("inset"),b=Ft("margin"),E=Ft("opacity"),T=Ft("padding"),N=Ft("saturate"),P=Ft("scale"),_=Ft("sepia"),D=Ft("skew"),H=Ft("space"),K=Ft("translate"),ee=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",ot,e],se=()=>[ot,e],he=()=>["",Fo,vi],q=()=>["auto",Ya,ot],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",ot],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>[Ya,ot];return{cacheSize:500,separator:":",theme:{colors:[sc],spacing:[Fo,vi],blur:["none","",yi,ot],brightness:te(),borderColor:[t],borderRadius:["none","","full",yi,ot],borderSpacing:se(),borderWidth:he(),contrast:te(),grayscale:X(),hueRotate:te(),invert:X(),gap:se(),gradientColorStops:[t],gradientColorStopPositions:[DL,vi],inset:de(),margin:de(),opacity:te(),padding:se(),saturate:te(),scale:te(),sepia:X(),skew:te(),space:se(),translate:se()},classGroups:{aspect:[{aspect:["auto","square","video",ot]}],container:["container"],columns:[{columns:[yi]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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(),ot]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ac,ot]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ot]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",ac,ot]}],"grid-cols":[{"grid-cols":[sc]}],"col-start-end":[{col:["auto",{span:["full",ac,ot]},ot]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[sc]}],"row-start-end":[{row:["auto",{span:[ac,ot]},ot]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ot]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ot]}],gap:[{gap:[w]}],"gap-x":[{"gap-x":[w]}],"gap-y":[{"gap-y":[w]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[H]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[H]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ot,e]}],"min-w":[{"min-w":[ot,e,"min","max","fit"]}],"max-w":[{"max-w":[ot,e,"none","full","min","max","fit","prose",{screen:[yi]},yi]}],h:[{h:[ot,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ot,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ot,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ot,e,"auto","min","max","fit"]}],"font-size":[{text:["base",yi,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gg]}],"font-family":[{font:[sc]}],"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",ot]}],"line-clamp":[{"line-clamp":["none",Ya,gg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fo,ot]}],"list-image":[{"list-image":["none",ot]}],"list-style-type":[{list:["none","disc","decimal",ot]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fo,vi]}],"underline-offset":[{"underline-offset":["auto",Fo,ot]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:se()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot]}],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",ot]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),$L]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},UL]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:Y()}],"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:["",...Y()]}],"outline-offset":[{"outline-offset":[Fo,ot]}],"outline-w":[{outline:[Fo,vi]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[Fo,vi]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",yi,BL]}],"shadow-color":[{shadow:[sc]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",yi,ot]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[g]}],saturate:[{saturate:[N]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ot]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",ot]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",ot]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[ac,ot]}],"translate-x":[{"translate-x":[K]}],"translate-y":[{"translate-y":[K]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ot]}],accent:[{accent:["auto",t]}],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",ot]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":se()}],"scroll-mx":[{"scroll-mx":se()}],"scroll-my":[{"scroll-my":se()}],"scroll-ms":[{"scroll-ms":se()}],"scroll-me":[{"scroll-me":se()}],"scroll-mt":[{"scroll-mt":se()}],"scroll-mr":[{"scroll-mr":se()}],"scroll-mb":[{"scroll-mb":se()}],"scroll-ml":[{"scroll-ml":se()}],"scroll-p":[{"scroll-p":se()}],"scroll-px":[{"scroll-px":se()}],"scroll-py":[{"scroll-py":se()}],"scroll-ps":[{"scroll-ps":se()}],"scroll-pe":[{"scroll-pe":se()}],"scroll-pt":[{"scroll-pt":se()}],"scroll-pr":[{"scroll-pr":se()}],"scroll-pb":[{"scroll-pb":se()}],"scroll-pl":[{"scroll-pl":se()}],"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",ot]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Fo,vi,gg]}],stroke:[{stroke:[t,"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 ze(...t){return GL(zx(t))}function Wi(){let t=localStorage.getItem("dataLogin"),e;try{t&&(t=JSON.parse(t),e=t.user)}catch(n){console.error("Error parsing dataLogin from localStorage:",n),t=null}return e}const Kd=C.forwardRef(({className:t,...e},n)=>d.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:ze("s3-explr-ui-breadcrumb",t),...e}));Kd.displayName="Breadcrumb";const Gd=C.forwardRef(({className:t,...e},n)=>d.jsx("ol",{ref:n,className:ze("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",t),...e}));Gd.displayName="BreadcrumbList";const cc=C.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:ze("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",t),...e}));cc.displayName="BreadcrumbItem";const lc=C.forwardRef(({asChild:t,className:e,...n},r)=>{const o=t?qx:"a";return d.jsx(o,{ref:r,className:ze("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",e),...n})});lc.displayName="BreadcrumbLink";const jL=C.forwardRef(({className:t,...e},n)=>d.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ze("font-normal text-foreground","s3-explr-ui-breadcrumb-page",t),...e}));jL.displayName="BreadcrumbPage";const jd=({children:t,className:e,...n})=>d.jsx("li",{role:"presentation","aria-hidden":"true",className:ze("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",e),...n,children:t??d.jsx(Hx,{})});jd.displayName="BreadcrumbSeparator";const nS=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,rS=zx,mg=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return rS(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=e,s=Object.keys(o).map(h=>{const p=n==null?void 0:n[h],g=a==null?void 0:a[h];if(p===null)return null;const w=nS(p)||nS(g);return o[h][w]}),l=n&&Object.entries(n).reduce((h,p)=>{let[g,w]=p;return w===void 0||(h[g]=w),h},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:w,...y}=p;return Object.entries(y).every(x=>{let[v,b]=x;return Array.isArray(b)?b.includes({...a,...l}[v]):{...a,...l}[v]===b})?[...h,g,w]:h},[]);return rS(t,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},oS=mg("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"}}),He=C.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...o},a)=>{const s=r?qx:"button";return d.jsx(s,{className:ze(oS({variant:e,size:n,className:t})),ref:a,...o})});He.displayName="Button";function iS(t){const e=C.useRef({value:t,previous:t});return C.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function vg(t){const[e,n]=C.useState(void 0);return tn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,h=Array.isArray(u)?u[0]:u;s=h.inlineSize,l=h.blockSize}else s=t.offsetWidth,l=t.offsetHeight;n({width:s,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Wd="Checkbox",[WL,$j]=yr(Wd),[qL,yg]=WL(Wd);function YL(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:a,form:s,name:l,onCheckedChange:u,required:h,value:p="on",internal_do_not_use_render:g}=t,[w,y]=ui({prop:n,defaultProp:o??!1,onChange:u,caller:Wd}),[x,v]=C.useState(null),[b,E]=C.useState(null),T=C.useRef(!1),N=x?!!s||!!x.closest("form"):!0,P={checked:w,disabled:a,setChecked:y,control:x,setControl:v,name:l,form:s,value:p,hasConsumerStoppedPropagationRef:T,required:h,defaultChecked:wi(o)?!1:o,isFormControl:N,bubbleInput:b,setBubbleInput:E};return d.jsx(qL,{scope:e,...P,children:JL(g)?g(P):r})}var aS="CheckboxTrigger",sS=C.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},o)=>{const{control:a,value:s,disabled:l,checked:u,required:h,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:w,isFormControl:y,bubbleInput:x}=yg(aS,t),v=rt(o,p),b=C.useRef(u);return C.useEffect(()=>{const E=a==null?void 0:a.form;if(E){const T=()=>g(b.current);return E.addEventListener("reset",T),()=>E.removeEventListener("reset",T)}},[a,g]),d.jsx(mt.button,{type:"button",role:"checkbox","aria-checked":wi(u)?"mixed":u,"aria-required":h,"data-state":fS(u),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:v,onKeyDown:Ue(e,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Ue(n,E=>{g(T=>wi(T)?!0:!T),x&&y&&(w.current=E.isPropagationStopped(),w.current||E.stopPropagation())})})});sS.displayName=aS;var wg=C.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:s,disabled:l,value:u,onCheckedChange:h,form:p,...g}=t;return d.jsx(YL,{__scopeCheckbox:n,checked:o,defaultChecked:a,disabled:l,required:s,onCheckedChange:h,name:r,form:p,value:u,internal_do_not_use_render:({isFormControl:w})=>d.jsxs(d.Fragment,{children:[d.jsx(sS,{...g,ref:e,__scopeCheckbox:n}),w&&d.jsx(uS,{__scopeCheckbox:n})]})})});wg.displayName=Wd;var cS="CheckboxIndicator",lS=C.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...o}=t,a=yg(cS,n);return d.jsx(Ro,{present:r||wi(a.checked)||a.checked===!0,children:d.jsx(mt.span,{"data-state":fS(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:e,style:{pointerEvents:"none",...t.style}})})});lS.displayName=cS;var dS="CheckboxBubbleInput",uS=C.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:s,required:l,disabled:u,name:h,value:p,form:g,bubbleInput:w,setBubbleInput:y}=yg(dS,t),x=rt(n,y),v=iS(a),b=vg(r);C.useEffect(()=>{const T=w;if(!T)return;const N=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(N,"checked").set,D=!o.current;if(v!==a&&_){const H=new Event("click",{bubbles:D});T.indeterminate=wi(a),_.call(T,wi(a)?!1:a),T.dispatchEvent(H)}},[w,v,a,o]);const E=C.useRef(wi(a)?!1:a);return d.jsx(mt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??E.current,required:l,disabled:u,name:h,value:p,form:g,...e,tabIndex:-1,ref:x,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});uS.displayName=dS;function JL(t){return typeof t=="function"}function wi(t){return t==="indeterminate"}function fS(t){return wi(t)?"indeterminate":t?"checked":"unchecked"}const dc=C.forwardRef(({className:t,...e},n)=>d.jsx(wg,{ref:n,className:ze("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",t),...e,children:d.jsx(lS,{className:ze("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:d.jsx($x,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));dc.displayName=wg.displayName;const lr=Qs,uc=lM,QL=dM,hS=C.forwardRef(({className:t,...e},n)=>d.jsx(Ga,{ref:n,className:ze("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",t),...e}));hS.displayName=Ga.displayName;const Vn=C.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(QL,{children:[d.jsx(hS,{}),d.jsxs(ja,{ref:r,className:ze("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",t),...n,children:[e,d.jsxs(kp,{className:ze("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:[d.jsx(lg,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),d.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Vn.displayName=ja.displayName;const Kn=({className:t,...e})=>d.jsx("div",{className:ze("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Kn.displayName="DialogHeader";const Fr=({className:t,...e})=>d.jsx("div",{className:ze("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Fr.displayName="DialogFooter";const Gn=C.forwardRef(({className:t,...e},n)=>d.jsx(Pb,{ref:n,className:ze("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",t),...e}));Gn.displayName=Pb.displayName;const Ci=C.forwardRef(({className:t,...e},n)=>d.jsx(Ob,{ref:n,className:ze("s3-explr-ui-dialog-description text-sm text-muted-foreground",t),...e}));Ci.displayName=Ob.displayName;const jn=C.forwardRef(({className:t,type:e,...n},r)=>d.jsx("input",{type:e,className:ze("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",t),ref:r,...n}));jn.displayName="Input";var XL="Label",pS=C.forwardRef((t,e)=>d.jsx(mt.label,{...t,ref:e,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pS.displayName=XL;var gS=pS;const ZL=mg("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"}}),wr=C.forwardRef(({className:t,variant:e,size:n,...r},o)=>d.jsx(gS,{ref:o,className:ze(ZL({variant:e,size:n}),t),...r}));wr.displayName=gS.displayName;const qd=({className:t,...e})=>d.jsx("nav",{role:"navigation","aria-label":"pagination",className:ze("mx-auto flex w-full justify-center",t),...e});qd.displayName="Pagination";const Yd=C.forwardRef(({className:t,...e},n)=>d.jsx("ul",{ref:n,className:ze("flex flex-row items-center gap-1",t),...e}));Yd.displayName="PaginationContent";const $r=C.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:ze("",t),...e}));$r.displayName="PaginationItem";const Qa=({className:t,isActive:e,size:n="icon",...r})=>d.jsx("a",{"aria-current":e?"page":void 0,className:ze(oS({variant:e?"outline":"ghost",size:n}),t),...r});Qa.displayName="PaginationLink";const Jd=({className:t,...e})=>d.jsxs(Qa,{"aria-label":"Go to previous page",size:"default",className:ze("gap-1 pl-2.5",t),...e,children:[d.jsx(BD,{className:"h-4 w-4"}),d.jsx("span",{children:"Previous"})]});Jd.displayName="PaginationPrevious";const Qd=({className:t,...e})=>d.jsxs(Qa,{"aria-label":"Go to next page",size:"default",className:ze("gap-1 pr-2.5",t),...e,children:[d.jsx("span",{children:"Next"}),d.jsx(Hx,{className:"h-4 w-4"})]});Qd.displayName="PaginationNext";const Xd=({className:t,...e})=>d.jsxs("span",{"aria-hidden":!0,className:ze("flex h-9 w-9 items-center justify-center",t),...e,children:[d.jsx(zD,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"More pages"})]});Xd.displayName="PaginationEllipsis";const Zd=C.forwardRef(({className:t,...e},n)=>d.jsx("div",{className:ze("relative w-full overflow-auto","s3-explr-ui-table-container"),children:d.jsx("table",{ref:n,className:ze("w-full caption-bottom text-sm","s3-explr-ui-table",t),...e})}));Zd.displayName="Table";const eu=C.forwardRef(({className:t,...e},n)=>d.jsx("thead",{ref:n,className:ze("[&_tr]:border-b","s3-explr-ui-table-header",t),...e}));eu.displayName="TableHeader";const tu=C.forwardRef(({className:t,...e},n)=>d.jsx("tbody",{ref:n,className:ze("[&_tr:last-child]:border-0","s3-explr-ui-table-body",t),...e}));tu.displayName="TableBody";const eF=C.forwardRef(({className:t,...e},n)=>d.jsx("tfoot",{ref:n,className:ze("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",t),...e}));eF.displayName="TableFooter";const Hr=C.forwardRef(({className:t,...e},n)=>d.jsx("tr",{ref:n,className:ze("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",t),...e}));Hr.displayName="TableRow";const po=C.forwardRef(({className:t,...e},n)=>d.jsx("th",{ref:n,className:ze("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",t),...e}));po.displayName="TableHead";const Wn=C.forwardRef(({className:t,...e},n)=>d.jsx("td",{ref:n,className:ze("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",t),...e}));Wn.displayName="TableCell";const tF=C.forwardRef(({className:t,...e},n)=>d.jsx("caption",{ref:n,className:ze("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",t),...e}));tF.displayName="TableCaption";function mS(t){const e=nF(t),n=C.forwardRef((r,o)=>{const{children:a,...s}=r,l=C.Children.toArray(a),u=l.find(oF);if(u){const h=u.props.children,p=l.map(g=>g===u?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:g);return d.jsx(e,{...s,ref:o,children:C.isValidElement(h)?C.cloneElement(h,void 0,p):null})}return d.jsx(e,{...s,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}function nF(t){const e=C.forwardRef((n,r)=>{const{children:o,...a}=n,s=C.isValidElement(o)?aF(o):void 0,l=rt(s,r);if(C.isValidElement(o)){const u=iF(a,o.props);return o.type!==C.Fragment&&(u.ref=l),C.cloneElement(o,u)}return C.Children.count(o)>1?C.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var rF=Symbol("radix.slottable");function oF(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===rF}function iF(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function aF(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function sF(t){const e=t+"CollectionProvider",[n,r]=yr(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:b,children:E}=v,T=M.useRef(null),N=M.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:N,collectionRef:T,children:E})};s.displayName=e;const l=t+"CollectionSlot",u=mS(l),h=M.forwardRef((v,b)=>{const{scope:E,children:T}=v,N=a(l,E),P=rt(b,N.collectionRef);return d.jsx(u,{ref:P,children:T})});h.displayName=l;const p=t+"CollectionItemSlot",g="data-radix-collection-item",w=mS(p),y=M.forwardRef((v,b)=>{const{scope:E,children:T,...N}=v,P=M.useRef(null),_=rt(b,P),D=a(p,E);return M.useEffect(()=>(D.itemMap.set(P,{ref:P,...N}),()=>void D.itemMap.delete(P))),d.jsx(w,{[g]:"",ref:_,children:T})});y.displayName=p;function x(v){const b=a(t+"CollectionConsumer",v);return M.useCallback(()=>{const T=b.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((D,H)=>N.indexOf(D.ref.current)-N.indexOf(H.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},x,r]}var cF=C.createContext(void 0);function Cg(t){const e=C.useContext(cF);return t||e||"ltr"}var bg="rovingFocusGroup.onEntryFocus",lF={bubbles:!1,cancelable:!0},fc="RovingFocusGroup",[xg,vS,dF]=sF(fc),[uF,yS]=yr(fc,[dF]),[fF,hF]=uF(fc),wS=C.forwardRef((t,e)=>d.jsx(xg.Provider,{scope:t.__scopeRovingFocusGroup,children:d.jsx(xg.Slot,{scope:t.__scopeRovingFocusGroup,children:d.jsx(pF,{...t,ref:e})})}));wS.displayName=fc;var pF=C.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...g}=t,w=C.useRef(null),y=rt(e,w),x=Cg(a),[v,b]=ui({prop:s,defaultProp:l??null,onChange:u,caller:fc}),[E,T]=C.useState(!1),N=gn(h),P=vS(n),_=C.useRef(!1),[D,H]=C.useState(0);return C.useEffect(()=>{const K=w.current;if(K)return K.addEventListener(bg,N),()=>K.removeEventListener(bg,N)},[N]),d.jsx(fF,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:v,onItemFocus:C.useCallback(K=>b(K),[b]),onItemShiftTab:C.useCallback(()=>T(!0),[]),onFocusableItemAdd:C.useCallback(()=>H(K=>K+1),[]),onFocusableItemRemove:C.useCallback(()=>H(K=>K-1),[]),children:d.jsx(mt.div,{tabIndex:E||D===0?-1:0,"data-orientation":r,...g,ref:y,style:{outline:"none",...t.style},onMouseDown:Ue(t.onMouseDown,()=>{_.current=!0}),onFocus:Ue(t.onFocus,K=>{const ee=!_.current;if(K.target===K.currentTarget&&ee&&!E){const W=new CustomEvent(bg,lF);if(K.currentTarget.dispatchEvent(W),!W.defaultPrevented){const de=P().filter(Y=>Y.focusable),se=de.find(Y=>Y.active),he=de.find(Y=>Y.id===v),Z=[se,he,...de].filter(Boolean).map(Y=>Y.ref.current);xS(Z,p)}}_.current=!1}),onBlur:Ue(t.onBlur,()=>T(!1))})})}),CS="RovingFocusGroupItem",bS=C.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...l}=t,u=Mo(),h=a||u,p=hF(CS,n),g=p.currentTabStopId===h,w=vS(n),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:v}=p;return C.useEffect(()=>{if(r)return y(),()=>x()},[r,y,x]),d.jsx(xg.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:d.jsx(mt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...l,ref:e,onMouseDown:Ue(t.onMouseDown,b=>{r?p.onItemFocus(h):b.preventDefault()}),onFocus:Ue(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:Ue(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){p.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const E=vF(b,p.orientation,p.dir);if(E!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let N=w().filter(P=>P.focusable).map(P=>P.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const P=N.indexOf(b.currentTarget);N=p.loop?yF(N,P+1):N.slice(P+1)}setTimeout(()=>xS(N))}}),children:typeof s=="function"?s({isCurrentTabStop:g,hasTabStop:v!=null}):s})})});bS.displayName=CS;var gF={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mF(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function vF(t,e,n){const r=mF(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gF[r]}function xS(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function yF(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var wF=wS,CF=bS,nu="Tabs",[bF,Hj]=yr(nu,[yS]),SS=yS(),[xF,Sg]=bF(nu),_S=C.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:l,activationMode:u="automatic",...h}=t,p=Cg(l),[g,w]=ui({prop:r,onChange:o,defaultProp:a??"",caller:nu});return d.jsx(xF,{scope:n,baseId:Mo(),value:g,onValueChange:w,orientation:s,dir:p,activationMode:u,children:d.jsx(mt.div,{dir:p,"data-orientation":s,...h,ref:e})})});_S.displayName=nu;var ES="TabsList",TS=C.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,a=Sg(ES,n),s=SS(n);return d.jsx(wF,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:d.jsx(mt.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:e})})});TS.displayName=ES;var AS="TabsTrigger",IS=C.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=t,s=Sg(AS,n),l=SS(n),u=PS(s.baseId,r),h=OS(s.baseId,r),p=r===s.value;return d.jsx(CF,{asChild:!0,...l,focusable:!o,active:p,children:d.jsx(mt.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":h,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...a,ref:e,onMouseDown:Ue(t.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?s.onValueChange(r):g.preventDefault()}),onKeyDown:Ue(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&s.onValueChange(r)}),onFocus:Ue(t.onFocus,()=>{const g=s.activationMode!=="manual";!p&&!o&&g&&s.onValueChange(r)})})})});IS.displayName=AS;var kS="TabsContent",NS=C.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...s}=t,l=Sg(kS,n),u=PS(l.baseId,r),h=OS(l.baseId,r),p=r===l.value,g=C.useRef(p);return C.useEffect(()=>{const w=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(w)},[]),d.jsx(Ro,{present:o||p,children:({present:w})=>d.jsx(mt.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!w,id:h,tabIndex:0,...s,ref:e,style:{...t.style,animationDuration:g.current?"0s":void 0},children:w&&a})})});NS.displayName=kS;function PS(t,e){return`${t}-trigger-${e}`}function OS(t,e){return`${t}-content-${e}`}var SF=_S,MS=TS,RS=IS,DS=NS;const _g=SF,ru=C.forwardRef(({className:t,...e},n)=>d.jsx(MS,{ref:n,className:ze("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));ru.displayName=MS.displayName;const qi=C.forwardRef(({className:t,...e},n)=>d.jsx(RS,{ref:n,className:ze("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",t),...e}));qi.displayName=RS.displayName;const Yi=C.forwardRef(({className:t,...e},n)=>d.jsx(DS,{ref:n,className:ze("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Yi.displayName=DS.displayName;const hc=C.forwardRef(({className:t,...e},n)=>d.jsx("textarea",{className:ze("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",t),ref:n,...e}));hc.displayName="Textarea";function LS(t){const e=_F(t),n=C.forwardRef((r,o)=>{const{children:a,...s}=r,l=C.Children.toArray(a),u=l.find(TF);if(u){const h=u.props.children,p=l.map(g=>g===u?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:g);return d.jsx(e,{...s,ref:o,children:C.isValidElement(h)?C.cloneElement(h,void 0,p):null})}return d.jsx(e,{...s,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}function _F(t){const e=C.forwardRef((n,r)=>{const{children:o,...a}=n,s=C.isValidElement(o)?IF(o):void 0,l=rt(s,r);if(C.isValidElement(o)){const u=AF(a,o.props);return o.type!==C.Fragment&&(u.ref=l),C.cloneElement(o,u)}return C.Children.count(o)>1?C.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var EF=Symbol("radix.slottable");function TF(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===EF}function AF(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function IF(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function kF(t){const e=t+"CollectionProvider",[n,r]=yr(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:b,children:E}=v,T=M.useRef(null),N=M.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:N,collectionRef:T,children:E})};s.displayName=e;const l=t+"CollectionSlot",u=LS(l),h=M.forwardRef((v,b)=>{const{scope:E,children:T}=v,N=a(l,E),P=rt(b,N.collectionRef);return d.jsx(u,{ref:P,children:T})});h.displayName=l;const p=t+"CollectionItemSlot",g="data-radix-collection-item",w=LS(p),y=M.forwardRef((v,b)=>{const{scope:E,children:T,...N}=v,P=M.useRef(null),_=rt(b,P),D=a(p,E);return M.useEffect(()=>(D.itemMap.set(P,{ref:P,...N}),()=>void D.itemMap.delete(P))),d.jsx(w,{[g]:"",ref:_,children:T})});y.displayName=p;function x(v){const b=a(t+"CollectionConsumer",v);return M.useCallback(()=>{const T=b.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((D,H)=>N.indexOf(D.ref.current)-N.indexOf(H.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},x,r]}var NF=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),PF="VisuallyHidden",Eg=C.forwardRef((t,e)=>d.jsx(mt.span,{...t,ref:e,style:{...NF,...t.style}}));Eg.displayName=PF;var Tg="ToastProvider",[Ag,OF,MF]=kF("Toast"),[FS,Uj]=yr("Toast",[MF]),[RF,ou]=FS(Tg),$S=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:s}=t,[l,u]=C.useState(null),[h,p]=C.useState(0),g=C.useRef(!1),w=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Tg}\`. Expected non-empty \`string\`.`),d.jsx(Ag.Provider,{scope:e,children:d.jsx(RF,{scope:e,label:n,duration:r,swipeDirection:o,swipeThreshold:a,toastCount:h,viewport:l,onViewportChange:u,onToastAdd:C.useCallback(()=>p(y=>y+1),[]),onToastRemove:C.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:w,children:s})})};$S.displayName=Tg;var HS="ToastViewport",DF=["F8"],Ig="toast.viewportPause",kg="toast.viewportResume",US=C.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=DF,label:o="Notifications ({hotkey})",...a}=t,s=ou(HS,n),l=OF(n),u=C.useRef(null),h=C.useRef(null),p=C.useRef(null),g=C.useRef(null),w=rt(e,g,s.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=s.toastCount>0;C.useEffect(()=>{const b=E=>{var N;r.length!==0&&r.every(P=>E[P]||E.code===P)&&((N=g.current)==null||N.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),C.useEffect(()=>{const b=u.current,E=g.current;if(x&&b&&E){const T=()=>{if(!s.isClosePausedRef.current){const D=new CustomEvent(Ig);E.dispatchEvent(D),s.isClosePausedRef.current=!0}},N=()=>{if(s.isClosePausedRef.current){const D=new CustomEvent(kg);E.dispatchEvent(D),s.isClosePausedRef.current=!1}},P=D=>{!b.contains(D.relatedTarget)&&N()},_=()=>{b.contains(document.activeElement)||N()};return b.addEventListener("focusin",T),b.addEventListener("focusout",P),b.addEventListener("pointermove",T),b.addEventListener("pointerleave",_),window.addEventListener("blur",T),window.addEventListener("focus",N),()=>{b.removeEventListener("focusin",T),b.removeEventListener("focusout",P),b.removeEventListener("pointermove",T),b.removeEventListener("pointerleave",_),window.removeEventListener("blur",T),window.removeEventListener("focus",N)}}},[x,s.isClosePausedRef]);const v=C.useCallback(({tabbingDirection:b})=>{const T=l().map(N=>{const P=N.ref.current,_=[P,...qF(P)];return b==="forwards"?_:_.reverse()});return(b==="forwards"?T.reverse():T).flat()},[l]);return C.useEffect(()=>{const b=g.current;if(b){const E=T=>{var _,D,H;const N=T.altKey||T.ctrlKey||T.metaKey;if(T.key==="Tab"&&!N){const K=document.activeElement,ee=T.shiftKey;if(T.target===b&&ee){(_=h.current)==null||_.focus();return}const se=v({tabbingDirection:ee?"backwards":"forwards"}),he=se.findIndex(q=>q===K);Og(se.slice(he+1))?T.preventDefault():ee?(D=h.current)==null||D.focus():(H=p.current)==null||H.focus()}};return b.addEventListener("keydown",E),()=>b.removeEventListener("keydown",E)}},[l,v]),d.jsxs(XO,{ref:u,role:"region","aria-label":o.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&d.jsx(Ng,{ref:h,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"forwards"});Og(b)}}),d.jsx(Ag.Slot,{scope:n,children:d.jsx(mt.ol,{tabIndex:-1,...a,ref:w})}),x&&d.jsx(Ng,{ref:p,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"backwards"});Og(b)}})]})});US.displayName=HS;var BS="ToastFocusProxy",Ng=C.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=t,a=ou(BS,n);return d.jsx(Eg,{"aria-hidden":!0,tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:s=>{var h;const l=s.relatedTarget;!((h=a.viewport)!=null&&h.contains(l))&&r()}})});Ng.displayName=BS;var pc="Toast",LF="toast.swipeStart",FF="toast.swipeMove",$F="toast.swipeCancel",HF="toast.swipeEnd",zS=C.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:a,...s}=t,[l,u]=ui({prop:r,defaultProp:o??!0,onChange:a,caller:pc});return d.jsx(Ro,{present:n||l,children:d.jsx(zF,{open:l,...s,ref:e,onClose:()=>u(!1),onPause:gn(t.onPause),onResume:gn(t.onResume),onSwipeStart:Ue(t.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ue(t.onSwipeMove,h=>{const{x:p,y:g}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Ue(t.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ue(t.onSwipeEnd,h=>{const{x:p,y:g}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});zS.displayName=pc;var[UF,BF]=FS(pc,{onClose(){}}),zF=C.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:a,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:h,onSwipeStart:p,onSwipeMove:g,onSwipeCancel:w,onSwipeEnd:y,...x}=t,v=ou(pc,n),[b,E]=C.useState(null),T=rt(e,q=>E(q)),N=C.useRef(null),P=C.useRef(null),_=o||v.duration,D=C.useRef(0),H=C.useRef(_),K=C.useRef(0),{onToastAdd:ee,onToastRemove:W}=v,de=gn(()=>{var Z;(b==null?void 0:b.contains(document.activeElement))&&((Z=v.viewport)==null||Z.focus()),s()}),se=C.useCallback(q=>{!q||q===1/0||(window.clearTimeout(K.current),D.current=new Date().getTime(),K.current=window.setTimeout(de,q))},[de]);C.useEffect(()=>{const q=v.viewport;if(q){const Z=()=>{se(H.current),h==null||h()},Y=()=>{const oe=new Date().getTime()-D.current;H.current=H.current-oe,window.clearTimeout(K.current),u==null||u()};return q.addEventListener(Ig,Y),q.addEventListener(kg,Z),()=>{q.removeEventListener(Ig,Y),q.removeEventListener(kg,Z)}}},[v.viewport,_,u,h,se]),C.useEffect(()=>{a&&!v.isClosePausedRef.current&&se(_)},[a,_,v.isClosePausedRef,se]),C.useEffect(()=>(ee(),()=>W()),[ee,W]);const he=C.useMemo(()=>b?YS(b):null,[b]);return v.viewport?d.jsxs(d.Fragment,{children:[he&&d.jsx(VF,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:he}),d.jsx(UF,{scope:n,onClose:de,children:Aa.createPortal(d.jsx(Ag.ItemSlot,{scope:n,children:d.jsx(QO,{asChild:!0,onEscapeKeyDown:Ue(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||de(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(mt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":v.swipeDirection,...x,ref:T,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ue(t.onKeyDown,q=>{q.key==="Escape"&&(l==null||l(q.nativeEvent),q.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,de()))}),onPointerDown:Ue(t.onPointerDown,q=>{q.button===0&&(N.current={x:q.clientX,y:q.clientY})}),onPointerMove:Ue(t.onPointerMove,q=>{if(!N.current)return;const Z=q.clientX-N.current.x,Y=q.clientY-N.current.y,oe=!!P.current,Q=["left","right"].includes(v.swipeDirection),X=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,$=Q?X(0,Z):0,te=Q?0:X(0,Y),_e=q.pointerType==="touch"?10:2,ke={x:$,y:te},xe={originalEvent:q,delta:ke};oe?(P.current=ke,iu(FF,g,xe,{discrete:!1})):JS(ke,v.swipeDirection,_e)?(P.current=ke,iu(LF,p,xe,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(Z)>_e||Math.abs(Y)>_e)&&(N.current=null)}),onPointerUp:Ue(t.onPointerUp,q=>{const Z=P.current,Y=q.target;if(Y.hasPointerCapture(q.pointerId)&&Y.releasePointerCapture(q.pointerId),P.current=null,N.current=null,Z){const oe=q.currentTarget,Q={originalEvent:q,delta:Z};JS(Z,v.swipeDirection,v.swipeThreshold)?iu(HF,y,Q,{discrete:!0}):iu($F,w,Q,{discrete:!0}),oe.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),VF=t=>{const{__scopeToast:e,children:n,...r}=t,o=ou(pc,e),[a,s]=C.useState(!1),[l,u]=C.useState(!1);return jF(()=>s(!0)),C.useEffect(()=>{const h=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(h)},[]),l?null:d.jsx(ud,{asChild:!0,children:d.jsx(Eg,{...r,children:a&&d.jsxs(d.Fragment,{children:[o.label," ",n]})})})},KF="ToastTitle",VS=C.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(mt.div,{...r,ref:e})});VS.displayName=KF;var GF="ToastDescription",KS=C.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(mt.div,{...r,ref:e})});KS.displayName=GF;var GS="ToastAction",jS=C.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?d.jsx(qS,{altText:n,asChild:!0,children:d.jsx(Pg,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${GS}\`. Expected non-empty \`string\`.`),null)});jS.displayName=GS;var WS="ToastClose",Pg=C.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,o=BF(WS,n);return d.jsx(qS,{asChild:!0,children:d.jsx(mt.button,{type:"button",...r,ref:e,onClick:Ue(t.onClick,o.onClose)})})});Pg.displayName=WS;var qS=C.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...o}=t;return d.jsx(mt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:e})});function YS(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),WF(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!o)if(a){const s=r.dataset.radixToastAnnounceAlt;s&&e.push(s)}else e.push(...YS(r))}}),e}function iu(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?$C(o,a):o.dispatchEvent(a)}var JS=(t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),a=r>o;return e==="left"||e==="right"?a&&r>n:!a&&o>n};function jF(t=()=>{}){const e=gn(t);tn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function WF(t){return t.nodeType===t.ELEMENT_NODE}function qF(t){const e=[],n=document.createTreeWalker(t,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();)e.push(n.currentNode);return e}function Og(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var YF=$S,QS=US,XS=zS,ZS=VS,e_=KS,t_=jS,n_=Pg;const JF=YF,r_=C.forwardRef(({className:t,...e},n)=>d.jsx(QS,{ref:n,className:ze("s3-explr-ui-toast-viewport fixed top-0 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] z-[10000]",t),...e}));r_.displayName=QS.displayName;const QF=mg("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"}}),o_=C.forwardRef(({className:t,variant:e,...n},r)=>d.jsx(XS,{ref:r,className:ze(QF({variant:e}),t),...n}));o_.displayName=XS.displayName;const XF=C.forwardRef(({className:t,...e},n)=>d.jsx(t_,{ref:n,className:ze("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",t),...e}));XF.displayName=t_.displayName;const i_=C.forwardRef(({className:t,...e},n)=>d.jsx(n_,{ref:n,className:ze("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity duration-200 ease-in-out 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 font-bold",t),"toast-close":"",...e,children:d.jsx(lg,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));i_.displayName=n_.displayName;const a_=C.forwardRef(({className:t,...e},n)=>d.jsx(ZS,{ref:n,className:ze("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",t),...e}));a_.displayName=ZS.displayName;const s_=C.forwardRef(({className:t,...e},n)=>d.jsx(e_,{ref:n,className:ze("text-sm opacity-90 font-bold",t),...e}));s_.displayName=e_.displayName;const ZF=1,e2=1e6;let Mg=0;function t2(){return Mg=(Mg+1)%Number.MAX_SAFE_INTEGER,Mg.toString()}const Rg=new Map,c_=t=>{if(Rg.has(t))return;const e=setTimeout(()=>{Rg.delete(t),gc({type:"REMOVE_TOAST",toastId:t})},e2);Rg.set(t,e)},n2=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,ZF)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?c_(n):t.toasts.forEach(r=>{c_(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},au=[];let su={toasts:[]};function gc(t){su=n2(su,t),au.forEach(e=>{e(su)})}function r2({...t}){const e=t2(),n=o=>gc({type:"UPDATE_TOAST",toast:{...o,id:e}}),r=()=>gc({type:"DISMISS_TOAST",toastId:e});return gc({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}function mc(){const[t,e]=C.useState(su);return C.useEffect(()=>(au.push(e),()=>{const n=au.indexOf(e);n>-1&&au.splice(n,1)}),[t]),{...t,toast:r2,dismiss:n=>gc({type:"DISMISS_TOAST",toastId:n})}}function l_(){const{toasts:t}=mc();return d.jsxs(JF,{children:[t.map(function({id:e,title:n,description:r,action:o,...a}){return d.jsxs(o_,{...a,className:`s3-explr-ui-toast ${a.className||""}`,children:[d.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&d.jsx(a_,{className:"s3-explr-ui-toast-title",children:n}),r&&d.jsx(s_,{className:"s3-explr-ui-toast-description",style:{wordBreak:"break-all",whiteSpace:"pre-line",maxWidth:400,overflowWrap:"break-word"},children:r})]}),o&&d.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),d.jsx(i_,{className:"s3-explr-ui-toast-close"})]},e)}),d.jsx(r_,{className:"s3-explr-ui-toast-viewport"})]})}const o2=["top","right","bottom","left"],bi=Math.min,dr=Math.max,cu=Math.round,lu=Math.floor,go=t=>({x:t,y:t}),i2={left:"right",right:"left",bottom:"top",top:"bottom"},a2={start:"end",end:"start"};function Dg(t,e,n){return dr(t,bi(e,n))}function $o(t,e){return typeof t=="function"?t(e):t}function Ho(t){return t.split("-")[0]}function Xa(t){return t.split("-")[1]}function Lg(t){return t==="x"?"y":"x"}function Fg(t){return t==="y"?"height":"width"}function Uo(t){return["top","bottom"].includes(Ho(t))?"y":"x"}function $g(t){return Lg(Uo(t))}function s2(t,e,n){n===void 0&&(n=!1);const r=Xa(t),o=$g(t),a=Fg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=du(s)),[s,du(s)]}function c2(t){const e=du(t);return[Hg(t),e,Hg(e)]}function Hg(t){return t.replace(/start|end/g,e=>a2[e])}function l2(t,e,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?a:s;default:return[]}}function d2(t,e,n,r){const o=Xa(t);let a=l2(Ho(t),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),e&&(a=a.concat(a.map(Hg)))),a}function du(t){return t.replace(/left|right|bottom|top/g,e=>i2[e])}function u2(t){return{top:0,right:0,bottom:0,left:0,...t}}function d_(t){return typeof t!="number"?u2(t):{top:t,right:t,bottom:t,left:t}}function uu(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function u_(t,e,n){let{reference:r,floating:o}=t;const a=Uo(e),s=$g(e),l=Fg(s),u=Ho(e),h=a==="y",p=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,w=r[l]/2-o[l]/2;let y;switch(u){case"top":y={x:p,y:r.y-o.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:g};break;case"left":y={x:r.x-o.width,y:g};break;default:y={x:r.x,y:r.y}}switch(Xa(e)){case"start":y[s]-=w*(n&&h?-1:1);break;case"end":y[s]+=w*(n&&h?-1:1);break}return y}const f2=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,l=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(e));let h=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:g}=u_(h,r,u),w=r,y={},x=0;for(let v=0;v<l.length;v++){const{name:b,fn:E}=l[v],{x:T,y:N,data:P,reset:_}=await E({x:p,y:g,initialPlacement:r,placement:w,strategy:o,middlewareData:y,rects:h,platform:s,elements:{reference:t,floating:e}});p=T??p,g=N??g,y={...y,[b]:{...y[b],...P}},_&&x<=50&&(x++,typeof _=="object"&&(_.placement&&(w=_.placement),_.rects&&(h=_.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):_.rects),{x:p,y:g}=u_(h,w,u)),v=-1)}return{x:p,y:g,placement:w,strategy:o,middlewareData:y}};async function vc(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:a,rects:s,elements:l,strategy:u}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:w=!1,padding:y=0}=$o(e,t),x=d_(y),b=l[w?g==="floating"?"reference":"floating":g],E=uu(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:h,rootBoundary:p,strategy:u})),T=g==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),P=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},_=uu(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:T,offsetParent:N,strategy:u}):T);return{top:(E.top-_.top+x.top)/P.y,bottom:(_.bottom-E.bottom+x.bottom)/P.y,left:(E.left-_.left+x.left)/P.x,right:(_.right-E.right+x.right)/P.x}}const h2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:a,platform:s,elements:l,middlewareData:u}=e,{element:h,padding:p=0}=$o(t,e)||{};if(h==null)return{};const g=d_(p),w={x:n,y:r},y=$g(o),x=Fg(y),v=await s.getDimensions(h),b=y==="y",E=b?"top":"left",T=b?"bottom":"right",N=b?"clientHeight":"clientWidth",P=a.reference[x]+a.reference[y]-w[y]-a.floating[x],_=w[y]-a.reference[y],D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h));let H=D?D[N]:0;(!H||!await(s.isElement==null?void 0:s.isElement(D)))&&(H=l.floating[N]||a.floating[x]);const K=P/2-_/2,ee=H/2-v[x]/2-1,W=bi(g[E],ee),de=bi(g[T],ee),se=W,he=H-v[x]-de,q=H/2-v[x]/2+K,Z=Dg(se,q,he),Y=!u.arrow&&Xa(o)!=null&&q!==Z&&a.reference[x]/2-(q<se?W:de)-v[x]/2<0,oe=Y?q<se?q-se:q-he:0;return{[y]:w[y]+oe,data:{[y]:Z,centerOffset:q-Z-oe,...Y&&{alignmentOffset:oe}},reset:Y}}}),p2=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:l,platform:u,elements:h}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:w,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=$o(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const E=Ho(o),T=Uo(l),N=Ho(l)===l,P=await(u.isRTL==null?void 0:u.isRTL(h.floating)),_=w||(N||!v?[du(l)]:c2(l)),D=x!=="none";!w&&D&&_.push(...d2(l,v,x,P));const H=[l,..._],K=await vc(e,b),ee=[];let W=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&ee.push(K[E]),g){const Z=s2(o,s,P);ee.push(K[Z[0]],K[Z[1]])}if(W=[...W,{placement:o,overflows:ee}],!ee.every(Z=>Z<=0)){var de,se;const Z=(((de=a.flip)==null?void 0:de.index)||0)+1,Y=H[Z];if(Y){var he;const Q=g==="alignment"?T!==Uo(Y):!1,X=((he=W[0])==null?void 0:he.overflows[0])>0;if(!Q||X)return{data:{index:Z,overflows:W},reset:{placement:Y}}}let oe=(se=W.filter(Q=>Q.overflows[0]<=0).sort((Q,X)=>Q.overflows[1]-X.overflows[1])[0])==null?void 0:se.placement;if(!oe)switch(y){case"bestFit":{var q;const Q=(q=W.filter(X=>{if(D){const $=Uo(X.placement);return $===T||$==="y"}return!0}).map(X=>[X.placement,X.overflows.filter($=>$>0).reduce(($,te)=>$+te,0)]).sort((X,$)=>X[1]-$[1])[0])==null?void 0:q[0];Q&&(oe=Q);break}case"initialPlacement":oe=l;break}if(o!==oe)return{reset:{placement:oe}}}return{}}}};function f_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function h_(t){return o2.some(e=>t[e]>=0)}const g2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=$o(t,e);switch(r){case"referenceHidden":{const a=await vc(e,{...o,elementContext:"reference"}),s=f_(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:h_(s)}}}case"escaped":{const a=await vc(e,{...o,altBoundary:!0}),s=f_(a,n.floating);return{data:{escapedOffsets:s,escaped:h_(s)}}}default:return{}}}}};async function m2(t,e){const{placement:n,platform:r,elements:o}=t,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ho(n),l=Xa(n),u=Uo(n)==="y",h=["left","top"].includes(s)?-1:1,p=a&&u?-1:1,g=$o(e,t);let{mainAxis:w,crossAxis:y,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof x=="number"&&(y=l==="end"?x*-1:x),u?{x:y*p,y:w*h}:{x:w*h,y:y*p}}const v2=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:a,placement:s,middlewareData:l}=e,u=await m2(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:s}}}}},y2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x:E,y:T}=b;return{x:E,y:T}}},...u}=$o(t,e),h={x:n,y:r},p=await vc(e,u),g=Uo(Ho(o)),w=Lg(g);let y=h[w],x=h[g];if(a){const b=w==="y"?"top":"left",E=w==="y"?"bottom":"right",T=y+p[b],N=y-p[E];y=Dg(T,y,N)}if(s){const b=g==="y"?"top":"left",E=g==="y"?"bottom":"right",T=x+p[b],N=x-p[E];x=Dg(T,x,N)}const v=l.fn({...e,[w]:y,[g]:x});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[w]:a,[g]:s}}}}}},w2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=e,{offset:l=0,mainAxis:u=!0,crossAxis:h=!0}=$o(t,e),p={x:n,y:r},g=Uo(o),w=Lg(g);let y=p[w],x=p[g];const v=$o(l,e),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const N=w==="y"?"height":"width",P=a.reference[w]-a.floating[N]+b.mainAxis,_=a.reference[w]+a.reference[N]-b.mainAxis;y<P?y=P:y>_&&(y=_)}if(h){var E,T;const N=w==="y"?"width":"height",P=["top","left"].includes(Ho(o)),_=a.reference[g]-a.floating[N]+(P&&((E=s.offset)==null?void 0:E[g])||0)+(P?0:b.crossAxis),D=a.reference[g]+a.reference[N]+(P?0:((T=s.offset)==null?void 0:T[g])||0)-(P?b.crossAxis:0);x<_?x=_:x>D&&(x=D)}return{[w]:y,[g]:x}}}},C2=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:a,platform:s,elements:l}=e,{apply:u=()=>{},...h}=$o(t,e),p=await vc(e,h),g=Ho(o),w=Xa(o),y=Uo(o)==="y",{width:x,height:v}=a.floating;let b,E;g==="top"||g==="bottom"?(b=g,E=w===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(E=g,b=w==="end"?"top":"bottom");const T=v-p.top-p.bottom,N=x-p.left-p.right,P=bi(v-p[b],T),_=bi(x-p[E],N),D=!e.middlewareData.shift;let H=P,K=_;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(K=N),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(H=T),D&&!w){const W=dr(p.left,0),de=dr(p.right,0),se=dr(p.top,0),he=dr(p.bottom,0);y?K=x-2*(W!==0||de!==0?W+de:dr(p.left,p.right)):H=v-2*(se!==0||he!==0?se+he:dr(p.top,p.bottom))}await u({...e,availableWidth:K,availableHeight:H});const ee=await s.getDimensions(l.floating);return x!==ee.width||v!==ee.height?{reset:{rects:!0}}:{}}}};function fu(){return typeof window<"u"}function Za(t){return p_(t)?(t.nodeName||"").toLowerCase():"#document"}function ur(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function mo(t){var e;return(e=(p_(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function p_(t){return fu()?t instanceof Node||t instanceof ur(t).Node:!1}function Ur(t){return fu()?t instanceof Element||t instanceof ur(t).Element:!1}function vo(t){return fu()?t instanceof HTMLElement||t instanceof ur(t).HTMLElement:!1}function g_(t){return!fu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ur(t).ShadowRoot}function yc(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Br(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function b2(t){return["table","td","th"].includes(Za(t))}function hu(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Ug(t){const e=Bg(),n=Ur(t)?Br(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function x2(t){let e=xi(t);for(;vo(e)&&!es(e);){if(Ug(e))return e;if(hu(e))return null;e=xi(e)}return null}function Bg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function es(t){return["html","body","#document"].includes(Za(t))}function Br(t){return ur(t).getComputedStyle(t)}function pu(t){return Ur(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xi(t){if(Za(t)==="html")return t;const e=t.assignedSlot||t.parentNode||g_(t)&&t.host||mo(t);return g_(e)?e.host:e}function m_(t){const e=xi(t);return es(e)?t.ownerDocument?t.ownerDocument.body:t.body:vo(e)&&yc(e)?e:m_(e)}function wc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=m_(t),a=o===((r=t.ownerDocument)==null?void 0:r.body),s=ur(o);if(a){const l=zg(s);return e.concat(s,s.visualViewport||[],yc(o)?o:[],l&&n?wc(l):[])}return e.concat(o,wc(o,[],n))}function zg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function v_(t){const e=Br(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=vo(t),a=o?t.offsetWidth:n,s=o?t.offsetHeight:r,l=cu(n)!==a||cu(r)!==s;return l&&(n=a,r=s),{width:n,height:r,$:l}}function Vg(t){return Ur(t)?t:t.contextElement}function ts(t){const e=Vg(t);if(!vo(e))return go(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:a}=v_(e);let s=(a?cu(n.width):n.width)/r,l=(a?cu(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const S2=go(0);function y_(t){const e=ur(t);return!Bg()||!e.visualViewport?S2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ur(t)?!1:e}function Ji(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),a=Vg(t);let s=go(1);e&&(r?Ur(r)&&(s=ts(r)):s=ts(t));const l=_2(a,n,r)?y_(a):go(0);let u=(o.left+l.x)/s.x,h=(o.top+l.y)/s.y,p=o.width/s.x,g=o.height/s.y;if(a){const w=ur(a),y=r&&Ur(r)?ur(r):r;let x=w,v=zg(x);for(;v&&r&&y!==x;){const b=ts(v),E=v.getBoundingClientRect(),T=Br(v),N=E.left+(v.clientLeft+parseFloat(T.paddingLeft))*b.x,P=E.top+(v.clientTop+parseFloat(T.paddingTop))*b.y;u*=b.x,h*=b.y,p*=b.x,g*=b.y,u+=N,h+=P,x=ur(v),v=zg(x)}}return uu({width:p,height:g,x:u,y:h})}function Kg(t,e){const n=pu(t).scrollLeft;return e?e.left+n:Ji(mo(t)).left+n}function w_(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),o=r.left+e.scrollLeft-(n?0:Kg(t,r)),a=r.top+e.scrollTop;return{x:o,y:a}}function E2(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const a=o==="fixed",s=mo(r),l=e?hu(e.floating):!1;if(r===s||l&&a)return n;let u={scrollLeft:0,scrollTop:0},h=go(1);const p=go(0),g=vo(r);if((g||!g&&!a)&&((Za(r)!=="body"||yc(s))&&(u=pu(r)),vo(r))){const y=Ji(r);h=ts(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const w=s&&!g&&!a?w_(s,u,!0):go(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-u.scrollLeft*h.x+p.x+w.x,y:n.y*h.y-u.scrollTop*h.y+p.y+w.y}}function T2(t){return Array.from(t.getClientRects())}function A2(t){const e=mo(t),n=pu(t),r=t.ownerDocument.body,o=dr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=dr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Kg(t);const l=-n.scrollTop;return Br(r).direction==="rtl"&&(s+=dr(e.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:l}}function I2(t,e){const n=ur(t),r=mo(t),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){a=o.width,s=o.height;const h=Bg();(!h||h&&e==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:a,height:s,x:l,y:u}}function k2(t,e){const n=Ji(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,a=vo(t)?ts(t):go(1),s=t.clientWidth*a.x,l=t.clientHeight*a.y,u=o*a.x,h=r*a.y;return{width:s,height:l,x:u,y:h}}function C_(t,e,n){let r;if(e==="viewport")r=I2(t,n);else if(e==="document")r=A2(mo(t));else if(Ur(e))r=k2(e,n);else{const o=y_(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return uu(r)}function b_(t,e){const n=xi(t);return n===e||!Ur(n)||es(n)?!1:Br(n).position==="fixed"||b_(n,e)}function N2(t,e){const n=e.get(t);if(n)return n;let r=wc(t,[],!1).filter(l=>Ur(l)&&Za(l)!=="body"),o=null;const a=Br(t).position==="fixed";let s=a?xi(t):t;for(;Ur(s)&&!es(s);){const l=Br(s),u=Ug(s);!u&&l.position==="fixed"&&(o=null),(a?!u&&!o:!u&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||yc(s)&&!u&&b_(t,s))?r=r.filter(p=>p!==s):o=l,s=xi(s)}return e.set(t,r),r}function P2(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?hu(e)?[]:N2(e,this._c):[].concat(n),r],l=s[0],u=s.reduce((h,p)=>{const g=C_(e,p,o);return h.top=dr(g.top,h.top),h.right=bi(g.right,h.right),h.bottom=bi(g.bottom,h.bottom),h.left=dr(g.left,h.left),h},C_(e,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function O2(t){const{width:e,height:n}=v_(t);return{width:e,height:n}}function M2(t,e,n){const r=vo(e),o=mo(e),a=n==="fixed",s=Ji(t,!0,a,e);let l={scrollLeft:0,scrollTop:0};const u=go(0);function h(){u.x=Kg(o)}if(r||!r&&!a)if((Za(e)!=="body"||yc(o))&&(l=pu(e)),r){const y=Ji(e,!0,a,e);u.x=y.x+e.clientLeft,u.y=y.y+e.clientTop}else o&&h();a&&!r&&o&&h();const p=o&&!r&&!a?w_(o,l):go(0),g=s.left+l.scrollLeft-u.x-p.x,w=s.top+l.scrollTop-u.y-p.y;return{x:g,y:w,width:s.width,height:s.height}}function Gg(t){return Br(t).position==="static"}function x_(t,e){if(!vo(t)||Br(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return mo(t)===n&&(n=n.ownerDocument.body),n}function S_(t,e){const n=ur(t);if(hu(t))return n;if(!vo(t)){let o=xi(t);for(;o&&!es(o);){if(Ur(o)&&!Gg(o))return o;o=xi(o)}return n}let r=x_(t,e);for(;r&&b2(r)&&Gg(r);)r=x_(r,e);return r&&es(r)&&Gg(r)&&!Ug(r)?n:r||x2(t)||n}const R2=async function(t){const e=this.getOffsetParent||S_,n=this.getDimensions,r=await n(t.floating);return{reference:M2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function D2(t){return Br(t).direction==="rtl"}const L2={convertOffsetParentRelativeRectToViewportRelativeRect:E2,getDocumentElement:mo,getClippingRect:P2,getOffsetParent:S_,getElementRects:R2,getClientRects:T2,getDimensions:O2,getScale:ts,isElement:Ur,isRTL:D2};function __(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function F2(t,e){let n=null,r;const o=mo(t);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),a();const h=t.getBoundingClientRect(),{left:p,top:g,width:w,height:y}=h;if(l||e(),!w||!y)return;const x=lu(g),v=lu(o.clientWidth-(p+w)),b=lu(o.clientHeight-(g+y)),E=lu(p),N={rootMargin:-x+"px "+-v+"px "+-b+"px "+-E+"px",threshold:dr(0,bi(1,u))||1};let P=!0;function _(D){const H=D[0].intersectionRatio;if(H!==u){if(!P)return s();H?s(!1,H):r=setTimeout(()=>{s(!1,1e-7)},1e3)}H===1&&!__(h,t.getBoundingClientRect())&&s(),P=!1}try{n=new IntersectionObserver(_,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(_,N)}n.observe(t)}return s(!0),a}function E_(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,h=Vg(t),p=o||a?[...h?wc(h):[],...wc(e)]:[];p.forEach(E=>{o&&E.addEventListener("scroll",n,{passive:!0}),a&&E.addEventListener("resize",n)});const g=h&&l?F2(h,n):null;let w=-1,y=null;s&&(y=new ResizeObserver(E=>{let[T]=E;T&&T.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(e)})),n()}),h&&!u&&y.observe(h),y.observe(e));let x,v=u?Ji(t):null;u&&b();function b(){const E=Ji(t);v&&!__(v,E)&&n(),v=E,x=requestAnimationFrame(b)}return n(),()=>{var E;p.forEach(T=>{o&&T.removeEventListener("scroll",n),a&&T.removeEventListener("resize",n)}),g==null||g(),(E=y)==null||E.disconnect(),y=null,u&&cancelAnimationFrame(x)}}const $2=v2,H2=y2,U2=p2,B2=C2,z2=g2,T_=h2,V2=w2,K2=(t,e,n)=>{const r=new Map,o={platform:L2,...n},a={...o.platform,_c:r};return f2(t,e,{...o,platform:a})};var gu=typeof document<"u"?M.useLayoutEffect:M.useEffect;function mu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!mu(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&t.$$typeof)&&!mu(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function A_(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function I_(t,e){const n=A_(t);return Math.round(e*n)/n}function jg(t){const e=C.useRef(t);return gu(()=>{e.current=t}),e}function k_(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:h}=t,[p,g]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[w,y]=C.useState(r);mu(w,r)||y(r);const[x,v]=C.useState(null),[b,E]=C.useState(null),T=C.useCallback(Q=>{Q!==D.current&&(D.current=Q,v(Q))},[]),N=C.useCallback(Q=>{Q!==H.current&&(H.current=Q,E(Q))},[]),P=a||x,_=s||b,D=C.useRef(null),H=C.useRef(null),K=C.useRef(p),ee=u!=null,W=jg(u),de=jg(o),se=jg(h),he=C.useCallback(()=>{if(!D.current||!H.current)return;const Q={placement:e,strategy:n,middleware:w};de.current&&(Q.platform=de.current),K2(D.current,H.current,Q).then(X=>{const $={...X,isPositioned:se.current!==!1};q.current&&!mu(K.current,$)&&(K.current=$,Aa.flushSync(()=>{g($)}))})},[w,e,n,de,se]);gu(()=>{h===!1&&K.current.isPositioned&&(K.current.isPositioned=!1,g(Q=>({...Q,isPositioned:!1})))},[h]);const q=C.useRef(!1);gu(()=>(q.current=!0,()=>{q.current=!1}),[]),gu(()=>{if(P&&(D.current=P),_&&(H.current=_),P&&_){if(W.current)return W.current(P,_,he);he()}},[P,_,he,W,ee]);const Z=C.useMemo(()=>({reference:D,floating:H,setReference:T,setFloating:N}),[T,N]),Y=C.useMemo(()=>({reference:P,floating:_}),[P,_]),oe=C.useMemo(()=>{const Q={position:n,left:0,top:0};if(!Y.floating)return Q;const X=I_(Y.floating,p.x),$=I_(Y.floating,p.y);return l?{...Q,transform:"translate("+X+"px, "+$+"px)",...A_(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:$}},[n,l,Y.floating,p.x,p.y]);return C.useMemo(()=>({...p,update:he,refs:Z,elements:Y,floatingStyles:oe}),[p,he,Z,Y,oe])}const G2=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?T_({element:r.current,padding:o}).fn(n):{}:r?T_({element:r,padding:o}).fn(n):{}}}},N_=(t,e)=>({...$2(t),options:[t,e]}),P_=(t,e)=>({...H2(t),options:[t,e]}),O_=(t,e)=>({...V2(t),options:[t,e]}),M_=(t,e)=>({...U2(t),options:[t,e]}),R_=(t,e)=>({...B2(t),options:[t,e]}),D_=(t,e)=>({...z2(t),options:[t,e]}),L_=(t,e)=>({...G2(t),options:[t,e]});var j2="Arrow",F_=C.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...a}=t;return d.jsx(mt.svg,{...a,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});F_.displayName=j2;var W2=F_,Wg="Popper",[$_,H_]=yr(Wg),[q2,U_]=$_(Wg),B_=t=>{const{__scopePopper:e,children:n}=t,[r,o]=C.useState(null);return d.jsx(q2,{scope:e,anchor:r,onAnchorChange:o,children:n})};B_.displayName=Wg;var z_="PopperAnchor",V_=C.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,a=U_(z_,n),s=C.useRef(null),l=rt(e,s);return C.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:d.jsx(mt.div,{...o,ref:l})});V_.displayName=z_;var qg="PopperContent",[Y2,J2]=$_(qg),K_=C.forwardRef((t,e)=>{var z,ce,Ae,Ce,Ne,ne;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:x,...v}=t,b=U_(qg,n),[E,T]=C.useState(null),N=rt(e,Ve=>T(Ve)),[P,_]=C.useState(null),D=vg(P),H=(D==null?void 0:D.width)??0,K=(D==null?void 0:D.height)??0,ee=r+(a!=="center"?"-"+a:""),W=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},de=Array.isArray(h)?h:[h],se=de.length>0,he={padding:W,boundary:de.filter(X2),altBoundary:se},{refs:q,floatingStyles:Z,placement:Y,isPositioned:oe,middlewareData:Q}=k_({strategy:"fixed",placement:ee,whileElementsMounted:(...Ve)=>E_(...Ve,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[N_({mainAxis:o+K,alignmentAxis:s}),u&&P_({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?O_():void 0,...he}),u&&M_({...he}),R_({...he,apply:({elements:Ve,rects:Xe,availableWidth:Ct,availableHeight:Yt})=>{const{width:bt,height:rn}=Xe.reference,zt=Ve.floating.style;zt.setProperty("--radix-popper-available-width",`${Ct}px`),zt.setProperty("--radix-popper-available-height",`${Yt}px`),zt.setProperty("--radix-popper-anchor-width",`${bt}px`),zt.setProperty("--radix-popper-anchor-height",`${rn}px`)}}),P&&L_({element:P,padding:l}),Z2({arrowWidth:H,arrowHeight:K}),w&&D_({strategy:"referenceHidden",...he})]}),[X,$]=W_(Y),te=gn(x);tn(()=>{oe&&(te==null||te())},[oe,te]);const _e=(z=Q.arrow)==null?void 0:z.x,ke=(ce=Q.arrow)==null?void 0:ce.y,xe=((Ae=Q.arrow)==null?void 0:Ae.centerOffset)!==0,[Pe,Te]=C.useState();return tn(()=>{E&&Te(window.getComputedStyle(E).zIndex)},[E]),d.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:oe?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Pe,"--radix-popper-transform-origin":[(Ce=Q.transformOrigin)==null?void 0:Ce.x,(Ne=Q.transformOrigin)==null?void 0:Ne.y].join(" "),...((ne=Q.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(Y2,{scope:n,placedSide:X,onArrowChange:_,arrowX:_e,arrowY:ke,shouldHideArrow:xe,children:d.jsx(mt.div,{"data-side":X,"data-align":$,...v,ref:N,style:{...v.style,animation:oe?void 0:"none"}})})})});K_.displayName=qg;var G_="PopperArrow",Q2={top:"bottom",right:"left",bottom:"top",left:"right"},j_=C.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,a=J2(G_,r),s=Q2[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(W2,{...o,ref:n,style:{...o.style,display:"block"}})})});j_.displayName=G_;function X2(t){return t!==null}var Z2=t=>({name:"transformOrigin",options:t,fn(e){var b,E,T;const{placement:n,rects:r,middlewareData:o}=e,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,l=s?0:t.arrowWidth,u=s?0:t.arrowHeight,[h,p]=W_(n),g={start:"0%",center:"50%",end:"100%"}[p],w=(((E=o.arrow)==null?void 0:E.x)??0)+l/2,y=(((T=o.arrow)==null?void 0:T.y)??0)+u/2;let x="",v="";return h==="bottom"?(x=s?g:`${w}px`,v=`${-u}px`):h==="top"?(x=s?g:`${w}px`,v=`${r.floating.height+u}px`):h==="right"?(x=`${-u}px`,v=s?g:`${y}px`):h==="left"&&(x=`${r.floating.width+u}px`,v=s?g:`${y}px`),{data:{x,y:v}}}});function W_(t){const[e,n="center"]=t.split("-");return[e,n]}var e$=B_,t$=V_,n$=K_,r$=j_,o$=Symbol("radix.slottable");function i$(t){const e=({children:n})=>d.jsx(d.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=o$,e}var a$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),s$="VisuallyHidden",q_=C.forwardRef((t,e)=>d.jsx(mt.span,{...t,ref:e,style:{...a$,...t.style}}));q_.displayName=s$;var c$=q_,[vu,Bj]=yr("Tooltip",[H_]),yu=H_(),Y_="TooltipProvider",l$=700,Yg="tooltip.open",[d$,Jg]=vu(Y_),J_=t=>{const{__scopeTooltip:e,delayDuration:n=l$,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=t,s=C.useRef(!0),l=C.useRef(!1),u=C.useRef(0);return C.useEffect(()=>{const h=u.current;return()=>window.clearTimeout(h)},[]),d.jsx(d$,{scope:e,isOpenDelayedRef:s,delayDuration:n,onOpen:C.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:C.useCallback(h=>{l.current=h},[]),disableHoverableContent:o,children:a})};J_.displayName=Y_;var Cc="Tooltip",[u$,bc]=vu(Cc),Q_=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=t,u=Jg(Cc,t.__scopeTooltip),h=yu(e),[p,g]=C.useState(null),w=Mo(),y=C.useRef(0),x=s??u.disableHoverableContent,v=l??u.delayDuration,b=C.useRef(!1),[E,T]=ui({prop:r,defaultProp:o??!1,onChange:H=>{H?(u.onOpen(),document.dispatchEvent(new CustomEvent(Yg))):u.onClose(),a==null||a(H)},caller:Cc}),N=C.useMemo(()=>E?b.current?"delayed-open":"instant-open":"closed",[E]),P=C.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,T(!0)},[T]),_=C.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),D=C.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,T(!0),y.current=0},v)},[v,T]);return C.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),d.jsx(e$,{...h,children:d.jsx(u$,{scope:e,contentId:w,open:E,stateAttribute:N,trigger:p,onTriggerChange:g,onTriggerEnter:C.useCallback(()=>{u.isOpenDelayedRef.current?D():P()},[u.isOpenDelayedRef,D,P]),onTriggerLeave:C.useCallback(()=>{x?_():(window.clearTimeout(y.current),y.current=0)},[_,x]),onOpen:P,onClose:_,disableHoverableContent:x,children:n})})};Q_.displayName=Cc;var Qg="TooltipTrigger",X_=C.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=bc(Qg,n),a=Jg(Qg,n),s=yu(n),l=C.useRef(null),u=rt(e,l,o.onTriggerChange),h=C.useRef(!1),p=C.useRef(!1),g=C.useCallback(()=>h.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),d.jsx(t$,{asChild:!0,...s,children:d.jsx(mt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Ue(t.onPointerMove,w=>{w.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ue(t.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Ue(t.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ue(t.onFocus,()=>{h.current||o.onOpen()}),onBlur:Ue(t.onBlur,o.onClose),onClick:Ue(t.onClick,o.onClose)})})});X_.displayName=Qg;var Xg="TooltipPortal",[f$,h$]=vu(Xg,{forceMount:void 0}),Z_=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,a=bc(Xg,e);return d.jsx(f$,{scope:e,forceMount:n,children:d.jsx(Ro,{present:n||a.open,children:d.jsx(ud,{asChild:!0,container:o,children:r})})})};Z_.displayName=Xg;var ns="TooltipContent",eE=C.forwardRef((t,e)=>{const n=h$(ns,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=t,s=bc(ns,t.__scopeTooltip);return d.jsx(Ro,{present:r||s.open,children:s.disableHoverableContent?d.jsx(tE,{side:o,...a,ref:e}):d.jsx(p$,{side:o,...a,ref:e})})}),p$=C.forwardRef((t,e)=>{const n=bc(ns,t.__scopeTooltip),r=Jg(ns,t.__scopeTooltip),o=C.useRef(null),a=rt(e,o),[s,l]=C.useState(null),{trigger:u,onClose:h}=n,p=o.current,{onPointerInTransitChange:g}=r,w=C.useCallback(()=>{l(null),g(!1)},[g]),y=C.useCallback((x,v)=>{const b=x.currentTarget,E={x:x.clientX,y:x.clientY},T=w$(E,b.getBoundingClientRect()),N=C$(E,T),P=b$(v.getBoundingClientRect()),_=S$([...N,...P]);l(_),g(!0)},[g]);return C.useEffect(()=>()=>w(),[w]),C.useEffect(()=>{if(u&&p){const x=b=>y(b,p),v=b=>y(b,u);return u.addEventListener("pointerleave",x),p.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",x),p.removeEventListener("pointerleave",v)}}},[u,p,y,w]),C.useEffect(()=>{if(s){const x=v=>{const b=v.target,E={x:v.clientX,y:v.clientY},T=(u==null?void 0:u.contains(b))||(p==null?void 0:p.contains(b)),N=!x$(E,s);T?w():N&&(w(),h())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,p,s,h,w]),d.jsx(tE,{...t,ref:a})}),[g$,m$]=vu(Cc,{isInside:!1}),v$=i$("TooltipContent"),tE=C.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=t,u=bc(ns,n),h=yu(n),{onClose:p}=u;return C.useEffect(()=>(document.addEventListener(Yg,p),()=>document.removeEventListener(Yg,p)),[p]),C.useEffect(()=>{if(u.trigger){const g=w=>{const y=w.target;y!=null&&y.contains(u.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,p]),d.jsx(dd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:d.jsxs(n$,{"data-state":u.stateAttribute,...h,...l,ref:e,style:{...l.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:[d.jsx(v$,{children:r}),d.jsx(g$,{scope:n,isInside:!0,children:d.jsx(c$,{id:u.contentId,role:"tooltip",children:o||r})})]})})});eE.displayName=ns;var nE="TooltipArrow",y$=C.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=yu(n);return m$(nE,n).isInside?null:d.jsx(r$,{...o,...r,ref:e})});y$.displayName=nE;function w$(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function C$(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function b$(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function x$(t,e){const{x:n,y:r}=t;let o=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const l=e[a],u=e[s],h=l.x,p=l.y,g=u.x,w=u.y;p>r!=w>r&&n<(g-h)*(r-p)/(w-p)+h&&(o=!o)}return o}function S$(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),_$(e)}function _$(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var E$=J_,T$=Q_,A$=X_,I$=Z_,rE=eE;const qn=E$,Yn=T$,Jn=A$,On=C.forwardRef(({className:t,sideOffset:e=4,...n},r)=>d.jsx(I$,{children:d.jsx(rE,{ref:r,sideOffset:e,className:ze("z-[100001] 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",t),...n})}));On.displayName=rE.displayName;function k$({title:t,titleId:e,...n},r){return C.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":e},n),t?C.createElement("title",{id:e},t):null,C.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 N$=C.forwardRef(k$);var P$=function(t){return function(e,n){var r=M.useRef(!1);t(function(){return function(){r.current=!1}},[]),t(function(){if(!r.current)r.current=!0;else return e()},n)}},oE=function(t){return typeof t=="function"},iE=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const O$=P$(M.useEffect);function aE(t){var e=M.useRef(t);return e.current=t,e}var M$=function(t){iE&&(oE(t)||console.error("useUnmount expected parameter is a function, got ".concat(typeof t)));var e=aE(t);M.useEffect(function(){return function(){e.current()}},[])};function R$(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var sE=R$,D$=typeof fo=="object"&&fo&&fo.Object===Object&&fo,L$=D$,F$=L$,$$=typeof self=="object"&&self&&self.Object===Object&&self,H$=F$||$$||Function("return this")(),cE=H$,U$=cE,B$=function(){return U$.Date.now()},z$=B$,V$=/\s/;function K$(t){for(var e=t.length;e--&&V$.test(t.charAt(e)););return e}var G$=K$,j$=G$,W$=/^\s+/;function q$(t){return t&&t.slice(0,j$(t)+1).replace(W$,"")}var Y$=q$,J$=cE,Q$=J$.Symbol,lE=Q$,dE=lE,uE=Object.prototype,X$=uE.hasOwnProperty,Z$=uE.toString,xc=dE?dE.toStringTag:void 0;function eH(t){var e=X$.call(t,xc),n=t[xc];try{t[xc]=void 0;var r=!0}catch{}var o=Z$.call(t);return r&&(e?t[xc]=n:delete t[xc]),o}var tH=eH,nH=Object.prototype,rH=nH.toString;function oH(t){return rH.call(t)}var iH=oH,fE=lE,aH=tH,sH=iH,cH="[object Null]",lH="[object Undefined]",hE=fE?fE.toStringTag:void 0;function dH(t){return t==null?t===void 0?lH:cH:hE&&hE in Object(t)?aH(t):sH(t)}var uH=dH;function fH(t){return t!=null&&typeof t=="object"}var hH=fH,pH=uH,gH=hH,mH="[object Symbol]";function vH(t){return typeof t=="symbol"||gH(t)&&pH(t)==mH}var yH=vH,wH=Y$,pE=sE,CH=yH,gE=NaN,bH=/^[-+]0x[0-9a-f]+$/i,xH=/^0b[01]+$/i,SH=/^0o[0-7]+$/i,_H=parseInt;function EH(t){if(typeof t=="number")return t;if(CH(t))return gE;if(pE(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=pE(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=wH(t);var n=xH.test(t);return n||SH.test(t)?_H(t.slice(2),n?2:8):bH.test(t)?gE:+t}var TH=EH,AH=sE,Zg=z$,mE=TH,IH="Expected a function",kH=Math.max,NH=Math.min;function PH(t,e,n){var r,o,a,s,l,u,h=0,p=!1,g=!1,w=!0;if(typeof t!="function")throw new TypeError(IH);e=mE(e)||0,AH(n)&&(p=!!n.leading,g="maxWait"in n,a=g?kH(mE(n.maxWait)||0,e):a,w="trailing"in n?!!n.trailing:w);function y(D){var H=r,K=o;return r=o=void 0,h=D,s=t.apply(K,H),s}function x(D){return h=D,l=setTimeout(E,e),p?y(D):s}function v(D){var H=D-u,K=D-h,ee=e-H;return g?NH(ee,a-K):ee}function b(D){var H=D-u,K=D-h;return u===void 0||H>=e||H<0||g&&K>=a}function E(){var D=Zg();if(b(D))return T(D);l=setTimeout(E,v(D))}function T(D){return l=void 0,w&&r?y(D):(r=o=void 0,s)}function N(){l!==void 0&&clearTimeout(l),h=0,r=u=o=l=void 0}function P(){return l===void 0?s:T(Zg())}function _(){var D=Zg(),H=b(D);if(r=arguments,o=this,u=D,H){if(l===void 0)return x(u);if(g)return clearTimeout(l),l=setTimeout(E,e),y(u)}return l===void 0&&(l=setTimeout(E,e)),s}return _.cancel=N,_.flush=P,_}var OH=PH;const MH=Hd(OH);function RH(){var t=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,e=typeof self=="object"&&self&&self.Object===Object&&self;return t||e}RH()||(global.Date=Date);function DH(t,e){var n;iE&&(oE(t)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof t)));var r=aE(t),o=(n=e==null?void 0:e.wait)!==null&&n!==void 0?n:1e3,a=M.useMemo(function(){return MH(function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return r.current.apply(r,tb([],eb(s),!1))},o,e)},[]);return M$(function(){a.cancel()}),{run:a,cancel:a.cancel,flush:a.flush}}function LH(t,e,n){var r=eb(M.useState({}),2),o=r[0],a=r[1],s=DH(function(){a({})},n).run;M.useEffect(function(){return s()},e),O$(t,[o])}const FH=M.forwardRef(({onChange:t},e)=>{const n=M.useRef(null),[r,o]=M.useState("");return M.useImperativeHandle(e,()=>({setValue:a=>{var s;o(a),(s=n.current)==null||s.focus()}})),LH(()=>{t==null||t(r)},[r],{wait:300}),d.jsxs(d.Fragment,{children:[d.jsx(jn,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:a=>o(a.target.value),className:"pr-8"}),r&&d.jsx("button",{onClick:()=>{var a;o(""),(a=n.current)==null||a.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:d.jsx(N$,{className:"h-5 w-5"})})]})});var zr=(t=>(t.VIEW_DOCUMENT="VIEW_DOCUMENT",t.DOWNLOAD_DOCUMENT="DOWNLOAD_DOCUMENT",t.EDIT_DOCUMENT="EDIT_DOCUMENT",t.OWNER_DOCUMENT="OWNER_DOCUMENT",t))(zr||{});const $H=(t,e)=>{const[n,r]=M.useState([]),[o,a]=M.useState([]),[s,l]=M.useState([]),[u,h]=M.useState([]),{toast:p}=mc(),[g,w]=M.useState(!1),[y,x]=M.useState(!1),v=M.useCallback(async(P,_,D)=>{if(!y){x(!0);try{const H=await Le.post(t+"/document-permission/grandted",{path:P,grandtedBy:_,data:D});return H.status===200&&(p({title:"Phân quyền tài liệu thành công."}),await N(P)),H}catch{return null}finally{x(!1)}}},[]),b=M.useCallback(async()=>{var P;try{return(P=(await Le.get(e+"admin/users/get-all",{params:{limit:1e4}})).data||[])==null?void 0:P.filter(K=>K.role!=="MASTER_ADMIN")}catch(_){return console.error("Error fetchAllUsers",_),[]}},[]),E=M.useCallback(async()=>{try{return(await Le.get(e+"admin/group-users")).data.filter(_=>`${_.groupname}`.toUpperCase()!=="MASTER_ADMIN").map(_=>{var D;return{..._,users:((D=_.users)==null?void 0:D.length)||0}})}catch(P){return console.error("Error fetchAllGroups",P),[]}},[]),T=M.useCallback(async P=>{try{const D=(await Le.get(t+"/document-permission/grandted",{params:{path:P}})).data;return{usersShared:(D==null?void 0:D.users)||[],groupsShared:(D==null?void 0:D.groups)||[]}}catch(_){return console.error("Error fetchShared",_),{usersShared:[],groupsShared:[]}}},[]),N=M.useCallback(async P=>{if(g)return;w(!0);let[_,D,{usersShared:H,groupsShared:K}]=await Promise.all([b(),E(),T(P)]);_=_==null?void 0:_.filter(ee=>!(H!=null&&H.find(W=>W.userId===ee.id))),D=D==null?void 0:D.filter(ee=>!(K!=null&&K.find(W=>W.groupname===ee.groupname))),Array.isArray(_)&&r(_),Array.isArray(D)&&a(D),Array.isArray(H)&&l(H),Array.isArray(K)&&h(K),w(!1)},[]);return{users:n,groups:o,sharedUsers:s,sharedGroups:u,setUsers:r,setGroups:a,setSharedUsers:l,setSharedGroups:h,fetchData:N,loading:g,postGranted:v,loadingGrandted:y}},HH=({failureReasons:t,onNavigateToFile:e})=>{const n=u=>{if(e){const h=u.replace("s3://cts-llm-docs-bucket/","");e(h)}},r=u=>{const h=[];return u.forEach(p=>{try{JSON.parse(p).forEach(w=>{const y=w.match(/\[Files: ([^\]]+)\]/),x=w.match(/^([^[]+)/);if(y&&x&&y[1]&&x[1]){const v=y[1].split(", ").map(T=>T.trim()),b=x[1].trim().replace("Encountered error: ","");let E="unknown";b.includes("invalid metadata attributes")||b.includes("metadata quota")?E="metadata":b.includes("No metadata was provided")||b.includes("metadata file")?E="missing_metadata":b.includes("file size")||b.includes("exceeds")||b.includes("50 MB")?E="file_size":b.includes("format not supported")||b.includes("unsupported format")||b.includes("file type")?E="file_format":b.includes("embedding failed")||b.includes("EMBEDDING_FAILED")?E="embedding_failed":b.includes("indexing failed")||b.includes("INDEXING_FAILED")?E="indexing_failed":b.includes("access denied")||b.includes("AccessDeniedException")||b.includes("permission")?E="access_denied":(b.includes("quota")||b.includes("limit")||b.includes("ServiceQuotaExceededException"))&&(E="quota_exceeded"),h.push({errorMessage:b,files:v,errorType:E})}})}catch{h.push({errorMessage:p,files:[],errorType:"unknown"})}}),h},o=u=>{switch(u){case"metadata":return d.jsx(gi,{className:"h-4 w-4 text-orange-500"});case"missing_metadata":return d.jsx(cg,{className:"h-4 w-4 text-red-500"});case"file_size":return d.jsx(gi,{className:"h-4 w-4 text-yellow-500"});case"file_format":return d.jsx(cg,{className:"h-4 w-4 text-purple-500"});case"embedding_failed":return d.jsx(gi,{className:"h-4 w-4 text-red-600"});case"indexing_failed":return d.jsx(gi,{className:"h-4 w-4 text-red-600"});case"access_denied":return d.jsx(gi,{className:"h-4 w-4 text-red-700"});case"quota_exceeded":return d.jsx(gi,{className:"h-4 w-4 text-orange-600"});default:return d.jsx(gi,{className:"h-4 w-4 text-red-500"})}},a=u=>{switch(u){case"metadata":return"border-orange-200 bg-orange-50";case"missing_metadata":return"border-red-200 bg-red-50";case"file_size":return"border-yellow-200 bg-yellow-50";case"file_format":return"border-purple-200 bg-purple-50";case"embedding_failed":return"border-red-300 bg-red-100";case"indexing_failed":return"border-red-300 bg-red-100";case"access_denied":return"border-red-400 bg-red-100";case"quota_exceeded":return"border-orange-300 bg-orange-100";default:return"border-red-200 bg-red-50"}},s=u=>{switch(u){case"metadata":return"text-orange-800";case"missing_metadata":return"text-red-800";case"file_size":return"text-yellow-800";case"file_format":return"text-purple-800";case"embedding_failed":return"text-red-900";case"indexing_failed":return"text-red-900";case"access_denied":return"text-red-900";case"quota_exceeded":return"text-orange-900";default:return"text-red-800"}},l=r(t);return l.length===0?null:d.jsxs("div",{className:"border-t pt-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(gi,{className:"h-4 w-4 text-red-500"}),d.jsxs("p",{className:"text-red-600 font-medium",children:["Các file lỗi (",l.reduce((u,h)=>u+h.files.length,0)," file)"]})]}),d.jsx("div",{className:"space-y-3 max-h-80 overflow-y-auto",children:l.map((u,h)=>d.jsxs("div",{className:`p-3 rounded-lg border ${a(u.errorType)}`,children:[d.jsx("div",{className:"flex items-start justify-between",children:d.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[o(u.errorType),d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:`font-medium text-sm ${s(u.errorType)}`,children:u.errorMessage}),u.files.length>0&&d.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:[u.files.length," file bị ảnh hưởng"]})]})]})}),u.files.length>0&&d.jsxs("div",{className:"mt-3 pt-2 border-t border-gray-200",children:[d.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2",children:"Danh sách file lỗi:"}),d.jsx("div",{className:"max-h-32 overflow-y-auto space-y-1",children:u.files.map((p,g)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs p-2 bg-white/50 rounded hover:bg-white/80 transition-colors",children:[d.jsx(cg,{className:"h-3 w-3 text-red-400 flex-shrink-0"}),e?d.jsxs("button",{onClick:()=>n(p),className:"text-blue-600 hover:text-blue-800 underline break-all font-mono text-left flex-1 flex items-center gap-1",title:"Nhấp để điều hướng đến file",children:[d.jsx("span",{children:p.replace("s3://cts-llm-docs-bucket/","")}),d.jsx(VD,{className:"h-3 w-3 flex-shrink-0"})]}):d.jsx("span",{className:"text-gray-700 break-all font-mono",children:p.replace("s3://cts-llm-docs-bucket/","")})]},g))})]})]},h))})]})};var em={exports:{}},wu={exports:{}},yt={};/** @license React v16.13.1
205
205
  * react-is.production.min.js
206
206
  *
207
207
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -215,16 +215,16 @@ function print() { __p += __j.call(arguments, '') }
215
215
  *
216
216
  * This source code is licensed under the MIT license found in the
217
217
  * LICENSE file in the root directory of this source tree.
218
- */var yE;function BH(){return yE||(yE=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,h=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,g=t?Symbol.for("react.suspense"):60113,w=t?Symbol.for("react.suspense_list"):60120,y=t?Symbol.for("react.memo"):60115,x=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,b=t?Symbol.for("react.fundamental"):60117,E=t?Symbol.for("react.responder"):60118,T=t?Symbol.for("react.scope"):60119;function N(ne){return typeof ne=="string"||typeof ne=="function"||ne===r||ne===h||ne===a||ne===o||ne===g||ne===w||typeof ne=="object"&&ne!==null&&(ne.$$typeof===x||ne.$$typeof===y||ne.$$typeof===s||ne.$$typeof===l||ne.$$typeof===p||ne.$$typeof===b||ne.$$typeof===E||ne.$$typeof===T||ne.$$typeof===v)}function P(ne){if(typeof ne=="object"&&ne!==null){var Ve=ne.$$typeof;switch(Ve){case e:var Qe=ne.type;switch(Qe){case u:case h:case r:case a:case o:case g:return Qe;default:var Ct=Qe&&Qe.$$typeof;switch(Ct){case l:case p:case x:case y:case s:return Ct;default:return Ve}}case n:return Ve}}}var _=u,D=h,H=l,K=s,ee=e,W=p,de=r,se=x,fe=y,q=n,Z=a,Y=o,oe=g,Q=!1;function X(ne){return Q||(Q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(ne)||P(ne)===u}function $(ne){return P(ne)===h}function te(ne){return P(ne)===l}function _e(ne){return P(ne)===s}function ke(ne){return typeof ne=="object"&&ne!==null&&ne.$$typeof===e}function xe(ne){return P(ne)===p}function Pe(ne){return P(ne)===r}function Te(ne){return P(ne)===x}function z(ne){return P(ne)===y}function ce(ne){return P(ne)===n}function Ae(ne){return P(ne)===a}function Ce(ne){return P(ne)===o}function Ne(ne){return P(ne)===g}wt.AsyncMode=_,wt.ConcurrentMode=D,wt.ContextConsumer=H,wt.ContextProvider=K,wt.Element=ee,wt.ForwardRef=W,wt.Fragment=de,wt.Lazy=se,wt.Memo=fe,wt.Portal=q,wt.Profiler=Z,wt.StrictMode=Y,wt.Suspense=oe,wt.isAsyncMode=X,wt.isConcurrentMode=$,wt.isContextConsumer=te,wt.isContextProvider=_e,wt.isElement=ke,wt.isForwardRef=xe,wt.isFragment=Pe,wt.isLazy=Te,wt.isMemo=z,wt.isPortal=ce,wt.isProfiler=Ae,wt.isStrictMode=Ce,wt.isSuspense=Ne,wt.isValidElementType=N,wt.typeOf=P}()),wt}var wE;function CE(){return wE||(wE=1,process.env.NODE_ENV==="production"?wu.exports=UH():wu.exports=BH()),wu.exports}/*
218
+ */var yE;function BH(){return yE||(yE=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,h=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,g=t?Symbol.for("react.suspense"):60113,w=t?Symbol.for("react.suspense_list"):60120,y=t?Symbol.for("react.memo"):60115,x=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,b=t?Symbol.for("react.fundamental"):60117,E=t?Symbol.for("react.responder"):60118,T=t?Symbol.for("react.scope"):60119;function N(ne){return typeof ne=="string"||typeof ne=="function"||ne===r||ne===h||ne===a||ne===o||ne===g||ne===w||typeof ne=="object"&&ne!==null&&(ne.$$typeof===x||ne.$$typeof===y||ne.$$typeof===s||ne.$$typeof===l||ne.$$typeof===p||ne.$$typeof===b||ne.$$typeof===E||ne.$$typeof===T||ne.$$typeof===v)}function P(ne){if(typeof ne=="object"&&ne!==null){var Ve=ne.$$typeof;switch(Ve){case e:var Xe=ne.type;switch(Xe){case u:case h:case r:case a:case o:case g:return Xe;default:var Ct=Xe&&Xe.$$typeof;switch(Ct){case l:case p:case x:case y:case s:return Ct;default:return Ve}}case n:return Ve}}}var _=u,D=h,H=l,K=s,ee=e,W=p,de=r,se=x,he=y,q=n,Z=a,Y=o,oe=g,Q=!1;function X(ne){return Q||(Q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(ne)||P(ne)===u}function $(ne){return P(ne)===h}function te(ne){return P(ne)===l}function _e(ne){return P(ne)===s}function ke(ne){return typeof ne=="object"&&ne!==null&&ne.$$typeof===e}function xe(ne){return P(ne)===p}function Pe(ne){return P(ne)===r}function Te(ne){return P(ne)===x}function z(ne){return P(ne)===y}function ce(ne){return P(ne)===n}function Ae(ne){return P(ne)===a}function Ce(ne){return P(ne)===o}function Ne(ne){return P(ne)===g}wt.AsyncMode=_,wt.ConcurrentMode=D,wt.ContextConsumer=H,wt.ContextProvider=K,wt.Element=ee,wt.ForwardRef=W,wt.Fragment=de,wt.Lazy=se,wt.Memo=he,wt.Portal=q,wt.Profiler=Z,wt.StrictMode=Y,wt.Suspense=oe,wt.isAsyncMode=X,wt.isConcurrentMode=$,wt.isContextConsumer=te,wt.isContextProvider=_e,wt.isElement=ke,wt.isForwardRef=xe,wt.isFragment=Pe,wt.isLazy=Te,wt.isMemo=z,wt.isPortal=ce,wt.isProfiler=Ae,wt.isStrictMode=Ce,wt.isSuspense=Ne,wt.isValidElementType=N,wt.typeOf=P}()),wt}var wE;function CE(){return wE||(wE=1,process.env.NODE_ENV==="production"?wu.exports=UH():wu.exports=BH()),wu.exports}/*
219
219
  object-assign
220
220
  (c) Sindre Sorhus
221
221
  @license MIT
222
- */var tm,bE;function zH(){if(bE)return tm;bE=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function o(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var u=Object.getOwnPropertyNames(s).map(function(p){return s[p]});if(u.join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(p){h[p]=p}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return tm=o()?Object.assign:function(a,s){for(var l,u=r(a),h,p=1;p<arguments.length;p++){l=Object(arguments[p]);for(var g in l)e.call(l,g)&&(u[g]=l[g]);if(t){h=t(l);for(var w=0;w<h.length;w++)n.call(l,h[w])&&(u[h[w]]=l[h[w]])}}return u},tm}var nm,xE;function rm(){if(xE)return nm;xE=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return nm=t,nm}var om,SE;function _E(){return SE||(SE=1,om=Function.call.bind(Object.prototype.hasOwnProperty)),om}var im,EE;function VH(){if(EE)return im;EE=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=rm(),n={},r=_E();t=function(a){var s="Warning: "+a;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(a,s,l,u,h){if(process.env.NODE_ENV!=="production"){for(var p in a)if(r(a,p)){var g;try{if(typeof a[p]!="function"){var w=Error((u||"React class")+": "+l+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}g=a[p](s,p,u,l,null,e)}catch(x){g=x}if(g&&!(g instanceof Error)&&t((u||"React class")+": type specification of "+l+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in n)){n[g.message]=!0;var y=h?h():"";t("Failed "+l+" type: "+g.message+(y??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},im=o,im}var am,TE;function KH(){if(TE)return am;TE=1;var t=CE(),e=zH(),n=rm(),r=_E(),o=VH(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function s(){return null}return am=function(l,u){var h=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function g($){var te=$&&(h&&$[h]||$[p]);if(typeof te=="function")return te}var w="<<anonymous>>",y={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:T(),arrayOf:N,element:P(),elementType:_(),instanceOf:D,node:W(),objectOf:K,oneOf:H,oneOfType:ee,shape:se,exact:fe};function x($,te){return $===te?$!==0||1/$===1/te:$!==$&&te!==te}function v($,te){this.message=$,this.data=te&&typeof te=="object"?te:{},this.stack=""}v.prototype=Error.prototype;function b($){if(process.env.NODE_ENV!=="production")var te={},_e=0;function ke(Pe,Te,z,ce,Ae,Ce,Ne){if(ce=ce||w,Ce=Ce||z,Ne!==n){if(u){var ne=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw ne.name="Invariant Violation",ne}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ve=ce+":"+z;!te[Ve]&&_e<3&&(a("You are manually calling a React.PropTypes validation function for the `"+Ce+"` prop on `"+ce+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),te[Ve]=!0,_e++)}}return Te[z]==null?Pe?Te[z]===null?new v("The "+Ae+" `"+Ce+"` is marked as required "+("in `"+ce+"`, but its value is `null`.")):new v("The "+Ae+" `"+Ce+"` is marked as required in "+("`"+ce+"`, but its value is `undefined`.")):null:$(Te,z,ce,Ae,Ce)}var xe=ke.bind(null,!1);return xe.isRequired=ke.bind(null,!0),xe}function E($){function te(_e,ke,xe,Pe,Te,z){var ce=_e[ke],Ae=Y(ce);if(Ae!==$){var Ce=oe(ce);return new v("Invalid "+Pe+" `"+Te+"` of type "+("`"+Ce+"` supplied to `"+xe+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return b(te)}function T(){return b(s)}function N($){function te(_e,ke,xe,Pe,Te){if(typeof $!="function")return new v("Property `"+Te+"` of component `"+xe+"` has invalid PropType notation inside arrayOf.");var z=_e[ke];if(!Array.isArray(z)){var ce=Y(z);return new v("Invalid "+Pe+" `"+Te+"` of type "+("`"+ce+"` supplied to `"+xe+"`, expected an array."))}for(var Ae=0;Ae<z.length;Ae++){var Ce=$(z,Ae,xe,Pe,Te+"["+Ae+"]",n);if(Ce instanceof Error)return Ce}return null}return b(te)}function P(){function $(te,_e,ke,xe,Pe){var Te=te[_e];if(!l(Te)){var z=Y(Te);return new v("Invalid "+xe+" `"+Pe+"` of type "+("`"+z+"` supplied to `"+ke+"`, expected a single ReactElement."))}return null}return b($)}function _(){function $(te,_e,ke,xe,Pe){var Te=te[_e];if(!t.isValidElementType(Te)){var z=Y(Te);return new v("Invalid "+xe+" `"+Pe+"` of type "+("`"+z+"` supplied to `"+ke+"`, expected a single ReactElement type."))}return null}return b($)}function D($){function te(_e,ke,xe,Pe,Te){if(!(_e[ke]instanceof $)){var z=$.name||w,ce=X(_e[ke]);return new v("Invalid "+Pe+" `"+Te+"` of type "+("`"+ce+"` supplied to `"+xe+"`, expected ")+("instance of `"+z+"`."))}return null}return b(te)}function H($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),s;function te(_e,ke,xe,Pe,Te){for(var z=_e[ke],ce=0;ce<$.length;ce++)if(x(z,$[ce]))return null;var Ae=JSON.stringify($,function(Ne,ne){var Ve=oe(ne);return Ve==="symbol"?String(ne):ne});return new v("Invalid "+Pe+" `"+Te+"` of value `"+String(z)+"` "+("supplied to `"+xe+"`, expected one of "+Ae+"."))}return b(te)}function K($){function te(_e,ke,xe,Pe,Te){if(typeof $!="function")return new v("Property `"+Te+"` of component `"+xe+"` has invalid PropType notation inside objectOf.");var z=_e[ke],ce=Y(z);if(ce!=="object")return new v("Invalid "+Pe+" `"+Te+"` of type "+("`"+ce+"` supplied to `"+xe+"`, expected an object."));for(var Ae in z)if(r(z,Ae)){var Ce=$(z,Ae,xe,Pe,Te+"."+Ae,n);if(Ce instanceof Error)return Ce}return null}return b(te)}function ee($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var te=0;te<$.length;te++){var _e=$[te];if(typeof _e!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Q(_e)+" at index "+te+"."),s}function ke(xe,Pe,Te,z,ce){for(var Ae=[],Ce=0;Ce<$.length;Ce++){var Ne=$[Ce],ne=Ne(xe,Pe,Te,z,ce,n);if(ne==null)return null;ne.data&&r(ne.data,"expectedType")&&Ae.push(ne.data.expectedType)}var Ve=Ae.length>0?", expected one of type ["+Ae.join(", ")+"]":"";return new v("Invalid "+z+" `"+ce+"` supplied to "+("`"+Te+"`"+Ve+"."))}return b(ke)}function W(){function $(te,_e,ke,xe,Pe){return q(te[_e])?null:new v("Invalid "+xe+" `"+Pe+"` supplied to "+("`"+ke+"`, expected a ReactNode."))}return b($)}function de($,te,_e,ke,xe){return new v(($||"React class")+": "+te+" type `"+_e+"."+ke+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+xe+"`.")}function se($){function te(_e,ke,xe,Pe,Te){var z=_e[ke],ce=Y(z);if(ce!=="object")return new v("Invalid "+Pe+" `"+Te+"` of type `"+ce+"` "+("supplied to `"+xe+"`, expected `object`."));for(var Ae in $){var Ce=$[Ae];if(typeof Ce!="function")return de(xe,Pe,Te,Ae,oe(Ce));var Ne=Ce(z,Ae,xe,Pe,Te+"."+Ae,n);if(Ne)return Ne}return null}return b(te)}function fe($){function te(_e,ke,xe,Pe,Te){var z=_e[ke],ce=Y(z);if(ce!=="object")return new v("Invalid "+Pe+" `"+Te+"` of type `"+ce+"` "+("supplied to `"+xe+"`, expected `object`."));var Ae=e({},_e[ke],$);for(var Ce in Ae){var Ne=$[Ce];if(r($,Ce)&&typeof Ne!="function")return de(xe,Pe,Te,Ce,oe(Ne));if(!Ne)return new v("Invalid "+Pe+" `"+Te+"` key `"+Ce+"` supplied to `"+xe+"`.\nBad object: "+JSON.stringify(_e[ke],null," ")+`
222
+ */var tm,bE;function zH(){if(bE)return tm;bE=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function o(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var u=Object.getOwnPropertyNames(s).map(function(p){return s[p]});if(u.join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(p){h[p]=p}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return tm=o()?Object.assign:function(a,s){for(var l,u=r(a),h,p=1;p<arguments.length;p++){l=Object(arguments[p]);for(var g in l)e.call(l,g)&&(u[g]=l[g]);if(t){h=t(l);for(var w=0;w<h.length;w++)n.call(l,h[w])&&(u[h[w]]=l[h[w]])}}return u},tm}var nm,xE;function rm(){if(xE)return nm;xE=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return nm=t,nm}var om,SE;function _E(){return SE||(SE=1,om=Function.call.bind(Object.prototype.hasOwnProperty)),om}var im,EE;function VH(){if(EE)return im;EE=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=rm(),n={},r=_E();t=function(a){var s="Warning: "+a;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(a,s,l,u,h){if(process.env.NODE_ENV!=="production"){for(var p in a)if(r(a,p)){var g;try{if(typeof a[p]!="function"){var w=Error((u||"React class")+": "+l+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}g=a[p](s,p,u,l,null,e)}catch(x){g=x}if(g&&!(g instanceof Error)&&t((u||"React class")+": type specification of "+l+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in n)){n[g.message]=!0;var y=h?h():"";t("Failed "+l+" type: "+g.message+(y??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},im=o,im}var am,TE;function KH(){if(TE)return am;TE=1;var t=CE(),e=zH(),n=rm(),r=_E(),o=VH(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function s(){return null}return am=function(l,u){var h=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function g($){var te=$&&(h&&$[h]||$[p]);if(typeof te=="function")return te}var w="<<anonymous>>",y={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:T(),arrayOf:N,element:P(),elementType:_(),instanceOf:D,node:W(),objectOf:K,oneOf:H,oneOfType:ee,shape:se,exact:he};function x($,te){return $===te?$!==0||1/$===1/te:$!==$&&te!==te}function v($,te){this.message=$,this.data=te&&typeof te=="object"?te:{},this.stack=""}v.prototype=Error.prototype;function b($){if(process.env.NODE_ENV!=="production")var te={},_e=0;function ke(Pe,Te,z,ce,Ae,Ce,Ne){if(ce=ce||w,Ce=Ce||z,Ne!==n){if(u){var ne=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw ne.name="Invariant Violation",ne}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ve=ce+":"+z;!te[Ve]&&_e<3&&(a("You are manually calling a React.PropTypes validation function for the `"+Ce+"` prop on `"+ce+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),te[Ve]=!0,_e++)}}return Te[z]==null?Pe?Te[z]===null?new v("The "+Ae+" `"+Ce+"` is marked as required "+("in `"+ce+"`, but its value is `null`.")):new v("The "+Ae+" `"+Ce+"` is marked as required in "+("`"+ce+"`, but its value is `undefined`.")):null:$(Te,z,ce,Ae,Ce)}var xe=ke.bind(null,!1);return xe.isRequired=ke.bind(null,!0),xe}function E($){function te(_e,ke,xe,Pe,Te,z){var ce=_e[ke],Ae=Y(ce);if(Ae!==$){var Ce=oe(ce);return new v("Invalid "+Pe+" `"+Te+"` of type "+("`"+Ce+"` supplied to `"+xe+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return b(te)}function T(){return b(s)}function N($){function te(_e,ke,xe,Pe,Te){if(typeof $!="function")return new v("Property `"+Te+"` of component `"+xe+"` has invalid PropType notation inside arrayOf.");var z=_e[ke];if(!Array.isArray(z)){var ce=Y(z);return new v("Invalid "+Pe+" `"+Te+"` of type "+("`"+ce+"` supplied to `"+xe+"`, expected an array."))}for(var Ae=0;Ae<z.length;Ae++){var Ce=$(z,Ae,xe,Pe,Te+"["+Ae+"]",n);if(Ce instanceof Error)return Ce}return null}return b(te)}function P(){function $(te,_e,ke,xe,Pe){var Te=te[_e];if(!l(Te)){var z=Y(Te);return new v("Invalid "+xe+" `"+Pe+"` of type "+("`"+z+"` supplied to `"+ke+"`, expected a single ReactElement."))}return null}return b($)}function _(){function $(te,_e,ke,xe,Pe){var Te=te[_e];if(!t.isValidElementType(Te)){var z=Y(Te);return new v("Invalid "+xe+" `"+Pe+"` of type "+("`"+z+"` supplied to `"+ke+"`, expected a single ReactElement type."))}return null}return b($)}function D($){function te(_e,ke,xe,Pe,Te){if(!(_e[ke]instanceof $)){var z=$.name||w,ce=X(_e[ke]);return new v("Invalid "+Pe+" `"+Te+"` of type "+("`"+ce+"` supplied to `"+xe+"`, expected ")+("instance of `"+z+"`."))}return null}return b(te)}function H($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),s;function te(_e,ke,xe,Pe,Te){for(var z=_e[ke],ce=0;ce<$.length;ce++)if(x(z,$[ce]))return null;var Ae=JSON.stringify($,function(Ne,ne){var Ve=oe(ne);return Ve==="symbol"?String(ne):ne});return new v("Invalid "+Pe+" `"+Te+"` of value `"+String(z)+"` "+("supplied to `"+xe+"`, expected one of "+Ae+"."))}return b(te)}function K($){function te(_e,ke,xe,Pe,Te){if(typeof $!="function")return new v("Property `"+Te+"` of component `"+xe+"` has invalid PropType notation inside objectOf.");var z=_e[ke],ce=Y(z);if(ce!=="object")return new v("Invalid "+Pe+" `"+Te+"` of type "+("`"+ce+"` supplied to `"+xe+"`, expected an object."));for(var Ae in z)if(r(z,Ae)){var Ce=$(z,Ae,xe,Pe,Te+"."+Ae,n);if(Ce instanceof Error)return Ce}return null}return b(te)}function ee($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var te=0;te<$.length;te++){var _e=$[te];if(typeof _e!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Q(_e)+" at index "+te+"."),s}function ke(xe,Pe,Te,z,ce){for(var Ae=[],Ce=0;Ce<$.length;Ce++){var Ne=$[Ce],ne=Ne(xe,Pe,Te,z,ce,n);if(ne==null)return null;ne.data&&r(ne.data,"expectedType")&&Ae.push(ne.data.expectedType)}var Ve=Ae.length>0?", expected one of type ["+Ae.join(", ")+"]":"";return new v("Invalid "+z+" `"+ce+"` supplied to "+("`"+Te+"`"+Ve+"."))}return b(ke)}function W(){function $(te,_e,ke,xe,Pe){return q(te[_e])?null:new v("Invalid "+xe+" `"+Pe+"` supplied to "+("`"+ke+"`, expected a ReactNode."))}return b($)}function de($,te,_e,ke,xe){return new v(($||"React class")+": "+te+" type `"+_e+"."+ke+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+xe+"`.")}function se($){function te(_e,ke,xe,Pe,Te){var z=_e[ke],ce=Y(z);if(ce!=="object")return new v("Invalid "+Pe+" `"+Te+"` of type `"+ce+"` "+("supplied to `"+xe+"`, expected `object`."));for(var Ae in $){var Ce=$[Ae];if(typeof Ce!="function")return de(xe,Pe,Te,Ae,oe(Ce));var Ne=Ce(z,Ae,xe,Pe,Te+"."+Ae,n);if(Ne)return Ne}return null}return b(te)}function he($){function te(_e,ke,xe,Pe,Te){var z=_e[ke],ce=Y(z);if(ce!=="object")return new v("Invalid "+Pe+" `"+Te+"` of type `"+ce+"` "+("supplied to `"+xe+"`, expected `object`."));var Ae=e({},_e[ke],$);for(var Ce in Ae){var Ne=$[Ce];if(r($,Ce)&&typeof Ne!="function")return de(xe,Pe,Te,Ce,oe(Ne));if(!Ne)return new v("Invalid "+Pe+" `"+Te+"` key `"+Ce+"` supplied to `"+xe+"`.\nBad object: "+JSON.stringify(_e[ke],null," ")+`
223
223
  Valid keys: `+JSON.stringify(Object.keys($),null," "));var ne=Ne(z,Ce,xe,Pe,Te+"."+Ce,n);if(ne)return ne}return null}return b(te)}function q($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(q);if($===null||l($))return!0;var te=g($);if(te){var _e=te.call($),ke;if(te!==$.entries){for(;!(ke=_e.next()).done;)if(!q(ke.value))return!1}else for(;!(ke=_e.next()).done;){var xe=ke.value;if(xe&&!q(xe[1]))return!1}}else return!1;return!0;default:return!1}}function Z($,te){return $==="symbol"?!0:te?te["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&te instanceof Symbol:!1}function Y($){var te=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":Z(te,$)?"symbol":te}function oe($){if(typeof $>"u"||$===null)return""+$;var te=Y($);if(te==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return te}function Q($){var te=oe($);switch(te){case"array":case"object":return"an "+te;case"boolean":case"date":case"regexp":return"a "+te;default:return te}}function X($){return!$.constructor||!$.constructor.name?w:$.constructor.name}return y.checkPropTypes=o,y.resetWarningCache=o.resetWarningCache,y.PropTypes=y,y},am}var sm,AE;function GH(){if(AE)return sm;AE=1;var t=rm();function e(){}function n(){}return n.resetWarningCache=e,sm=function(){function r(s,l,u,h,p,g){if(g!==t){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}r.isRequired=r;function o(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return a.PropTypes=a,a},sm}if(process.env.NODE_ENV!=="production"){var jH=CE(),WH=!0;em.exports=KH()(jH.isElement,WH)}else em.exports=GH()();var qH=em.exports;const Nt=Hd(qH),YH=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function rs(t,e,n){const r=JH(t),{webkitRelativePath:o}=t,a=typeof e=="string"?e:typeof o=="string"&&o.length>0?o:`./${t.name}`;return typeof r.path!="string"&&IE(r,"path",a),IE(r,"relativePath",a),r}function JH(t){const{name:e}=t;if(e&&e.lastIndexOf(".")!==-1&&!t.type){const r=e.split(".").pop().toLowerCase(),o=YH.get(r);o&&Object.defineProperty(t,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return t}function IE(t,e,n){Object.defineProperty(t,e,{value:n,writable:!1,configurable:!1,enumerable:!0})}const QH=[".DS_Store","Thumbs.db"];function XH(t){return zi(this,void 0,void 0,function*(){return Cu(t)&&ZH(t.dataTransfer)?rU(t.dataTransfer,t.type):eU(t)?tU(t):Array.isArray(t)&&t.every(e=>"getFile"in e&&typeof e.getFile=="function")?nU(t):[]})}function ZH(t){return Cu(t)}function eU(t){return Cu(t)&&Cu(t.target)}function Cu(t){return typeof t=="object"&&t!==null}function tU(t){return cm(t.target.files).map(e=>rs(e))}function nU(t){return zi(this,void 0,void 0,function*(){return(yield Promise.all(t.map(n=>n.getFile()))).map(n=>rs(n))})}function rU(t,e){return zi(this,void 0,void 0,function*(){if(t.items){const n=cm(t.items).filter(o=>o.kind==="file");if(e!=="drop")return n;const r=yield Promise.all(n.map(oU));return kE(NE(r))}return kE(cm(t.files).map(n=>rs(n)))})}function kE(t){return t.filter(e=>QH.indexOf(e.name)===-1)}function cm(t){if(t===null)return[];const e=[];for(let n=0;n<t.length;n++){const r=t[n];e.push(r)}return e}function oU(t){if(typeof t.webkitGetAsEntry!="function")return PE(t);const e=t.webkitGetAsEntry();return e&&e.isDirectory?OE(e):PE(t,e)}function NE(t){return t.reduce((e,n)=>[...e,...Array.isArray(n)?NE(n):[n]],[])}function PE(t,e){return zi(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof t.getAsFileSystemHandle=="function"){const a=yield t.getAsFileSystemHandle();if(a===null)throw new Error(`${t} is not a File`);if(a!==void 0){const s=yield a.getFile();return s.handle=a,rs(s)}}const r=t.getAsFile();if(!r)throw new Error(`${t} is not a File`);return rs(r,(n=e==null?void 0:e.fullPath)!==null&&n!==void 0?n:void 0)})}function iU(t){return zi(this,void 0,void 0,function*(){return t.isDirectory?OE(t):aU(t)})}function OE(t){const e=t.createReader();return new Promise((n,r)=>{const o=[];function a(){e.readEntries(s=>zi(this,void 0,void 0,function*(){if(s.length){const l=Promise.all(s.map(iU));o.push(l),a()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),s=>{r(s)})}a()})}function aU(t){return zi(this,void 0,void 0,function*(){return new Promise((e,n)=>{t.file(r=>{const o=rs(r,t.fullPath);e(o)},r=>{n(r)})})})}var lm=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(",");if(n.length===0)return!0;var r=t.name||"",o=(t.type||"").toLowerCase(),a=o.replace(/\/.*$/,"");return n.some(function(s){var l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?a===l.replace(/\/.*$/,""):o===l})}return!0};function ME(t){return lU(t)||cU(t)||FE(t)||sU()}function sU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
224
224
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cU(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function lU(t){if(Array.isArray(t))return dm(t)}function RE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function DE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?RE(Object(n),!0).forEach(function(r){LE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):RE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function LE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sc(t,e){return fU(t)||uU(t,e)||FE(t,e)||dU()}function dU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
225
225
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FE(t,e){if(t){if(typeof t=="string")return dm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dm(t,e)}}function dm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function uU(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,a=!1,s,l;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(u){a=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(a)throw l}}return r}}function fU(t){if(Array.isArray(t))return t}var hU=typeof lm=="function"?lm:lm.default,pU="file-invalid-type",gU="file-too-large",mU="file-too-small",vU="too-many-files",yU=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=e.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:pU,message:"File type must be ".concat(r)}},$E=function(e){return{code:gU,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},HE=function(e){return{code:mU,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},wU={code:vU,message:"Too many files"};function UE(t,e){var n=t.type==="application/x-moz-file"||hU(t,e);return[n,n?null:yU(e)]}function BE(t,e,n){if(Qi(t.size))if(Qi(e)&&Qi(n)){if(t.size>n)return[!1,$E(n)];if(t.size<e)return[!1,HE(e)]}else{if(Qi(e)&&t.size<e)return[!1,HE(e)];if(Qi(n)&&t.size>n)return[!1,$E(n)]}return[!0,null]}function Qi(t){return t!=null}function CU(t){var e=t.files,n=t.accept,r=t.minSize,o=t.maxSize,a=t.multiple,s=t.maxFiles,l=t.validator;return!a&&e.length>1||a&&s>=1&&e.length>s?!1:e.every(function(u){var h=UE(u,n),p=Sc(h,1),g=p[0],w=BE(u,r,o),y=Sc(w,1),x=y[0],v=l?l(u):null;return g&&x&&!v})}function bu(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function xu(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function zE(t){t.preventDefault()}function bU(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function xU(t){return t.indexOf("Edge/")!==-1}function SU(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return bU(t)||xU(t)}function yo(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return e.some(function(l){return!bu(r)&&l&&l.apply(void 0,[r].concat(a)),bu(r)})}}function _U(){return"showOpenFilePicker"in window}function EU(t){if(Qi(t)){var e=Object.entries(t).filter(function(n){var r=Sc(n,2),o=r[0],a=r[1],s=!0;return VE(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(a)||!a.every(KE))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var o=Sc(r,2),a=o[0],s=o[1];return DE(DE({},n),{},LE({},a,s))},{});return[{description:"Files",accept:e}]}return t}function TU(t){if(Qi(t))return Object.entries(t).reduce(function(e,n){var r=Sc(n,2),o=r[0],a=r[1];return[].concat(ME(e),[o],ME(a))},[]).filter(function(e){return VE(e)||KE(e)}).join(",")}function AU(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function IU(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function VE(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||t==="application/*"||/\w+\/[-+.\w]+/g.test(t)}function KE(t){return/^.*\.[\w]+$/.test(t)}var kU=["children"],NU=["open"],PU=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],OU=["refKey","onChange","onClick"];function MU(t){return LU(t)||DU(t)||GE(t)||RU()}function RU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
226
226
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DU(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function LU(t){if(Array.isArray(t))return fm(t)}function um(t,e){return HU(t)||$U(t,e)||GE(t,e)||FU()}function FU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
227
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GE(t,e){if(t){if(typeof t=="string")return fm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fm(t,e)}}function fm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $U(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,a=!1,s,l;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(u){a=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(a)throw l}}return r}}function HU(t){if(Array.isArray(t))return t}function jE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Bt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jE(Object(n),!0).forEach(function(r){hm(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function hm(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Su(t,e){if(t==null)return{};var n=UU(t,e),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)r=a[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function UU(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var pm=M.forwardRef(function(t,e){var n=t.children,r=Su(t,kU),o=qE(r),a=o.open,s=Su(o,NU);return M.useImperativeHandle(e,function(){return{open:a}},[a]),M.createElement(M.Fragment,null,n(Bt(Bt({},s),{},{open:a})))});pm.displayName="Dropzone";var WE={disabled:!1,getFilesFromEvent:XH,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};pm.defaultProps=WE,pm.propTypes={children:Nt.func,accept:Nt.objectOf(Nt.arrayOf(Nt.string)),multiple:Nt.bool,preventDropOnDocument:Nt.bool,noClick:Nt.bool,noKeyboard:Nt.bool,noDrag:Nt.bool,noDragEventsBubbling:Nt.bool,minSize:Nt.number,maxSize:Nt.number,maxFiles:Nt.number,disabled:Nt.bool,getFilesFromEvent:Nt.func,onFileDialogCancel:Nt.func,onFileDialogOpen:Nt.func,useFsAccessApi:Nt.bool,autoFocus:Nt.bool,onDragEnter:Nt.func,onDragLeave:Nt.func,onDragOver:Nt.func,onDrop:Nt.func,onDropAccepted:Nt.func,onDropRejected:Nt.func,onError:Nt.func,validator:Nt.func};var gm={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function qE(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Bt(Bt({},WE),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,a=e.maxSize,s=e.minSize,l=e.multiple,u=e.maxFiles,h=e.onDragEnter,p=e.onDragLeave,g=e.onDragOver,w=e.onDrop,y=e.onDropAccepted,x=e.onDropRejected,v=e.onFileDialogCancel,b=e.onFileDialogOpen,E=e.useFsAccessApi,T=e.autoFocus,N=e.preventDropOnDocument,P=e.noClick,_=e.noKeyboard,D=e.noDrag,H=e.noDragEventsBubbling,K=e.onError,ee=e.validator,W=M.useMemo(function(){return TU(n)},[n]),de=M.useMemo(function(){return EU(n)},[n]),se=M.useMemo(function(){return typeof b=="function"?b:YE},[b]),fe=M.useMemo(function(){return typeof v=="function"?v:YE},[v]),q=M.useRef(null),Z=M.useRef(null),Y=M.useReducer(BU,gm),oe=um(Y,2),Q=oe[0],X=oe[1],$=Q.isFocused,te=Q.isFileDialogActive,_e=M.useRef(typeof window<"u"&&window.isSecureContext&&E&&_U()),ke=function(){!_e.current&&te&&setTimeout(function(){if(Z.current){var ae=Z.current.files;ae.length||(X({type:"closeDialog"}),fe())}},300)};M.useEffect(function(){return window.addEventListener("focus",ke,!1),function(){window.removeEventListener("focus",ke,!1)}},[Z,te,fe,_e]);var xe=M.useRef([]),Pe=function(ae){q.current&&q.current.contains(ae.target)||(ae.preventDefault(),xe.current=[])};M.useEffect(function(){return N&&(document.addEventListener("dragover",zE,!1),document.addEventListener("drop",Pe,!1)),function(){N&&(document.removeEventListener("dragover",zE),document.removeEventListener("drop",Pe))}},[q,N]),M.useEffect(function(){return!r&&T&&q.current&&q.current.focus(),function(){}},[q,T,r]);var Te=M.useCallback(function(U){K?K(U):console.error(U)},[K]),z=M.useCallback(function(U){U.preventDefault(),U.persist(),Dn(U),xe.current=[].concat(MU(xe.current),[U.target]),xu(U)&&Promise.resolve(o(U)).then(function(ae){if(!(bu(U)&&!H)){var ye=ae.length,he=ye>0&&CU({files:ae,accept:W,minSize:s,maxSize:a,multiple:l,maxFiles:u,validator:ee}),Ee=ye>0&&!he;X({isDragAccept:he,isDragReject:Ee,isDragActive:!0,type:"setDraggedFiles"}),h&&h(U)}}).catch(function(ae){return Te(ae)})},[o,h,Te,H,W,s,a,l,u,ee]),ce=M.useCallback(function(U){U.preventDefault(),U.persist(),Dn(U);var ae=xu(U);if(ae&&U.dataTransfer)try{U.dataTransfer.dropEffect="copy"}catch{}return ae&&g&&g(U),!1},[g,H]),Ae=M.useCallback(function(U){U.preventDefault(),U.persist(),Dn(U);var ae=xe.current.filter(function(he){return q.current&&q.current.contains(he)}),ye=ae.indexOf(U.target);ye!==-1&&ae.splice(ye,1),xe.current=ae,!(ae.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),xu(U)&&p&&p(U))},[q,p,H]),Ce=M.useCallback(function(U,ae){var ye=[],he=[];U.forEach(function(Ee){var Xe=UE(Ee,W),ft=um(Xe,2),xt=ft[0],bo=ft[1],Jt=BE(Ee,s,a),vn=um(Jt,2),jr=vn[0],Gt=vn[1],hr=ee?ee(Ee):null;if(xt&&jr&&!hr)ye.push(Ee);else{var Wr=[bo,Gt];hr&&(Wr=Wr.concat(hr)),he.push({file:Ee,errors:Wr.filter(function(oa){return oa})})}}),(!l&&ye.length>1||l&&u>=1&&ye.length>u)&&(ye.forEach(function(Ee){he.push({file:Ee,errors:[wU]})}),ye.splice(0)),X({acceptedFiles:ye,fileRejections:he,isDragReject:he.length>0,type:"setFiles"}),w&&w(ye,he,ae),he.length>0&&x&&x(he,ae),ye.length>0&&y&&y(ye,ae)},[X,l,W,s,a,u,w,y,x,ee]),Ne=M.useCallback(function(U){U.preventDefault(),U.persist(),Dn(U),xe.current=[],xu(U)&&Promise.resolve(o(U)).then(function(ae){bu(U)&&!H||Ce(ae,U)}).catch(function(ae){return Te(ae)}),X({type:"reset"})},[o,Ce,Te,H]),ne=M.useCallback(function(){if(_e.current){X({type:"openDialog"}),se();var U={multiple:l,types:de};window.showOpenFilePicker(U).then(function(ae){return o(ae)}).then(function(ae){Ce(ae,null),X({type:"closeDialog"})}).catch(function(ae){AU(ae)?(fe(ae),X({type:"closeDialog"})):IU(ae)?(_e.current=!1,Z.current?(Z.current.value=null,Z.current.click()):Te(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Te(ae)});return}Z.current&&(X({type:"openDialog"}),se(),Z.current.value=null,Z.current.click())},[X,se,fe,E,Ce,Te,de,l]),Ve=M.useCallback(function(U){!q.current||!q.current.isEqualNode(U.target)||(U.key===" "||U.key==="Enter"||U.keyCode===32||U.keyCode===13)&&(U.preventDefault(),ne())},[q,ne]),Qe=M.useCallback(function(){X({type:"focus"})},[]),Ct=M.useCallback(function(){X({type:"blur"})},[]),Yt=M.useCallback(function(){P||(SU()?setTimeout(ne,0):ne())},[P,ne]),bt=function(ae){return r?null:ae},rn=function(ae){return _?null:bt(ae)},zt=function(ae){return D?null:bt(ae)},Dn=function(ae){H&&ae.stopPropagation()},Kt=M.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=U.refKey,ye=ae===void 0?"ref":ae,he=U.role,Ee=U.onKeyDown,Xe=U.onFocus,ft=U.onBlur,xt=U.onClick,bo=U.onDragEnter,Jt=U.onDragOver,vn=U.onDragLeave,jr=U.onDrop,Gt=Su(U,PU);return Bt(Bt(hm({onKeyDown:rn(yo(Ee,Ve)),onFocus:rn(yo(Xe,Qe)),onBlur:rn(yo(ft,Ct)),onClick:bt(yo(xt,Yt)),onDragEnter:zt(yo(bo,z)),onDragOver:zt(yo(Jt,ce)),onDragLeave:zt(yo(vn,Ae)),onDrop:zt(yo(jr,Ne)),role:typeof he=="string"&&he!==""?he:"presentation"},ye,q),!r&&!_?{tabIndex:0}:{}),Gt)}},[q,Ve,Qe,Ct,Yt,z,ce,Ae,Ne,_,D,r]),L=M.useCallback(function(U){U.stopPropagation()},[]),J=M.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=U.refKey,ye=ae===void 0?"ref":ae,he=U.onChange,Ee=U.onClick,Xe=Su(U,OU),ft=hm({accept:W,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:bt(yo(he,Ne)),onClick:bt(yo(Ee,L)),tabIndex:-1},ye,Z);return Bt(Bt({},ft),Xe)}},[Z,n,l,Ne,r]);return Bt(Bt({},Q),{},{isFocused:$&&!r,getRootProps:Kt,getInputProps:J,rootRef:q,inputRef:Z,open:bt(ne)})}function BU(t,e){switch(e.type){case"focus":return Bt(Bt({},t),{},{isFocused:!0});case"blur":return Bt(Bt({},t),{},{isFocused:!1});case"openDialog":return Bt(Bt({},gm),{},{isFileDialogActive:!0});case"closeDialog":return Bt(Bt({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return Bt(Bt({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return Bt(Bt({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return Bt({},gm);default:return t}}function YE(){}const zU=({onFilesSelected:t,children:e})=>{const[n,r]=M.useState(!1),{getRootProps:o,getInputProps:a}=qE({noClick:!0,onDrop:s=>{if(s&&s.length>0)if(s[0].path.split("/").length>2){const u=s.map(h=>{const g=(h.path||h.relativePath||"").split("/").slice(1).join("/");return(!h.webkitRelativePath||h.webkitRelativePath==="")&&Object.defineProperty(h,"webkitRelativePath",{writable:!0,value:g,enumerable:!0,configurable:!0}),h});t(u,"folder")}else t(s,"files");r(!1)},onDragOver:s=>{s.preventDefault(),n||r(!0)},multiple:!0});return M.useEffect(()=>{const s=l=>{l.clientX===0&&l.clientY===0&&r(!1)};return document.addEventListener("dragleave",s),()=>{document.removeEventListener("dragleave",s)}},[]),d.jsxs("div",{...o(),className:"transition-opacity min-h-[600px]",children:[n?d.jsx("div",{className:"flex flex-col items-center justify-center p-4 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50 h-screen"}):e,d.jsx("input",{...a()})]})},VU=({openDialogRename:t,setOpenDialogRename:e,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:a,ignoreCache:s,autoSyncAfterFileOperation:l})=>{var N;const[u,h]=M.useState({}),[p,g]=M.useState(!1),[w,y]=M.useState(!1),[x,v]=M.useState(""),{toast:b}=mc();M.useEffect(()=>{t&&E(x)},[x,t]);const E=async P=>{try{y(!0);const _=await Le.get(`${n}/api/list-s3-folders?prefix=${P}`);h(_==null?void 0:_.data)}catch{b({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{y(!1)}},T=async()=>{g(!0);try{const P=o.key,_=P.endsWith("/")?P:`${P}/`,D=x.endsWith("/")?x:`${x}/`;if(_===D||P===x){b({title:"Lỗi",description:"Không thể di chuyển file đến cùng vị trí",variant:"destructive"}),g(!1);return}await Le.post(`${n}/api/move`,{oldPath:P,newPath:x}),s.current=!0,await a(),b({title:"Đã di chuyển",description:`Đã di chuyển thành công "${o.name}" đến "${x}"`}),e(!1),r(null),v(""),l&&await l("move")}catch(P){console.error("Error renaming item:",P),b({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{g(!1)}};return d.jsx(lr,{open:t,onOpenChange:P=>{P||(e(!1),r(null),v(""))},children:d.jsxs(Vn,{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:[d.jsxs(Kn,{className:"mb-4 w-full h-full",children:[d.jsx("nav",{className:"mb-4",children:d.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),x.split("/").map((P,_,D)=>d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(P==="Root"?"":D.slice(0,_+1).join("/")+"/"),children:P},_))]})}),d.jsxs(Gn,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",d.jsxs("span",{className:"text-sm text-gray-500",children:["( file hoặc folder sẽ được di chuyển đến thư mục"," ",x===""?"Root":x," )"]})]}),d.jsx(Ci,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:w?d.jsx("div",{className:"flex justify-center items-center py-4",children:d.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):d.jsx("ul",{className:"space-y-2",children:(N=Object.keys(u))==null?void 0:N.map(P=>d.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(P),children:P},P))})})]}),d.jsxs(Fr,{className:"flex justify-end space-x-2",children:[d.jsx(He,{variant:"outline",onClick:()=>e(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),d.jsx(He,{onClick:T,disabled:p,className:"s3-explr-crawl-btn",children:"Move"})]})]})})};function JE(t,[e,n]){return Math.min(n,Math.max(e,t))}function KU(t){const e=t+"CollectionProvider",[n,r]=yr(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:b,children:E}=v,T=M.useRef(null),N=M.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:N,collectionRef:T,children:E})};s.displayName=e;const l=t+"CollectionSlot",u=mi(l),h=M.forwardRef((v,b)=>{const{scope:E,children:T}=v,N=a(l,E),P=rt(b,N.collectionRef);return d.jsx(u,{ref:P,children:T})});h.displayName=l;const p=t+"CollectionItemSlot",g="data-radix-collection-item",w=mi(p),y=M.forwardRef((v,b)=>{const{scope:E,children:T,...N}=v,P=M.useRef(null),_=rt(b,P),D=a(p,E);return M.useEffect(()=>(D.itemMap.set(P,{ref:P,...N}),()=>void D.itemMap.delete(P))),d.jsx(w,{[g]:"",ref:_,children:T})});y.displayName=p;function x(v){const b=a(t+"CollectionConsumer",v);return M.useCallback(()=>{const T=b.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((D,H)=>N.indexOf(D.ref.current)-N.indexOf(H.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},x,r]}var GU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mn=GU.reduce((t,e)=>{const n=mi(`Primitive.${e}`),r=C.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function jU(t,e){t&&Aa.flushSync(()=>t.dispatchEvent(e))}var WU="DismissableLayer",mm="dismissableLayer.update",qU="dismissableLayer.pointerDownOutside",YU="dismissableLayer.focusOutside",QE,XE=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ZE=C.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=t,h=C.useContext(XE),[p,g]=C.useState(null),w=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=C.useState({}),x=rt(e,H=>g(H)),v=Array.from(h.layers),[b]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=v.indexOf(b),T=p?v.indexOf(p):-1,N=h.layersWithOutsidePointerEventsDisabled.size>0,P=T>=E,_=XU(H=>{const K=H.target,ee=[...h.branches].some(W=>W.contains(K));!P||ee||(o==null||o(H),s==null||s(H),H.defaultPrevented||l==null||l())},w),D=ZU(H=>{const K=H.target;[...h.branches].some(W=>W.contains(K))||(a==null||a(H),s==null||s(H),H.defaultPrevented||l==null||l())},w);return HC(H=>{T===h.layers.size-1&&(r==null||r(H),!H.defaultPrevented&&l&&(H.preventDefault(),l()))},w),C.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(QE=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),eT(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=QE)}},[p,w,n,h]),C.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),eT())},[p,h]),C.useEffect(()=>{const H=()=>y({});return document.addEventListener(mm,H),()=>document.removeEventListener(mm,H)},[]),d.jsx(mn.div,{...u,ref:x,style:{pointerEvents:N?P?"auto":"none":void 0,...t.style},onFocusCapture:Ue(t.onFocusCapture,D.onFocusCapture),onBlurCapture:Ue(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Ue(t.onPointerDownCapture,_.onPointerDownCapture)})});ZE.displayName=WU;var JU="DismissableLayerBranch",QU=C.forwardRef((t,e)=>{const n=C.useContext(XE),r=C.useRef(null),o=rt(e,r);return C.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(mn.div,{...t,ref:o})});QU.displayName=JU;function XU(t,e=globalThis==null?void 0:globalThis.document){const n=gn(t),r=C.useRef(!1),o=C.useRef(()=>{});return C.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let u=function(){tT(qU,n,h,{discrete:!0})};const h={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=u,e.addEventListener("click",o.current,{once:!0})):u()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",a),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function ZU(t,e=globalThis==null?void 0:globalThis.document){const n=gn(t),r=C.useRef(!1);return C.useEffect(()=>{const o=a=>{a.target&&!r.current&&tT(YU,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function eT(){const t=new CustomEvent(mm);document.dispatchEvent(t)}function tT(t,e,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?jU(o,a):o.dispatchEvent(a)}var vm="focusScope.autoFocusOnMount",ym="focusScope.autoFocusOnUnmount",nT={bubbles:!1,cancelable:!0},eB="FocusScope",rT=C.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=t,[l,u]=C.useState(null),h=gn(o),p=gn(a),g=C.useRef(null),w=rt(e,v=>u(v)),y=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let v=function(N){if(y.paused||!l)return;const P=N.target;l.contains(P)?g.current=P:Si(g.current,{select:!0})},b=function(N){if(y.paused||!l)return;const P=N.relatedTarget;P!==null&&(l.contains(P)||Si(g.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const _ of N)_.removedNodes.length>0&&Si(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const T=new MutationObserver(E);return l&&T.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),T.disconnect()}}},[r,l,y.paused]),C.useEffect(()=>{if(l){aT.add(y);const v=document.activeElement;if(!l.contains(v)){const E=new CustomEvent(vm,nT);l.addEventListener(vm,h),l.dispatchEvent(E),E.defaultPrevented||(tB(aB(oT(l)),{select:!0}),document.activeElement===v&&Si(l))}return()=>{l.removeEventListener(vm,h),setTimeout(()=>{const E=new CustomEvent(ym,nT);l.addEventListener(ym,p),l.dispatchEvent(E),E.defaultPrevented||Si(v??document.body,{select:!0}),l.removeEventListener(ym,p),aT.remove(y)},0)}}},[l,h,p,y]);const x=C.useCallback(v=>{if(!n&&!r||y.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,E=document.activeElement;if(b&&E){const T=v.currentTarget,[N,P]=nB(T);N&&P?!v.shiftKey&&E===P?(v.preventDefault(),n&&Si(N,{select:!0})):v.shiftKey&&E===N&&(v.preventDefault(),n&&Si(P,{select:!0})):E===T&&v.preventDefault()}},[n,r,y.paused]);return d.jsx(mn.div,{tabIndex:-1,...s,ref:w,onKeyDown:x})});rT.displayName=eB;function tB(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Si(r,{select:e}),document.activeElement!==n)return}function nB(t){const e=oT(t),n=iT(e,t),r=iT(e.reverse(),t);return[n,r]}function oT(t){const e=[],n=document.createTreeWalker(t,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();)e.push(n.currentNode);return e}function iT(t,e){for(const n of t)if(!rB(n,{upTo:e}))return n}function rB(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function oB(t){return t instanceof HTMLInputElement&&"select"in t}function Si(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&oB(t)&&e&&t.select()}}var aT=iB();function iB(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=sT(t,e),t.unshift(e)},remove(e){var n;t=sT(t,e),(n=t[0])==null||n.resume()}}}function sT(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function aB(t){return t.filter(e=>e.tagName!=="A")}var sB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cB=sB.reduce((t,e)=>{const n=mi(`Primitive.${e}`),r=C.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),lB="Arrow",cT=C.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...a}=t;return d.jsx(cB.svg,{...a,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});cT.displayName=lB;var dB=cT,uB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lT=uB.reduce((t,e)=>{const n=mi(`Primitive.${e}`),r=C.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),wm="Popper",[dT,uT]=yr(wm),[fB,fT]=dT(wm),hT=t=>{const{__scopePopper:e,children:n}=t,[r,o]=C.useState(null);return d.jsx(fB,{scope:e,anchor:r,onAnchorChange:o,children:n})};hT.displayName=wm;var pT="PopperAnchor",gT=C.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,a=fT(pT,n),s=C.useRef(null),l=rt(e,s);return C.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:d.jsx(lT.div,{...o,ref:l})});gT.displayName=pT;var Cm="PopperContent",[hB,pB]=dT(Cm),mT=C.forwardRef((t,e)=>{var z,ce,Ae,Ce,Ne,ne;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:x,...v}=t,b=fT(Cm,n),[E,T]=C.useState(null),N=rt(e,Ve=>T(Ve)),[P,_]=C.useState(null),D=vg(P),H=(D==null?void 0:D.width)??0,K=(D==null?void 0:D.height)??0,ee=r+(a!=="center"?"-"+a:""),W=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},de=Array.isArray(h)?h:[h],se=de.length>0,fe={padding:W,boundary:de.filter(mB),altBoundary:se},{refs:q,floatingStyles:Z,placement:Y,isPositioned:oe,middlewareData:Q}=k_({strategy:"fixed",placement:ee,whileElementsMounted:(...Ve)=>E_(...Ve,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[N_({mainAxis:o+K,alignmentAxis:s}),u&&P_({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?O_():void 0,...fe}),u&&M_({...fe}),R_({...fe,apply:({elements:Ve,rects:Qe,availableWidth:Ct,availableHeight:Yt})=>{const{width:bt,height:rn}=Qe.reference,zt=Ve.floating.style;zt.setProperty("--radix-popper-available-width",`${Ct}px`),zt.setProperty("--radix-popper-available-height",`${Yt}px`),zt.setProperty("--radix-popper-anchor-width",`${bt}px`),zt.setProperty("--radix-popper-anchor-height",`${rn}px`)}}),P&&L_({element:P,padding:l}),vB({arrowWidth:H,arrowHeight:K}),w&&D_({strategy:"referenceHidden",...fe})]}),[X,$]=wT(Y),te=gn(x);tn(()=>{oe&&(te==null||te())},[oe,te]);const _e=(z=Q.arrow)==null?void 0:z.x,ke=(ce=Q.arrow)==null?void 0:ce.y,xe=((Ae=Q.arrow)==null?void 0:Ae.centerOffset)!==0,[Pe,Te]=C.useState();return tn(()=>{E&&Te(window.getComputedStyle(E).zIndex)},[E]),d.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:oe?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Pe,"--radix-popper-transform-origin":[(Ce=Q.transformOrigin)==null?void 0:Ce.x,(Ne=Q.transformOrigin)==null?void 0:Ne.y].join(" "),...((ne=Q.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(hB,{scope:n,placedSide:X,onArrowChange:_,arrowX:_e,arrowY:ke,shouldHideArrow:xe,children:d.jsx(lT.div,{"data-side":X,"data-align":$,...v,ref:N,style:{...v.style,animation:oe?void 0:"none"}})})})});mT.displayName=Cm;var vT="PopperArrow",gB={top:"bottom",right:"left",bottom:"top",left:"right"},yT=C.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,a=pB(vT,r),s=gB[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(dB,{...o,ref:n,style:{...o.style,display:"block"}})})});yT.displayName=vT;function mB(t){return t!==null}var vB=t=>({name:"transformOrigin",options:t,fn(e){var b,E,T;const{placement:n,rects:r,middlewareData:o}=e,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,l=s?0:t.arrowWidth,u=s?0:t.arrowHeight,[h,p]=wT(n),g={start:"0%",center:"50%",end:"100%"}[p],w=(((E=o.arrow)==null?void 0:E.x)??0)+l/2,y=(((T=o.arrow)==null?void 0:T.y)??0)+u/2;let x="",v="";return h==="bottom"?(x=s?g:`${w}px`,v=`${-u}px`):h==="top"?(x=s?g:`${w}px`,v=`${r.floating.height+u}px`):h==="right"?(x=`${-u}px`,v=s?g:`${y}px`):h==="left"&&(x=`${r.floating.width+u}px`,v=s?g:`${y}px`),{data:{x,y:v}}}});function wT(t){const[e,n="center"]=t.split("-");return[e,n]}var yB=hT,wB=gT,CB=mT,bB=yT,xB="Portal",CT=C.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[o,a]=C.useState(!1);tn(()=>a(!0),[]);const s=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?zf.createPortal(d.jsx(mn.div,{...r,ref:e}),s):null});CT.displayName=xB;var SB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_B=SB.reduce((t,e)=>{const n=mi(`Primitive.${e}`),r=C.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),bT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),EB="VisuallyHidden",TB=C.forwardRef((t,e)=>d.jsx(_B.span,{...t,ref:e,style:{...bT,...t.style}}));TB.displayName=EB;var AB=[" ","Enter","ArrowUp","ArrowDown"],IB=[" ","Enter"],Xi="Select",[_u,Eu,kB]=KU(Xi),[os,zj]=yr(Xi,[kB,uT]),Tu=uT(),[NB,_i]=os(Xi),[PB,OB]=os(Xi),xT=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:l,onValueChange:u,dir:h,name:p,autoComplete:g,disabled:w,required:y,form:x}=t,v=Tu(e),[b,E]=C.useState(null),[T,N]=C.useState(null),[P,_]=C.useState(!1),D=Cg(h),[H,K]=ui({prop:r,defaultProp:o??!1,onChange:a,caller:Xi}),[ee,W]=ui({prop:s,defaultProp:l,onChange:u,caller:Xi}),de=C.useRef(null),se=b?x||!!b.closest("form"):!0,[fe,q]=C.useState(new Set),Z=Array.from(fe).map(Y=>Y.props.value).join(";");return d.jsx(yB,{...v,children:d.jsxs(NB,{required:y,scope:e,trigger:b,onTriggerChange:E,valueNode:T,onValueNodeChange:N,valueNodeHasChildren:P,onValueNodeHasChildrenChange:_,contentId:Mo(),value:ee,onValueChange:W,open:H,onOpenChange:K,dir:D,triggerPointerDownPosRef:de,disabled:w,children:[d.jsx(_u.Provider,{scope:e,children:d.jsx(PB,{scope:t.__scopeSelect,onNativeOptionAdd:C.useCallback(Y=>{q(oe=>new Set(oe).add(Y))},[]),onNativeOptionRemove:C.useCallback(Y=>{q(oe=>{const Q=new Set(oe);return Q.delete(Y),Q})},[]),children:n})}),se?d.jsxs(KT,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:g,value:ee,onChange:Y=>W(Y.target.value),disabled:w,form:x,children:[ee===void 0?d.jsx("option",{value:""}):null,Array.from(fe)]},Z):null]})})};xT.displayName=Xi;var ST="SelectTrigger",_T=C.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,a=Tu(n),s=_i(ST,n),l=s.disabled||r,u=rt(e,s.onTriggerChange),h=Eu(n),p=C.useRef("touch"),[g,w,y]=jT(v=>{const b=h().filter(N=>!N.disabled),E=b.find(N=>N.value===s.value),T=WT(b,v,E);T!==void 0&&s.onValueChange(T.value)}),x=v=>{l||(s.onOpenChange(!0),y()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return d.jsx(wB,{asChild:!0,...a,children:d.jsx(mn.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":GT(s.value)?"":void 0,...o,ref:u,onClick:Ue(o.onClick,v=>{v.currentTarget.focus(),p.current!=="mouse"&&x(v)}),onPointerDown:Ue(o.onPointerDown,v=>{p.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(x(v),v.preventDefault())}),onKeyDown:Ue(o.onKeyDown,v=>{const b=g.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&w(v.key),!(b&&v.key===" ")&&AB.includes(v.key)&&(x(),v.preventDefault())})})})});_T.displayName=ST;var ET="SelectValue",TT=C.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...l}=t,u=_i(ET,n),{onValueNodeHasChildrenChange:h}=u,p=a!==void 0,g=rt(e,u.onValueNodeChange);return tn(()=>{h(p)},[h,p]),d.jsx(mn.span,{...l,ref:g,style:{pointerEvents:"none"},children:GT(u.value)?d.jsx(d.Fragment,{children:s}):a})});TT.displayName=ET;var MB="SelectIcon",AT=C.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return d.jsx(mn.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});AT.displayName=MB;var RB="SelectPortal",IT=t=>d.jsx(CT,{asChild:!0,...t});IT.displayName=RB;var Zi="SelectContent",kT=C.forwardRef((t,e)=>{const n=_i(Zi,t.__scopeSelect),[r,o]=C.useState();if(tn(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?Aa.createPortal(d.jsx(NT,{scope:t.__scopeSelect,children:d.jsx(_u.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),a):null}return d.jsx(PT,{...t,ref:e})});kT.displayName=Zi;var Vr=10,[NT,Ei]=os(Zi),DB="SelectContentImpl",LB=mi("SelectContent.RemoveScroll"),PT=C.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:u,align:h,alignOffset:p,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:x,hideWhenDetached:v,avoidCollisions:b,...E}=t,T=_i(Zi,n),[N,P]=C.useState(null),[_,D]=C.useState(null),H=rt(e,z=>P(z)),[K,ee]=C.useState(null),[W,de]=C.useState(null),se=Eu(n),[fe,q]=C.useState(!1),Z=C.useRef(!1);C.useEffect(()=>{if(N)return pb(N)},[N]),QC();const Y=C.useCallback(z=>{const[ce,...Ae]=se().map(ne=>ne.ref.current),[Ce]=Ae.slice(-1),Ne=document.activeElement;for(const ne of z)if(ne===Ne||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===ce&&_&&(_.scrollTop=0),ne===Ce&&_&&(_.scrollTop=_.scrollHeight),ne==null||ne.focus(),document.activeElement!==Ne))return},[se,_]),oe=C.useCallback(()=>Y([K,N]),[Y,K,N]);C.useEffect(()=>{fe&&oe()},[fe,oe]);const{onOpenChange:Q,triggerPointerDownPosRef:X}=T;C.useEffect(()=>{if(N){let z={x:0,y:0};const ce=Ce=>{var Ne,ne;z={x:Math.abs(Math.round(Ce.pageX)-(((Ne=X.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((ne=X.current)==null?void 0:ne.y)??0))}},Ae=Ce=>{z.x<=10&&z.y<=10?Ce.preventDefault():N.contains(Ce.target)||Q(!1),document.removeEventListener("pointermove",ce),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[N,Q,X]),C.useEffect(()=>{const z=()=>Q(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[Q]);const[$,te]=jT(z=>{const ce=se().filter(Ne=>!Ne.disabled),Ae=ce.find(Ne=>Ne.ref.current===document.activeElement),Ce=WT(ce,z,Ae);Ce&&setTimeout(()=>Ce.ref.current.focus())}),_e=C.useCallback((z,ce,Ae)=>{const Ce=!Z.current&&!Ae;(T.value!==void 0&&T.value===ce||Ce)&&(ee(z),Ce&&(Z.current=!0))},[T.value]),ke=C.useCallback(()=>N==null?void 0:N.focus(),[N]),xe=C.useCallback((z,ce,Ae)=>{const Ce=!Z.current&&!Ae;(T.value!==void 0&&T.value===ce||Ce)&&de(z)},[T.value]),Pe=r==="popper"?bm:OT,Te=Pe===bm?{side:l,sideOffset:u,align:h,alignOffset:p,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:x,hideWhenDetached:v,avoidCollisions:b}:{};return d.jsx(NT,{scope:n,content:N,viewport:_,onViewportChange:D,itemRefCallback:_e,selectedItem:K,onItemLeave:ke,itemTextRefCallback:xe,focusSelectedItem:oe,selectedItemText:W,position:r,isPositioned:fe,searchRef:$,children:d.jsx(_p,{as:LB,allowPinchZoom:!0,children:d.jsx(rT,{asChild:!0,trapped:T.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:Ue(o,z=>{var ce;(ce=T.trigger)==null||ce.focus({preventScroll:!0}),z.preventDefault()}),children:d.jsx(ZE,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:d.jsx(Pe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:z=>z.preventDefault(),...E,...Te,onPlaced:()=>q(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:Ue(E.onKeyDown,z=>{const ce=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!ce&&z.key.length===1&&te(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let Ce=se().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(z.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const Ne=z.target,ne=Ce.indexOf(Ne);Ce=Ce.slice(ne+1)}setTimeout(()=>Y(Ce)),z.preventDefault()}})})})})})})});PT.displayName=DB;var FB="SelectItemAlignedPosition",OT=C.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,a=_i(Zi,n),s=Ei(Zi,n),[l,u]=C.useState(null),[h,p]=C.useState(null),g=rt(e,H=>p(H)),w=Eu(n),y=C.useRef(!1),x=C.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:E,focusSelectedItem:T}=s,N=C.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&h&&v&&b&&E){const H=a.trigger.getBoundingClientRect(),K=h.getBoundingClientRect(),ee=a.valueNode.getBoundingClientRect(),W=E.getBoundingClientRect();if(a.dir!=="rtl"){const Ne=W.left-K.left,ne=ee.left-Ne,Ve=H.left-ne,Qe=H.width+Ve,Ct=Math.max(Qe,K.width),Yt=window.innerWidth-Vr,bt=JE(ne,[Vr,Math.max(Vr,Yt-Ct)]);l.style.minWidth=Qe+"px",l.style.left=bt+"px"}else{const Ne=K.right-W.right,ne=window.innerWidth-ee.right-Ne,Ve=window.innerWidth-H.right-ne,Qe=H.width+Ve,Ct=Math.max(Qe,K.width),Yt=window.innerWidth-Vr,bt=JE(ne,[Vr,Math.max(Vr,Yt-Ct)]);l.style.minWidth=Qe+"px",l.style.right=bt+"px"}const de=w(),se=window.innerHeight-Vr*2,fe=v.scrollHeight,q=window.getComputedStyle(h),Z=parseInt(q.borderTopWidth,10),Y=parseInt(q.paddingTop,10),oe=parseInt(q.borderBottomWidth,10),Q=parseInt(q.paddingBottom,10),X=Z+Y+fe+Q+oe,$=Math.min(b.offsetHeight*5,X),te=window.getComputedStyle(v),_e=parseInt(te.paddingTop,10),ke=parseInt(te.paddingBottom,10),xe=H.top+H.height/2-Vr,Pe=se-xe,Te=b.offsetHeight/2,z=b.offsetTop+Te,ce=Z+Y+z,Ae=X-ce;if(ce<=xe){const Ne=de.length>0&&b===de[de.length-1].ref.current;l.style.bottom="0px";const ne=h.clientHeight-v.offsetTop-v.offsetHeight,Ve=Math.max(Pe,Te+(Ne?ke:0)+ne+oe),Qe=ce+Ve;l.style.height=Qe+"px"}else{const Ne=de.length>0&&b===de[0].ref.current;l.style.top="0px";const Ve=Math.max(xe,Z+v.offsetTop+(Ne?_e:0)+Te)+Ae;l.style.height=Ve+"px",v.scrollTop=ce-xe+v.offsetTop}l.style.margin=`${Vr}px 0`,l.style.minHeight=$+"px",l.style.maxHeight=se+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,h,v,b,E,a.dir,r]);tn(()=>N(),[N]);const[P,_]=C.useState();tn(()=>{h&&_(window.getComputedStyle(h).zIndex)},[h]);const D=C.useCallback(H=>{H&&x.current===!0&&(N(),T==null||T(),x.current=!1)},[N,T]);return d.jsx(HB,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:D,children:d.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:d.jsx(mn.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});OT.displayName=FB;var $B="SelectPopperPosition",bm=C.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Vr,...a}=t,s=Tu(n);return d.jsx(CB,{...s,...a,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});bm.displayName=$B;var[HB,xm]=os(Zi,{}),Sm="SelectViewport",MT=C.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...o}=t,a=Ei(Sm,n),s=xm(Sm,n),l=rt(e,a.onViewportChange),u=C.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(_u.Slot,{scope:n,children:d.jsx(mn.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ue(o.onScroll,h=>{const p=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w!=null&&w.current&&g){const y=Math.abs(u.current-p.scrollTop);if(y>0){const x=window.innerHeight-Vr*2,v=parseFloat(g.style.minHeight),b=parseFloat(g.style.height),E=Math.max(v,b);if(E<x){const T=E+y,N=Math.min(x,T),P=T-N;g.style.height=N+"px",g.style.bottom==="0px"&&(p.scrollTop=P>0?P:0,g.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});MT.displayName=Sm;var RT="SelectGroup",[UB,BB]=os(RT),zB=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Mo();return d.jsx(UB,{scope:n,id:o,children:d.jsx(mn.div,{role:"group","aria-labelledby":o,...r,ref:e})})});zB.displayName=RT;var DT="SelectLabel",LT=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=BB(DT,n);return d.jsx(mn.div,{id:o.id,...r,ref:e})});LT.displayName=DT;var Au="SelectItem",[VB,FT]=os(Au),$T=C.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=t,l=_i(Au,n),u=Ei(Au,n),h=l.value===r,[p,g]=C.useState(a??""),[w,y]=C.useState(!1),x=rt(e,T=>{var N;return(N=u.itemRefCallback)==null?void 0:N.call(u,T,r,o)}),v=Mo(),b=C.useRef("touch"),E=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(VB,{scope:n,value:r,disabled:o,textId:v,isSelected:h,onItemTextChange:C.useCallback(T=>{g(N=>N||((T==null?void 0:T.textContent)??"").trim())},[]),children:d.jsx(_u.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:d.jsx(mn.div,{role:"option","aria-labelledby":v,"data-highlighted":w?"":void 0,"aria-selected":h&&w,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:x,onFocus:Ue(s.onFocus,()=>y(!0)),onBlur:Ue(s.onBlur,()=>y(!1)),onClick:Ue(s.onClick,()=>{b.current!=="mouse"&&E()}),onPointerUp:Ue(s.onPointerUp,()=>{b.current==="mouse"&&E()}),onPointerDown:Ue(s.onPointerDown,T=>{b.current=T.pointerType}),onPointerMove:Ue(s.onPointerMove,T=>{var N;b.current=T.pointerType,o?(N=u.onItemLeave)==null||N.call(u):b.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ue(s.onPointerLeave,T=>{var N;T.currentTarget===document.activeElement&&((N=u.onItemLeave)==null||N.call(u))}),onKeyDown:Ue(s.onKeyDown,T=>{var P;((P=u.searchRef)==null?void 0:P.current)!==""&&T.key===" "||(IB.includes(T.key)&&E(),T.key===" "&&T.preventDefault())})})})})});$T.displayName=Au;var _c="SelectItemText",HT=C.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...a}=t,s=_i(_c,n),l=Ei(_c,n),u=FT(_c,n),h=OB(_c,n),[p,g]=C.useState(null),w=rt(e,E=>g(E),u.onItemTextChange,E=>{var T;return(T=l.itemTextRefCallback)==null?void 0:T.call(l,E,u.value,u.disabled)}),y=p==null?void 0:p.textContent,x=C.useMemo(()=>d.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=h;return tn(()=>(v(x),()=>b(x)),[v,b,x]),d.jsxs(d.Fragment,{children:[d.jsx(mn.span,{id:u.textId,...a,ref:w}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Aa.createPortal(a.children,s.valueNode):null]})});HT.displayName=_c;var UT="SelectItemIndicator",BT=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return FT(UT,n).isSelected?d.jsx(mn.span,{"aria-hidden":!0,...r,ref:e}):null});BT.displayName=UT;var _m="SelectScrollUpButton",KB=C.forwardRef((t,e)=>{const n=Ei(_m,t.__scopeSelect),r=xm(_m,t.__scopeSelect),[o,a]=C.useState(!1),s=rt(e,r.onScrollButtonChange);return tn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=u.scrollTop>0;a(h)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?d.jsx(zT,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});KB.displayName=_m;var Em="SelectScrollDownButton",GB=C.forwardRef((t,e)=>{const n=Ei(Em,t.__scopeSelect),r=xm(Em,t.__scopeSelect),[o,a]=C.useState(!1),s=rt(e,r.onScrollButtonChange);return tn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<h;a(p)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?d.jsx(zT,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});GB.displayName=Em;var zT=C.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,a=Ei("SelectScrollButton",n),s=C.useRef(null),l=Eu(n),u=C.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return C.useEffect(()=>()=>u(),[u]),tn(()=>{var p;const h=l().find(g=>g.ref.current===document.activeElement);(p=h==null?void 0:h.ref.current)==null||p.scrollIntoView({block:"nearest"})},[l]),d.jsx(mn.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:Ue(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ue(o.onPointerMove,()=>{var h;(h=a.onItemLeave)==null||h.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ue(o.onPointerLeave,()=>{u()})})}),jB="SelectSeparator",VT=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return d.jsx(mn.div,{"aria-hidden":!0,...r,ref:e})});VT.displayName=jB;var Tm="SelectArrow",WB=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Tu(n),a=_i(Tm,n),s=Ei(Tm,n);return a.open&&s.position==="popper"?d.jsx(bB,{...o,...r,ref:e}):null});WB.displayName=Tm;var qB="SelectBubbleInput",KT=C.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const o=C.useRef(null),a=rt(r,o),s=iS(e);return C.useEffect(()=>{const l=o.current;if(!l)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==e&&p){const g=new Event("change",{bubbles:!0});p.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(mn.select,{...n,style:{...bT,...n.style},ref:a,defaultValue:e})});KT.displayName=qB;function GT(t){return t===""||t===void 0}function jT(t){const e=gn(t),n=C.useRef(""),r=C.useRef(0),o=C.useCallback(s=>{const l=n.current+s;e(l),function u(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[e]),a=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function WT(t,e,n){const o=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let s=YB(t,Math.max(a,0));o.length===1&&(s=s.filter(h=>h!==n));const u=s.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function YB(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var JB=xT,qT=_T,QB=TT,XB=AT,ZB=IT,YT=kT,e3=MT,JT=LT,QT=$T,t3=HT,n3=BT,XT=VT;const Am=JB,Im=QB,Iu=C.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(qT,{ref:r,className:ze("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[e,d.jsx(XB,{asChild:!0,children:d.jsx(UD,{className:"h-4 w-4 opacity-50"})})]}));Iu.displayName=qT.displayName;const ku=C.forwardRef(({className:t,children:e,position:n="popper",...r},o)=>d.jsx(ZB,{children:d.jsx(YT,{ref:o,className:ze("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:d.jsx(e3,{className:ze("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));ku.displayName=YT.displayName;const r3=C.forwardRef(({className:t,...e},n)=>d.jsx(JT,{ref:n,className:ze("px-2 py-1.5 text-sm font-semibold",t),...e}));r3.displayName=JT.displayName;const ea=C.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(QT,{ref:r,className:ze("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(n3,{children:d.jsx($x,{className:"h-4 w-4"})})}),d.jsx(t3,{children:e})]}));ea.displayName=QT.displayName;const o3=C.forwardRef(({className:t,...e},n)=>d.jsx(XT,{ref:n,className:ze("-mx-1 my-1 h-px bg-muted",t),...e}));o3.displayName=XT.displayName;const km=[{value:"VIEW_DOCUMENT",label:"Chỉ xem"},{value:"EDIT_DOCUMENT",label:"Chỉnh sửa"},{value:"DOWNLOAD_DOCUMENT",label:"Tải xuống"}];function i3({onClose:t,open:e,file:n,apiBaseUrl:r,rootUrlHostApi:o}){const[a,s]=M.useState("users"),[l,u]=M.useState(""),[h,p]=M.useState(""),[g,w]=M.useState(""),[y,x]=M.useState(""),[v,b]=M.useState(zr.VIEW_DOCUMENT),[E,T]=M.useState([]),{users:N,groups:P,sharedUsers:_,sharedGroups:D,fetchData:H,loading:K,postGranted:ee,loadingGrandted:W,setSharedGroups:de,setSharedUsers:se}=$H(r,o),fe=Wi(),q=n?n.key:"",Z=N.filter(z=>{var ce;return(fe==null?void 0:fe.id)!==z.id&&(z.username.toLowerCase().includes(l.toLowerCase())||((ce=z.email)==null?void 0:ce.toLowerCase().includes(l.toLowerCase())))}),Y=P.filter(z=>z.groupname.toLowerCase().includes(h.toLowerCase())),oe=_.filter(z=>{var ce,Ae;return((ce=z.username)==null?void 0:ce.toLowerCase().includes(g.toLowerCase()))||((Ae=z.email)==null?void 0:Ae.toLowerCase().includes(g.toLowerCase()))}),Q=D.filter(z=>{var ce;return(ce=z.groupname)==null?void 0:ce.toLowerCase().includes(y.toLowerCase())}),X=z=>{b(z),T(ce=>ce.map(Ae=>({...Ae,permissions:z})))},$=()=>{a==="users"?(u(""),w("")):(p(""),x(""),s("users")),T([]),b(zr.VIEW_DOCUMENT)};M.useEffect(()=>{e?H(q):$()},[e,q]);const te=z=>{z!==a&&(a==="users"?(u(""),w("")):(p(""),x(""))),s(z)},_e=z=>{n&&T(ce=>{if(ce.find(ne=>ne.userId===z))return ce.filter(ne=>ne.userId!==z);const Ne={path:n.key+n.name,permissions:v,userId:z,grandtedBy:fe==null?void 0:fe.id};return[...ce,Ne]})},ke=z=>{if(!n)return;const ce=z.groupname;T(Ae=>{if(Ae.find(Ve=>Ve.groupname===ce))return Ae.filter(Ve=>Ve.groupname!==ce);const ne={path:n.key+n.name,permissions:v,groupname:ce,groupId:z.id,grandtedBy:fe==null?void 0:fe.id,users:z.users};return[...Ae,ne]})},xe=async(z,ce,Ae)=>{const Ce={...z,permissions:ce};T(Ne=>{const ne=Ne.map(Qe=>Qe.id===Ce.id?Ce:Qe);return Ne.some(Qe=>Qe.id===Ce.id)||ne.push(Ce),ne}),Ae==="users"?se(Ne=>Ne.map(ne=>ne.id===z.id?Ce:ne)):de(Ne=>Ne.map(ne=>ne.id===z.id?Ce:ne))},Pe=async()=>{if(n){const z=(n==null?void 0:n.key)||""+(n==null?void 0:n.name),ce=await ee(z,fe==null?void 0:fe.id,E);(ce==null?void 0:ce.status)==200&&T([])}},Te="flex-1 min-h-0 overflow-y-auto border rounded-lg px-3 py-2 bg-background shadow-sm";return n?d.jsx(lr,{open:e,onOpenChange:t,children:d.jsxs(Vn,{className:"max-w-5xl h-[80vh] flex flex-col overflow-hidden",children:[d.jsx(Kn,{children:d.jsxs(Gn,{className:"text-lg font-semibold",children:["Chia sẻ tài liệu: ",n.name]})}),d.jsxs(_g,{defaultValue:"users",className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs(ru,{className:"grid grid-cols-2 w-1/2 mx-auto mb-4 bg-muted rounded-lg",children:[d.jsx(qi,{value:"users",className:"py-2",onClick:()=>te("users"),children:"Người dùng"}),d.jsx(qi,{value:"groups",className:"py-2",onClick:()=>te("groups"),children:"Nhóm"})]}),d.jsx(Yi,{value:"users",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với người dùng:"}),d.jsx(jn,{placeholder:"Tìm người dùng...",className:"mb-3 border-input bg-background shadow-sm",value:l,onChange:z=>u(z.target.value)}),d.jsx("div",{className:Te,children:K?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Et,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):Z.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy người dùng."}):d.jsx("ul",{className:"space-y-2",children:Z.map(z=>d.jsx("li",{onClick:()=>_e(z.id),className:"flex flex-col space-y-1 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsx(dc,{id:`user-${z.id}`,checked:!!E.find(ce=>ce.userId===z.id)}),d.jsxs(wr,{className:"flex-1",children:[d.jsx("p",{className:"font-medium",children:z.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.groupname})]})]})},z.id))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với người dùng:"}),d.jsx(jn,{placeholder:"Tìm người dùng đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:g,onChange:z=>w(z.target.value)}),d.jsx("div",{className:Te,children:K?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Et,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):oe.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với người dùng nào."}):d.jsx("ul",{className:"space-y-2",children:oe.map(z=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:z.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.groupname})]}),d.jsxs(Am,{value:z.permissions,onValueChange:ce=>xe(z,ce,"users"),disabled:z.permissions===zr.OWNER_DOCUMENT,children:[d.jsx(Iu,{className:"w-[120px]",children:d.jsx(Im,{placeholder:"Chọn quyền"})}),d.jsxs(ku,{children:[km.map(ce=>d.jsx(ea,{value:ce.value,children:ce.label},ce.value)),z.permissions===zr.OWNER_DOCUMENT&&d.jsx(ea,{value:zr.OWNER_DOCUMENT,children:"Chủ sở hữu"},zr.OWNER_DOCUMENT),d.jsx(ea,{value:"None",children:"Thu hồi"},"None")]})]})]},z.id))})})]})]})}),d.jsx(Yi,{value:"groups",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với nhóm:"}),d.jsx(jn,{placeholder:"Tìm nhóm...",className:"mb-3 border-input bg-background shadow-sm",value:h,onChange:z=>p(z.target.value)}),d.jsx("div",{className:Te,children:K?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Et,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):Y.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy nhóm."}):d.jsx("ul",{className:"space-y-2",children:Y.map(z=>d.jsxs("li",{onClick:()=>ke(z),className:"flex items-center space-x-3 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsx(dc,{id:`group-${z.groupname}`,checked:!!E.find(ce=>ce.groupname===z.groupname)}),d.jsxs(wr,{className:"font-medium",children:[d.jsx("p",{className:"font-medium",children:z.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",z.users||0]})]})]},z.groupname))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với nhóm:"}),d.jsx(jn,{placeholder:"Tìm nhóm đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:y,onChange:z=>x(z.target.value)}),d.jsx("div",{className:Te,children:K?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Et,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):Q.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với nhóm nào."}):d.jsx("ul",{className:"space-y-2",children:Q.map(z=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:z.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",z.users||0]})]}),d.jsxs(Am,{value:z.permissions,onValueChange:ce=>xe(z,ce,"groups"),children:[d.jsx(Iu,{className:"w-[120px]",children:d.jsx(Im,{placeholder:"Chọn quyền"})}),d.jsxs(ku,{children:[km.map(ce=>d.jsx(ea,{value:ce.value,children:ce.label},ce.value)),d.jsx(ea,{value:"None",children:"Thu hồi"},"None")]})]})]},z.groupname))})})]})]})})]}),d.jsxs("div",{className:"mt-4 bg-muted/50 p-4 rounded-lg",children:[d.jsx(wr,{className:"font-medium mb-2 block",children:"Phân quyền:"}),d.jsxs(Am,{value:v,onValueChange:X,children:[d.jsx(Iu,{className:"w-1/2 border border-input bg-background shadow-sm hover:bg-accent",children:d.jsx(Im,{placeholder:"Chọn quyền truy cập"})}),d.jsx(ku,{children:km.map(z=>d.jsx(ea,{value:z.value,className:"flex items-center gap-2",children:z.label}))})]})]}),d.jsxs(Fr,{children:[d.jsx(He,{variant:"outline",onClick:t,children:"Huỷ"}),d.jsx(He,{variant:"default",onClick:Pe,disabled:E.length===0||W,className:"w-[120px] justify-center",children:W?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):"Lưu thay đổi"})]})]})}):null}const a3={},s3="AIzaSyBI8KiTWudkw8iR5cjH7ZsA4JBN1NqJw8A",c3="726815747852-5deq413t8kd8j3mgj48d46eatjauapq5.apps.googleusercontent.com",l3="https://www.googleapis.com/auth/drive";Lo(Le,{retries:3,shouldResetTimeout:!0,retryCondition:t=>Lo.isRetryableError(t)&&t.config.method==="get"});const fr={current:!1},ZT="crawl:jobs",is="crawl:current_job",d3=t=>{const[e,n]=M.useState(null),[r,o]=M.useState(0);return M.useEffect(()=>{const a=localStorage.getItem(is);if(a){const s=JSON.parse(a);n(s),s!=null&&s.startTime&&o(Math.floor((Date.now()-s.startTime)/1e3))}},[]),M.useEffect(()=>{if(!(e!=null&&e.startTime))return;const a=setInterval(()=>{o(Math.floor((Date.now()-e.startTime)/1e3))},1e3);return()=>clearInterval(a)},[e==null?void 0:e.startTime]),M.useEffect(()=>{if(!(e!=null&&e.id))return;const a=async()=>{try{const u=(await Le.get(`${t}/api/crawl/${e.id}?taskId=${e.taskId}`)).data;n(h=>{if(!h)return null;const p={...h,status:u};return localStorage.setItem(is,JSON.stringify(p)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(is)},100),p})}catch(l){console.error("Error polling job status:",l)}},s=setInterval(a,3e3);return a(),()=>clearInterval(s)},[e==null?void 0:e.id,t]),{currentJob:e,elapsedTime:r,setCurrentJob:a=>{a&&!a.startTime&&(a.startTime=Date.now()),n(a),a?localStorage.setItem(is,JSON.stringify(a)):localStorage.removeItem(is)}}},Nu=(t,e)=>{const n=[],r=o=>{(t[o]||[]).forEach(s=>{n.push(s.key),s.isFolder&&r(s.key)})};return r(e),n},u3=(t,e)=>{const n=[];return(t[e]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Nu(t,o.key))}),n},f3=(t,e,n=[],r,o,a,s,l,u,h)=>{const[p,g]=M.useState({}),[w,y]=M.useState(!1),[x,v]=M.useState(null),[b,E]=M.useState(0),T=M.useRef(e);M.useEffect(()=>{T.current=e},[e]);const N=async()=>{var _;y(!0);try{const D=Wi(),H=await Le.get(`${t}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:T.current,userId:(D==null?void 0:D.id)||"",groupId:((_=D==null?void 0:D.group)==null?void 0:_.id)||"",groupname:(D==null?void 0:D.groupname)||""},timeout:3e5}),K=[];Bd.forEach(H.data,(ee,W)=>{l!=null&&l.has(W)&&Bd.forEach(ee,de=>{(u==null?void 0:u.current[de.key])!==!1&&K.push(de.key)})}),K.length&&(h==null||h(ee=>{const W=new Set(ee);return K.forEach(de=>W.add(de)),W})),g(H.data),v(null)}catch(D){v(D instanceof Error?D:new Error("Failed to fetch files"))}finally{y(!1),E(0),a("")}},P=async _=>{var D,H;try{if(!_)return;y(!0);const K=await Le.get(`${t}/api/search-db?query=${_}&rootPrefix=${e}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return g({[e]:((D=K==null?void 0:K.data)==null?void 0:D.result)||[]}),E(((H=K==null?void 0:K.data)==null?void 0:H.estimatedTotalHits)||0),K}catch(K){v(K instanceof Error?K:new Error("Failed to fetch files"))}finally{y(!1)}};return M.useEffect(()=>{!r&&!w&&N(),r&&!w&&P(r)},[r,o]),{data:p,isLoading:w,error:x,estimatedTotalHits:b,refetch:N}},ta=t=>{var r,o,a;const e=((a=(o=(r=t==null?void 0:t.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:a.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(e||"")},h3={auth:{clientId:"584d5fa9-5123-4602-a1a5-a3746a83745f",authority:"https://login.microsoftonline.com/consumers",redirectUri:a3.VITE_ONE_DRIVE_REDIRECT_URI||"https://s3-explorer.cmcts1.studio.ai.vn/sharepoint/redirect"}},p3=new hp(h3),Nm={[zr.VIEW_DOCUMENT]:1,[zr.DOWNLOAD_DOCUMENT]:2,[zr.EDIT_DOCUMENT]:10,[zr.OWNER_DOCUMENT]:100},na=t=>{const e=Wi();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Nm[t]>=10:!1},g3=t=>{const e=Wi();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Nm[t]>=2:!1},m3=t=>{const e=Wi();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Nm[t]>=1:!1},v3=M.memo(({homeLabel:t="Kho tài liệu",apiBaseUrl:e="http://localhost:3000",rootPrefix:n="",rootUrlHostApi:r="http://localhost:3003/api/v1",asSelector:o=!1,onSelected:a=h=>console.log("Đã chọn:",h),displayPrefixes:s,preSelectedFiles:l,idCreator:u})=>{var Ii;const[h,p]=M.useState([]),[g,w]=M.useState(""),[y,x]=M.useState(new Set(l)),[v,b]=M.useState(n),[E,T]=M.useState(""),[N,P]=M.useState(!1),[_,D]=M.useState(""),[H,K]=M.useState(!1),[ee,W]=M.useState(null),[de,se]=M.useState(null),[fe,q]=M.useState(!1),[Z,Y]=M.useState(!1),[,oe]=M.useState(null),Q=M.useRef(null),{toast:X}=mc(),[$,te]=M.useState(null),[_e,ke]=M.useState(null),[xe,Pe]=M.useState(null),[Te,z]=M.useState(""),[ce,Ae]=M.useState(!1),[Ce,Ne]=M.useState(!1),[ne,Ve]=M.useState(new Set),[Qe,Ct]=M.useState(""),[Yt,bt]=M.useState(!1),[rn,zt]=M.useState(!1),[Dn,Kt]=M.useState("rename"),[L,J]=M.useState(!1),[U,ae]=M.useState(""),[ye,he]=M.useState("1"),[Ee,Xe]=M.useState(!1),[ft,xt]=M.useState(!1),[bo,Jt]=M.useState(!1),[vn,jr]=M.useState(!1),[Gt,hr]=M.useState(1),[Wr,oa]=M.useState(!1),{currentJob:Je,elapsedTime:zo,setCurrentJob:Nc}=d3(e),[xo,ia]=M.useState(null),[aa,ss]=M.useState(""),[Lu,sa]=M.useState(!1),[cs,Fu]=M.useState(""),[Pc,$u]=M.useState(!1),[Oc,Hu]=M.useState(!1),[ls,Uu]=M.useState([]),[ca,Bu]=M.useState(!1),[ds,Fm]=M.useState(""),Vo=M.useRef({}),[Mc,Rc]=M.useState(null),$m=async A=>{Hu(!0);try{const O=await Le.get(`${r}get-knowledge-base/knowledge-base-name/${A}`,{headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjAyOTliMmIwLTk4MGEtNGQ1Yy04NjkyLWJjNjllM2I1NzZlMiIsInVzZXJuYW1lIjoiY21jX3RzX2FkbWluIiwiaWF0IjoxNzQ3MTk0MTg3fQ.7LB2rgd0fQnhZP_cFgTTCPMSYl0_apwffcNEd7oqjeM"}});O.status===200&&Uu(O.data.knowledgeBase.chatflows.map(G=>({...G,KnowledgeBaseId:O.data.knowledgeBase.knowledge_base_id})))}catch{}finally{Hu(!1)}};M.useEffect(()=>{cs&&r&&$m(cs)},[cs]),M.useEffect(()=>{console.log("pre selected files",l)},[l]);const[Pt,Dc]=M.useState(null),[x0,Hm]=M.useState(!1),[Lc,Fc]=M.useState(!1),[la,us]=M.useState(!1),[zu,Vu]=M.useState([]),[$c,Hc]=M.useState([]),[da,Uc]=M.useState([{id:"root",name:"OneDrive"}]),[Um,fs]=M.useState(!1),[hs,Bc]=M.useState([]),[Ku,Ko]=M.useState(!1),[ps,zc]=M.useState([]),[Vc,gs]=M.useState([]),[ms,Gu]=M.useState([]),[Kc,ua]=M.useState([{id:"root",name:"SharePoint"}]),[So,fa]=M.useState(!1),[Gc,jc]=M.useState([]),[gt,qr]=M.useState(null),[ju,vs]=M.useState(!1),[Bm,ha]=M.useState(!1),[Go,Wc]=M.useState(!1),Vm=new URL(window.location.href).searchParams.get("prefix")||""||E||n,[_0,Wu]=M.useState(null),{data:En,isLoading:ys,error:Km,estimatedTotalHits:pa,refetch:an}=f3(e,Vm,s,g,Gt,w,u,y,Vo,x),[qc,_o]=M.useState(!1),Yc=M.useRef(null),Jc=Wi(),Ht=(()=>{const A=localStorage.getItem("dataLogin");try{if(A){const O=JSON.parse(A);return(O==null?void 0:O.user)??null}}catch{return null}return null})();M.useEffect(()=>{if(!qc)return;function A(O){Yc.current&&!Yc.current.contains(O.target)&&_o(!1)}return document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}},[qc]);const Ot=async()=>{try{const A=await Le.get(`${e}/api/login-sharepoint`),{loginUrl:O}=A.data,G=window.open(O,"SharePoint Login","width=600,height=600");if(!G)throw new Error("Không thể mở cửa sổ pop-up");G.focus();const pe=setInterval(()=>{try{if(G.closed){clearInterval(pe);return}const be=G.location.href;if(be.includes("code=")){const Ie=new URL(be).searchParams.get("code");Ie&&(qu(Ie),G.close(),clearInterval(pe))}}catch(be){be instanceof Error&&!be.message.includes("cross-origin")&&console.error("SharePoint login error:",be)}},1e3)}catch(A){st.error("Lỗi khi đăng nhập SharePoint: "+(A instanceof Error?A.message:"Lỗi không xác định"))}},It=async()=>{try{zc([]),ua([{id:"root",name:"SharePoint"}]),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin),X({title:"Success",description:"Logged out from SharePoint"})}catch(A){console.error("Error logging out from SharePoint:",A),X({title:"Error",description:"Failed to logout from SharePoint",variant:"destructive"})}},qu=async A=>{try{const O=await Le.post(`${e}/api/get-sharepoint-access-token`,{code:A,userId:"1"}),{accessToken:G,refreshToken:pe}=O.data;localStorage.setItem("sharepoint_access_token",G),localStorage.setItem("refresh_sharepoint_access_token",pe),Fc(!0),fa(!0)}catch(O){console.error("❌ Error fetching SharePoint access token:",O),X({title:"Error",description:"Failed to connect to SharePoint",variant:"destructive"})}},Gm=async()=>{try{Ko(!0);const O=(await Le.post(`${e}/api/list-site-sharepoint`,{userId:"1"})).data.sites.map(G=>{const pe=new URL(G.webUrl);return{id:G.id,name:G.name,description:G.description,hostname:G.hostname||pe.hostname,sitePath:G.sitePath||pe.pathname.replace(/^\/+/,"")}});console.log("data",O),jc(O),Ko(!1)}catch(A){console.error("❌ Error fetching SharePoint sites:",A),X({title:"Error",description:"Failed to fetch SharePoint sites",variant:"destructive"}),Ko(!1)}},jm=async A=>{qr(A),console.log(A),await ws("root",A.name,A.hostname||"",A.sitePath||"")},ws=async(A,O,G,pe)=>{try{Ko(!0);const Ie=(await Le.post(`${e}/api/list-file-sharepoint`,{folderId:A,userId:"1",hostname:G,sitePath:pe})).data.files.map(Me=>({id:Me.id,name:Me.name,size:Me.size??0,lastModified:Me.lastModifiedDateTime?new Date(Me.lastModifiedDateTime):new Date,contentType:Me.mimeType??void 0,isFolder:Me.type==="folder",parentId:Me.parentId??""}));gs(Ie.filter(Me=>Me.isFolder)),zc(Ie.filter(Me=>!Me.isFolder)),fa(!0),ua(Me=>Me.some(Mt=>Mt.id===A)?Me:[...Me,{id:A,name:O==="root"?"SharePoint":O}]),Ko(!1)}catch(be){console.error("❌ Error fetching SharePoint files:",be),X({title:"Error",description:"Failed to fetch SharePoint files",variant:"destructive"}),Ko(!1)}},Wm=A=>{Gu(O=>O.some(pe=>pe.id===A.id)?O.filter(pe=>pe.id!==A.id):[...O,{id:A.id,name:A.name,size:A.size,lastModified:A.lastModified,contentType:A.contentType,isFolder:A.isFolder,parentId:A.parentId}])},qm=A=>{var G;ua(pe=>pe.slice(0,A+1));const O=(G=Kc[A])==null?void 0:G.id;O&&ws(O,"SharePoint",(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")},Yu=async(A,O)=>{const G=localStorage.getItem("sharepoint_access_token");if(!G){st.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const pe=st.loading("Đang đồng bộ SharePoint...",{position:"bottom-right",autoClose:!1});try{const be={prefix:O,folders:[],files:[],hostname:(gt==null?void 0:gt.hostname)||"",sitePath:(gt==null?void 0:gt.sitePath)||"",isAutoUpdateKB:Go,refreshAccessToken:localStorage.getItem("refresh_sharepoint_access_token")||""};A.forEach(Me=>{Me.isFolder?be.folders.push({id:Me.id,name:Me.name}):be.files.push({id:Me.id,name:Me.name})});const Ie=await Le.post(`${e}/api/sync-sharepoint-to-s3`,be,{headers:{Authorization:`Bearer ${G}`}});an(),st.update(pe,{render:`Đồng bộ thành công! Đã tải lên ${Ie.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"}),fa(!1)}catch(be){console.error("Lỗi khi đồng bộ file từ SharePoint:",be),st.update(pe,{render:"Không thể đồng bộ file từ SharePoint.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},Ju=()=>{fa(!1),zc([]),Gu([]),ua([{id:"root",name:"SharePoint"}])};M.useEffect(()=>{if(So){const O=new URLSearchParams(window.location.search).get("code");O&&(qu(O),window.history.replaceState({},document.title,window.location.pathname))}},[So]),M.useEffect(()=>{p3.initialize().then(()=>{Hm(!0)}).catch(A=>console.error("❌ Lỗi khởi tạo MSAL:",A))},[]),M.useEffect(()=>{sn()},[]);async function sn(){localStorage.getItem("onedrive_access_token")&&Fc(!0)}const Cs=A=>{Bc(O=>O.some(pe=>pe.id===A.id)?O.filter(pe=>pe.id!==A.id):[...O,{id:A.id,name:A.name,size:A.size,lastModified:A.lastModified,contentType:A.contentType,isFolder:A.isFolder,parentId:A.parentId}])};function Yr(A){if(A===0)return"0 B";const O=1024,G=["B","KB","MB","GB","TB"],pe=Math.floor(Math.log(A)/Math.log(O));return parseFloat((A/Math.pow(O,pe)).toFixed(1))+" "+G[pe]}function Qu(A){const O=new Date(A);return O.toLocaleDateString()+" "+O.toLocaleTimeString()}const Qc=async()=>{try{const A=await Le.get(`${e}/api/login-one-drive`),{loginUrl:O}=A.data,G=window.open(O,"OneDrive Login","width=600,height=600");if(!G)throw new Error("Không thể mở cửa sổ pop-up");G.focus();const pe=setInterval(()=>{try{if(G.closed){clearInterval(pe);return}const be=G.location.href;if(be.includes("code=")){const Ie=new URL(be).searchParams.get("code");Ie&&(Xu(Ie),G.close(),clearInterval(pe))}}catch(be){be instanceof Error&&!be.message.includes("cross-origin")&&console.error("OneDrive login error:",be)}},1e3)}catch(A){st.error("Lỗi khi đăng nhập OneDrive: "+(A instanceof Error?A.message:"Lỗi không xác định"))}},Qn=async()=>{try{await Le.post(`${e}/api/logout-one-drive`),localStorage.removeItem("onedrive_access_token"),st.success("Đã đăng xuất khỏi OneDrive"),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin)}catch(A){st.error("Lỗi khi đăng xuất OneDrive: "+(A instanceof Error?A.message:"Lỗi không xác định"))}},Xu=async A=>{try{const G=await Le.post(`${e}/api/get-one-drive-access-token`,{authorizationCode:A,userId:"1"}),{accessToken:pe}=G.data;localStorage.setItem("onedrive_access_token",pe),Fc(!0),us(!0),await ga("root","One Drive")}catch(O){console.error("❌ Lỗi khi lấy Access Token:",O)}},ga=async(A,O)=>{try{fs(!0);const be=(await Le.post(`${e}/api/list-file-one-drive`,{folderId:A,userId:"1"})).data.map(Ie=>({id:Ie.id,name:Ie.name,size:Ie.size??0,lastModified:Ie.lastModifiedDateTime?new Date(Ie.lastModifiedDateTime):new Date,contentType:Ie.mimeType??void 0,isFolder:Ie.type==="folder",parentId:Ie.parentId??""}));Vu(be.filter(Ie=>Ie.isFolder)),Hc(be.filter(Ie=>!Ie.isFolder)),us(!0),Uc(Ie=>Ie.some(Me=>Me.id===A)?Ie:[...Ie,{id:A,name:O==="root"?"OneDrive":O}]),fs(!1)}catch(G){console.error("Lỗi lấy danh sách file:",G),fs(!1)}},Zu=A=>{if(A===da.length-1)return;const O=da[A];O&&(Uc(da.slice(0,A+1)),ga(O.id,O.name))},ef=async(A,O)=>{const G=localStorage.getItem("onedrive_access_token");if(!G){st.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const pe=st.loading("Đang đồng bộ OneDrive...",{position:"bottom-right",autoClose:!1});try{const be={prefix:O,folders:[],files:[]};A.forEach(Me=>{Me.isFolder?be.folders.push({id:Me.id,name:Me.name}):be.files.push({id:Me.id,name:Me.name})});const Ie=await Le.post(`${e}/api/sync-one-drive-to-s3`,be,{headers:{Authorization:`Bearer ${G}`}});an(),st.update(pe,{render:`Đồng bộ thành công! Đã tải lên ${Ie.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(be){console.error("Lỗi khi đồng bộ file từ OneDrive:",be),st.update(pe,{render:"Không thể đồng bộ file từ OneDrive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},Xc=()=>{us(!1),Uc([{id:"root",name:"OneDrive"}]),Vu([]),Hc([]),Bc([]),fs(!1)},tf=pM({onSuccess:A=>{Wu(A.access_token),localStorage.setItem("google_access_token",A.access_token),Ln(A.access_token)},onError:()=>{console.log("Đăng nhập thất bại!")},scope:l3}),Ln=A=>{const O=document.createElement("script");O.src="https://apis.google.com/js/api.js",O.onload=()=>{window.gapi.load("picker",()=>Ym(A))},document.body.appendChild(O)},Ym=A=>{const O=new window.google.picker.DocsView(window.google.picker.ViewId.DOCS).setIncludeFolders(!0).setSelectFolderEnabled(!0).setOwnedByMe(!1),G=new window.google.picker.DocsView(window.google.picker.ViewId.DRIVE).setIncludeFolders(!0).setSelectFolderEnabled(!0);new window.google.picker.PickerBuilder().setDeveloperKey(s3).setOAuthToken(A).enableFeature(window.google.picker.Feature.MULTISELECT_ENABLED).setLocale("vi").addView(O).addView(G).setCallback(async be=>{if(be.action===window.google.picker.Action.PICKED){const Ie=be.docs.map(Me=>({id:Me.id,name:Me.name,mimeType:Me.mimeType}));await Xn(Ie,v)}}).build().setVisible(!0)},Xn=async(A,O="")=>{const G=localStorage.getItem("google_access_token");if(!G){console.error("❌ Không tìm thấy access token. Vui lòng đăng nhập lại."),st.error("Không tìm thấy access token. Vui lòng đăng nhập lại.",{position:"bottom-right"});return}const pe=st.loading("Đang đồng bộ...",{position:"bottom-right",autoClose:!1});try{const be={prefix:O,folders:[],files:[]};A.forEach(Me=>{Me.mimeType==="application/vnd.google-apps.folder"?be.folders.push({id:Me.id,name:Me.name}):be.files.push({id:Me.id,name:Me.name})});const Ie=await Le.post(`${e}/api/sync-drive-to-s3`,be,{headers:{Authorization:`Bearer ${G}`}});fr.current=!0,an(),st.update(pe,{render:`Đồng bộ thành công! Đã tải lên ${Ie.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(be){console.error("❌ Lỗi khi đồng bộ file từ Google Drive:",be),st.update(pe,{render:"Không thể đồng bộ file từ Google Drive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}};M.useEffect(()=>{const A=O=>{if(O.data.action==="logout"){const G=document.createElement("iframe");G.style.display="none",G.src="https://accounts.google.com/Logout",document.body.appendChild(G),setTimeout(()=>document.body.removeChild(G),2e3)}};return window.addEventListener("message",A),()=>window.removeEventListener("message",A)},[]),M.useEffect(()=>{const A=new Set(l);x(A)},[]),M.useEffect(()=>{Je!=null&&Je.status&&(Je.status.status==="completed"?(X({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${Je.url} với ${Je.status.completed} trang`}),fr.current=!0,an()):Je.status.status==="failed"&&X({title:"Thu thập website thất bại",description:`Không thể thu thập ${Je.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Ii=Je==null?void 0:Je.status)==null?void 0:Ii.status]);const nf=M.useMemo(()=>En[v]||[],[En,v]),Jr=M.useMemo(()=>nf.filter(A=>m3(A.permission)),[nf,v,En]),Zn=M.useMemo(()=>{const A={};return Jr.forEach((O,G)=>{y.has(O.key)&&(A[G]=!0)}),A},[y,Jr]),bs=A=>{const O=Nu(En,A);if(O.length===0)return y.has(A)?"all":"none";const G=O.filter(pe=>y.has(pe)).length;return G===0?"none":G===O.length?"all":"partial"},Qr=(A,O=!0)=>{if(v!==A){if(u&&!v)oa(!0),T(A+u),b(A+u);else if(oa(!0),T(A),b(A),O&&!o){const G=window.location.pathname==="/"?"":window.location.pathname,pe=A?`${window.location.origin}${G}?prefix=${encodeURIComponent(A)}`:`${window.location.origin}${G}`;window.history.pushState({path:pe},"",pe)}}},Lt=A=>{const O=A.lastIndexOf("/"),G=O>0?A.substring(0,O+1):"";G?(Qr(G),setTimeout(()=>{x(new Set([A]))},500)):x(new Set([A]))};M.useEffect(()=>{Wr&&(fr.current=!0,an().finally(()=>oa(!1)))},[Wr]);const Eo=async(A,O)=>{var G,pe;K(!0);try{if(Jr.some(Mt=>Mt.isFolder&&Mt.name.toLowerCase()===A.toLowerCase())){X({title:"Lỗi",description:`Thư mục "${A}" đã tồn tại trong thư mục hiện tại.`,variant:"destructive"}),K(!1);return}const Ie=`${O}${A}/`;if((await Le.post(`${e}/api/create-folder`,{prefix:Ie,userId:(Jc==null?void 0:Jc.id)||""})).status!==200){X({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}fr.current=!0,await an(),X({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${A}"`}),D(""),P(!1)}catch(be){console.error("Error creating folder:",be);const Ie=((pe=(G=be==null?void 0:be.response)==null?void 0:G.data)==null?void 0:pe.error)||"Không thể tạo thư mục";X({title:"Lỗi",description:Ie,variant:"destructive"})}finally{K(!1)}},ma=async(A,O,G)=>{var pe,be,Ie,Me,Mt,Zr,ya,Ts,il;oe(G),Jt(!0);try{if(Array.from(A).reduce((Tn,Cr)=>Tn+Cr.size,0)>=100*1024*1024){X({title:"Lỗi",description:"Tổng kích thước các tập tin vượt quá 100 MB",variant:"destructive"}),oe(null),Jt(!1);return}const Wo=Array.from(A).filter(Tn=>Tn.size===0);if(Wo.length>0){const Tn=Wo.map(Cr=>Cr.name).join(", ");X({title:"Lỗi tải lên",description:`Không thể tải lên tập tin rỗng: ${Tn}`,variant:"destructive"}),Jt(!1),oe(null);return}const qo=new FormData;if(Ht!=null&&Ht.id&&qo.append("metadata",JSON.stringify({creator:Ht.username,creatorId:Ht.id,DataSource:"Tệp tải lên"})),G==="folder"&&A[0]){const Tn=A[0].webkitRelativePath.split("/")[0];Tn&&qo.append("folderName",Tn)}qo.append("prefix",O),Array.from(A).forEach(Tn=>G==="folder"?qo.append("files",Tn,Tn.webkitRelativePath):qo.append("files",Tn)),fr.current=!0;const Qt=await Le.post(`${e}/api/check-files-existed`,qo,{headers:{"Content-Type":"multipart/form-data"}});if(((pe=Qt==null?void 0:Qt.data)==null?void 0:pe.status)===200)await Le.post(`${e}/api/upload`,qo,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),w(""),T(O),setTimeout(async()=>{oe(null),await an(),Jt(!1),await jo("upload")},500);else{if(((Ie=(be=Qt==null?void 0:Qt.data)==null?void 0:be.names)==null?void 0:Ie.length)>0&&!((Me=Qt==null?void 0:Qt.data)!=null&&Me.isFolder)){const Tn=Array.from(A).filter(Cr=>Qt.data.names.includes(Cr.name));ia(Tn),sa(!0)}(Mt=Qt==null?void 0:Qt.data)!=null&&Mt.isFolder&&((Zr=Qt==null?void 0:Qt.data)!=null&&Zr.name)&&(ss((ya=Qt==null?void 0:Qt.data)==null?void 0:ya.name),ia(A),sa(!0))}}catch(er){console.error("Lỗi tải lên:",er);const Wo=((il=(Ts=er==null?void 0:er.response)==null?void 0:Ts.data)==null?void 0:il.error)||"Không thể tải lên tập tin";X({title:"Lỗi",description:Wo,variant:"destructive"}),oe(null),Jt(!1)}},Jm=async()=>{var A,O;try{Jt(!0);const G=new FormData;if(xo){oe(aa?"folder":"files"),sa(!1);let pe=localStorage.getItem("dataLogin"),be;try{pe&&(pe=JSON.parse(pe),be=pe.user)}catch{pe=null}if(aa&&xo[0]){const Ie=xo[0].webkitRelativePath.split("/")[0];Ie&&G.append("folderName",Ie)}G.append("prefix",v),Array.from(xo).forEach(Ie=>aa&&xo[0]?G.append("files",Ie,Ie.webkitRelativePath):G.append("files",Ie)),be!=null&&be.id&&G.append("metadata",JSON.stringify({creator:be.username,creatorId:be.id,DataSource:"Tệp tải lên"})),await Le.post(`${e}/api/upload`,G,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),w(""),T(v),fr.current=!0}}catch(G){console.error("Lỗi tải lên:",G);const pe=((O=(A=G==null?void 0:G.response)==null?void 0:A.data)==null?void 0:O.error)||"Không thể tải lên tập tin";X({title:"Lỗi",description:pe,variant:"destructive"})}finally{setTimeout(async()=>{oe(null),await an(),Jt(!1),ss(""),ia(null),await jo("overwrite")},500)}},xs=async A=>{var O;try{if(await Le.delete(`${e}/api/files`,{data:{paths:[A.key]}}),y.has(A.key)){const pe=new Set(y);pe.delete(A.key),x(pe)}const G=((O=A.key)==null?void 0:O.replace(/^(.*?)(\/.*)?$/,(pe,be,Ie)=>!Ie||Ie==="/"?"":be+"/"))||"";T(G),fr.current=!0,X({title:"Đã xóa tập tin",description:`Đã xóa thành công "${A.name}"`}),W(null),await jo("delete")}catch(G){console.error("Error deleting file:",G),X({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{jr(!1),await an()}},Ss=A=>{const O=new Set(y),G=typeof A=="function"?A(Zn):A;new Set(Object.keys(Zn).map(Number)).forEach(be=>{const Ie=Jr[be];Ie&&(G[be]||(O.delete(Ie.key),Ie.isFolder&&Nu(En,Ie.key).forEach(Me=>O.delete(Me))))}),Object.entries(G).forEach(([be,Ie])=>{const Me=parseInt(be),Mt=Jr[Me];Mt&&Ie&&(O.add(Mt.key),Mt.isFolder&&Nu(En,Mt.key).forEach(Zr=>O.add(Zr)))}),x(O)},Qm=async()=>{var A;q(!0);try{const O=Array.from(y),G=O.map(be=>Object.values(En).flat().find(Ie=>Ie.key===be)).filter(be=>be!==void 0);if(G.length===0){X({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await Le.delete(`${e}/api/files`,{data:{paths:O}});const pe=((A=G[0])==null?void 0:A.key.replace(/^(.*?)(\/.*)?$/,(be,Ie,Me)=>!Me||Me==="/"?"":Ie+"/"))||"";T(pe),fr.current=!0,an(),X({title:"Đã xóa tập tin",description:`Đã xóa thành công ${G.length} mục`}),Y(!1),x(new Set),await jo("bulk-delete")}catch(O){console.error("Error deleting files:",O),X({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{q(!1)}},Xm=async(A,O)=>{if(!v.trim()){X({title:"Lỗi",description:"Không thể đổi tên tập tin hoặc thư mục ở thư mục gốc. Chỉ có thể xóa.",variant:"destructive"});return}Ne(!0);try{const G=A.key;let pe;A.isFolder?pe=G.split("/").slice(0,-2).join("/")+"/":pe=G.substring(0,G.lastIndexOf("/")+1);const be=pe+O+(A.isFolder?"/":"");await Le.post(`${e}/api/rename`,{oldPath:G,newPath:be}),fr.current=!0,await an(),X({title:"Đã đổi tên",description:`Đã đổi tên thành công "${A.name}" thành "${O}"`}),te(null),z(""),Pe(null),await jo("rename")}catch(G){console.error("Error renaming item:",G),X({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{Ne(!1)}},rf=async A=>{Ve(O=>new Set([...O,...A]));try{const O=await Le.post(`${e}/api/download`,{paths:A},{responseType:"blob"}),G=window.URL.createObjectURL(O.data),pe=document.createElement("a");pe.href=G;const be=O.headers["Content-Disposition"]||O.headers["content-disposition"],Ie=be==null?void 0:be.match(/filename="(.+)"/),Me=Ie?decodeURIComponent(Ie[1]):"download.zip";pe.setAttribute("download",Me),document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),window.URL.revokeObjectURL(G),X({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${A.length} mục${A.length>1,""}`})}catch(O){console.error("Error downloading files:",O),X({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Ve(O=>{const G=new Set(O);return A.forEach(pe=>G.delete(pe)),G})}},va=v?v.replace(n,"").split("/").filter(Boolean):[],Ai=()=>{let A=Array.from(y).map(G=>({key:G}));A.length>1&&(A=A.filter(G=>G.key!==n));const O=G=>Bd.findIndex(A,pe=>!pe.key.endsWith("/")&&pe.key.startsWith(G))!==-1;return A=A.filter(G=>G.key.endsWith("/")?!O(G.key):!0),A},of=M.useMemo(()=>{const A=[...(Ht==null?void 0:Ht.role)!=="MASTER_ADMIN"&&(Ht==null?void 0:Ht.role)!=="SITE_ADMIN"&&(v===""||v==="/")?[]:[{id:"select",header:()=>{const O=u3(En,v),G=O.length>0&&O.every(be=>y.has(be)),pe=O.some(be=>y.has(be));return d.jsx(dc,{checked:G?!0:pe?"indeterminate":!1,onCheckedChange:be=>{if(be){const Ie=Jr.reduce((Me,Mt,Zr)=>(Me[Zr]=!0,Me),{});Ss(Ie)}else{for(const Ie of Array.from(y))Ie.startsWith(v)&&(y.delete(Ie),Vo.current[Ie]=!1);Bd.forEach(Vo.current,(Ie,Me)=>{Me.startsWith(v)&&(Vo.current[Me]=!1)}),Ss({})}},"aria-label":"Chọn tất cả"})},cell:({row:O})=>{const G=O.original;let be=G.isFolder?bs(G.key):y.has(G.key)?"all":"none";if(be==="none"&&G.key.endsWith("/")){for(const Ie of Array.from(y))if(Ie.startsWith(G.key)){be="all";break}}return d.jsx("div",{className:"flex items-center",children:d.jsx(dc,{checked:be==="partial"?"indeterminate":be==="all",onCheckedChange:Ie=>{var Mt,Zr;const Me={...Zn};if(Ie?Me[O.index]=!0:delete Me[O.index],Vo.current[((Mt=O.original)==null?void 0:Mt.key)||"_"]=!!Ie,(Zr=O.original)!=null&&Zr.key.endsWith("/"))for(const ya of Array.from(y))ya.startsWith(O.original.key)&&(Vo.current[O.original.key]=!1,y.delete(ya));Ss(Me)},"aria-label":"Chọn dòng"})})},enableSorting:!1}],{id:"fileName",header:({column:O})=>d.jsxs(He,{variant:"ghost",onClick:()=>O.toggleSorting(O.getIsSorted()==="asc"),children:["Tên tập tin",d.jsx(sg,{})]}),accessorKey:"name",cell:({row:O})=>{const G=O.original,pe=G.key.substring(0,G.key.lastIndexOf("/"))||"/",be=g.trim()!==""&&pe!==v,Ie=pe.split("/").filter(Boolean);return d.jsxs("div",{className:"flex flex-col group",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsxs("div",{className:`flex items-center gap-2 ${G.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{G.isFolder&&Qr(G.key)},children:[G.isFolder?d.jsx(Js,{className:"h-5 w-5 text-blue-500"}):null,G.name]}),d.jsx("button",{className:"ml-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Me=>{Me.stopPropagation(),navigator.clipboard.writeText(G.key),X({title:"Copied to clipboard",description:`Path: ${G.key}`,duration:2e3})},title:"Copy path to clipboard",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),be&&d.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[d.jsx(Js,{className:"h-4 w-4 text-gray-500 my-auto"}),d.jsxs("span",{className:"flex items-center ml-1",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Qr("")},children:"/"}),Ie.map((Me,Mt)=>d.jsxs("span",{className:"flex items-center",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Qr(Ie.slice(0,Mt+1).join("/")+"/")},children:Me}),Mt<Ie.length-1&&d.jsx("span",{children:"/"})]},Mt))]})]})]})}}];return o||A.push({id:"size",header:({column:O})=>d.jsxs(He,{variant:"ghost",onClick:()=>O.toggleSorting(O.getIsSorted()==="asc"),children:["Kích thước",d.jsx(sg,{})]}),accessorKey:"size",cell:({getValue:O,row:G})=>{const pe=O();return d.jsx("span",{children:G.original.isFolder?"-":Yr(pe)})}},{id:"lastModified",header:({column:O})=>d.jsxs(He,{variant:"ghost",onClick:()=>O.toggleSorting(O.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Sửa đổi lần cuối",d.jsx(sg,{})]}),accessorKey:"lastModified",cell:({row:O})=>{const G=O.original.lastModified;return d.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:d.jsx("span",{children:G&&Lx(G).isValid()?Lx(G).format("DD/MM/YYYY HH:mm"):"-"})})},size:200},{id:"actions",header:()=>d.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:O})=>d.jsxs("div",{className:"flex items-center gap-2",children:[v===""&&r&&d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>{Fu(O.original.key),$u(!0)},className:"h-8 w-8 p-0",children:ne.has(O.original.key)?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):d.jsx(vO,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Những Flow sử dụng Folder này làm Data"})]})}),d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:!O.original.isFolder&&d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>rf([O.original.key]),className:"h-8 w-8 p-0",disabled:!g3(O.original.permission)||ne.has(O.original.key),children:ne.has(O.original.key)?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):d.jsx(hO,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Tải xuống"})]})}),v.trim()!==""&&(na(O.original.permission)?d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>{te(O.original),z(O.original.name)},className:"h-8 w-8 p-0",disabled:!na(O.original.permission),children:d.jsx(_O,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Đổi tên"})]})}):d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>{console.log("call"),ke(O.original)},className:"h-8 w-8 p-0",disabled:O.original.isFolder,children:d.jsx(Ux,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Xem"})]})})),d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>{Ae(!0),se(O.original)},className:"h-8 w-8 p-0",disabled:!na(O.original.permission),children:d.jsx(KD,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Di chuyển"})]})}),!((Ht==null?void 0:Ht.role)!=="MASTER_ADMIN"&&(Ht==null?void 0:Ht.role)!=="SITE_ADMIN"&&(v===""||v==="/"))&&d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>W(O.original),className:"h-8 w-8 p-0",disabled:!na(O.original.permission),children:d.jsx(DC,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Xóa"})]})}),d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>Rc(O.original),className:"h-8 w-8 p-0",disabled:!na(O.original.permission),children:d.jsx(RC,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Chia sẻ"})]})})]})}),A},[y,Jr,Zn,ne,o]),_s=jb({data:Jr,columns:of,state:{rowSelection:Zn,sorting:h},onSortingChange:p,enableRowSelection:!0,onRowSelectionChange:Ss,getCoreRowModel:Gb(),getSortedRowModel:qM()}),Zc=async A=>{var O,G;bt(!0);try{if(ta(A)){const pe=await Le.get(`${e}/api/read-text`,{params:{path:A.key}});Ct(pe.data.content)}try{const pe=await Le.get(`${e}/api/read-json`,{params:{path:A.key+".metadata.json"}}),be=((G=(O=pe==null?void 0:pe.data)==null?void 0:O.content)==null?void 0:G.metadataAttributes)||null;return Pe({fullPath:$==null?void 0:$.key,...be})}catch{return Pe("Lỗi phân tích siêu dữ liệu")}}catch(pe){console.error("Error loading file content:",pe),X({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{bt(!1)}},el=async(A,O)=>{zt(!0);try{await Le.post(`${e}/api/modify-text`,{path:A.key,content:O}),X({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),fr.current=!0,await an(),te(null),Ct(""),Kt("rename"),await jo("edit-content")}catch(G){console.error("Error saving file content:",G),X({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{zt(!1)}},tl=async A=>{zt(!0);try{await Le.post(`${e}/api/modify-json`,{path:A.key+".metadata.json",content:{metadataAttributes:xe}}),X({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),fr.current=!0,await an(),te(null),Ct(""),Kt("rename")}catch(O){console.error("Error saving file content:",O),X({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{zt(!1)}};M.useEffect(()=>{$&&($.isFolder||Zc($),Kt("rename"))},[$]),M.useEffect(()=>{_e&&!_e.isFolder&&Zc(_e)},[_e]);const nl=async(A,O)=>{var G;if(Je){X({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}Xe(!0);try{const{data:pe}=await Le.post(`${e}/api/crawl`,{url:A,limit:O,prefix:v,isAutoUpdateKB:Go});if(pe.id){Nc({id:pe.id,url:A,limit:O,prefix:v,taskId:((G=pe.task)==null?void 0:G.id)||""});const be=localStorage.getItem(ZT),Ie=be?JSON.parse(be):[];Ie.some(Me=>Me.id===pe.id)||(Ie.unshift({url:A,id:pe.id,limit:O,prefix:v,timestamp:Date.now()}),Ie.length>20&&(Ie.length=20),localStorage.setItem(ZT,JSON.stringify(Ie))),X({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${A} với giới hạn ${O}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),J(!1),ae(""),he("1")}}catch(pe){console.error("Error crawling website:",pe),X({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Xe(!1)}},Zm=async()=>{try{if(!(Je!=null&&Je.id))return;Nc(null),localStorage.removeItem(is),X({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${Je.url}`})}catch(A){console.error("Error stopping job:",A),X({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};M.useEffect(()=>{if(o)return;const A=(O=!0)=>{const pe=new URL(window.location.href).searchParams.get("prefix")||"";pe?Qr(pe,!1):(O&&!l&&x(new Set),T(n),b(n),fr.current=!0,setTimeout(()=>{an()},0))};return A(!1),window.addEventListener("popstate",()=>A(!0)),()=>{window.removeEventListener("popstate",()=>A(!0))}},[]);const Es=async()=>{Bu(!0);try{await Le.post(`${e}/api/prediction-report`),X({title:"Xuất báo cáo thành công",description:"Báo cáo dự đoán đã được xuất"})}catch(A){console.error("Error exporting report:",A),X({title:"Lỗi",description:"Không thể xuất báo cáo dự đoán",variant:"destructive"})}finally{Bu(!1)}},rl=async()=>{try{const A=Wi();A&&(await Le.post(`${e}/api/start-ingestion-job`,{prefix:v,user_id:A.id,userName:A.username})).status===200&&await dn()}catch(A){xt(!1),console.log(A)}},jo=async A=>{try{ds&&v.includes(ds)&&(console.log(`Auto syncing knowledge base after ${A} operation`),await dn())}catch(O){console.log(`Error auto syncing after ${A}:`,O)}},Xr=M.useRef(),dn=async()=>{try{xt(!0);const A=await Le.post(`${e}/api/get-ingestion-job-status`,{prefix:v}),{status:O}=A==null?void 0:A.data;O==="FAILED"||O==="COMPLETE"||O==="STOPPED"||O==="STOPPING"||!O?(xt(!1),Xr.current&&(clearInterval(Xr.current),Xr.current=null),Dc(A==null?void 0:A.data)):(Xr.current||(Xr.current=setInterval(()=>dn(),5e3)),Dc(A==null?void 0:A.data))}catch(A){console.log(A)}},ol=()=>{const A=Array.from(y);let O;return v?O=A.filter(G=>G.startsWith(v)&&G!==v).length:O=new Set(A.filter(G=>G.split("/").shift())).size,`Đang chọn: ${O}`};return M.useEffect(()=>{const A=v==null?void 0:v.split("/")[0];return A!==ds&&(xt(!1),Xr.current&&(clearInterval(Xr.current),Xr.current=null),Fm(A||""),Dc(null),A&&dn()),()=>{}},[ds,v]),M.useEffect(()=>{So&&Gc.length===0&&(Gm(),qr(null))},[So]),M.useEffect(()=>{if(l)for(const A of Array.from(l))Vo.current[A]=!0},[]),d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx(l_,{}),d.jsx(lr,{open:Lu,onOpenChange:A=>{sa(A),A||(ss(""),ia(null),Jt(!1),oe(null))},children:d.jsxs(Vn,{children:[d.jsxs(Kn,{children:[d.jsx(Gn,{children:"Cảnh báo trùng lặp"}),d.jsxs(Ci,{children:[aa&&d.jsxs(d.Fragment,{children:["Folder $",aa," đã có."]}),xo&&xo.length>0&&d.jsxs(d.Fragment,{children:["Những tệp sau bị lặp:",d.jsx("ul",{className:"mt-2 list-disc pl-5 text-sm text-red-600",children:Array.from(xo).map((A,O)=>d.jsx("li",{children:A.name},O))})]})]})]}),d.jsxs(Fr,{children:[d.jsx(He,{variant:"outline",onClick:()=>{sa(!1),ss(""),ia(null),Jt(!1),oe(null)},children:"Bỏ qua"}),d.jsx(He,{variant:"destructive",onClick:()=>Jm(),children:"Ghi đè"})]})]})}),d.jsx(Kd,{className:"s3-explr-breadcrumb",children:d.jsxs(Gd,{className:"s3-explr-breadcrumb-list",children:[d.jsx(cc,{className:"s3-explr-breadcrumb-item",children:d.jsx(lc,{onClick:()=>Qr(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:t})}),!u&&va.map((A,O)=>d.jsxs("div",{className:"flex items-center",children:[d.jsx(jd,{className:"s3-explr-breadcrumb-separator"},`sep-${O}`),d.jsx(cc,{className:"s3-explr-breadcrumb-item",children:d.jsx(lc,{onClick:()=>Qr(n+va.slice(0,O+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:A})},`item-${A}`)]},O))]})}),d.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[d.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:d.jsx(FH,{ref:Q,onChange:A=>w(A)})}),v&&v!=="/"&&d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsxs(He,{variant:"outline",size:"sm",onClick:()=>{ys||ft||(xt(!0),rl())},"aria-disabled":ys||ft,className:"flex items-center gap-2 s3-explr-refresh-btn aria-disabled:opacity-50",children:[d.jsx(pp,{className:`h-4 w-4 s3-explr-refresh-icon ${ys||ft?"animate-spin":""}`}),"Đồng bộ KB"]})}),Pt&&d.jsx(On,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-2 p-3 max-w-md",children:[d.jsx("p",{className:"font-semibold text-lg border-b pb-1",children:"Thông tin đồng bộ"}),d.jsx("div",{className:"space-y-1",children:d.jsxs("p",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:"Trạng thái:"}),d.jsxs("span",{className:`flex items-center gap-1 font-semibold ${Pt.status==="COMPLETE"?"text-green-600":Pt.status==="FAILED"?"text-red-600":"text-yellow-600"}`,children:[Pt.status==="COMPLETE"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),Pt.status==="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),Pt.status!=="COMPLETE"&&Pt.status!=="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),lL(Pt.status)]})]})}),Pt.statistics&&d.jsxs("div",{className:"space-y-1 border-t pt-2",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Thống kê xử lý:"}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu quét:"}),d.jsx("span",{className:"font-medium",children:Pt.statistics.numberOfDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata quét:"}),d.jsx("span",{className:"font-medium",children:Pt.statistics.numberOfMetadataDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu mới:"}),d.jsx("span",{className:"font-medium text-green-600",children:Pt.statistics.numberOfNewDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Pt.statistics.numberOfModifiedDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Pt.statistics.numberOfMetadataDocumentsModified})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu xóa:"}),d.jsx("span",{className:"font-medium text-orange-600",children:Pt.statistics.numberOfDocumentsDeleted})]}),d.jsxs("div",{className:"flex justify-between col-span-2",children:[d.jsx("span",{children:"Tài liệu lỗi:"}),d.jsx("span",{className:"font-medium text-red-600",children:Pt.statistics.numberOfDocumentsFailed})]})]})]}),d.jsxs("div",{className:"space-y-1 border-t pt-2 text-sm text-gray-200",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Chi tiết Job:"}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"DataSource ID:"})," ",Pt.dataSourceId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Ingestion Job ID:"})," ",Pt.ingestionJobId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Knowledge Base ID:"})," ",Pt.knowledgeBaseId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Job trong queue:"})," ",Pt.is_still_in_stock?"Còn":"Không"]})]}),Pt.errorMessage&&d.jsxs("div",{className:"border-t pt-2",children:[d.jsx("p",{className:"text-red-600 font-medium",children:"Lỗi:"}),d.jsx("p",{className:"text-red-600 text-sm bg-red-50 p-2 rounded",children:Pt.errorMessage})]}),Pt.failureReasons&&Pt.failureReasons.length>0&&d.jsx(HH,{failureReasons:Pt.failureReasons,onNavigateToFile:Lt})]})})]})}),na(En==null?void 0:En.prefixPermission)&&d.jsxs("div",{className:"relative",ref:Yc,children:[d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-file-btn bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors aria-disabled:hidden",onClick:()=>_o(A=>!A),"aria-disabled":(Ht==null?void 0:Ht.role)!=="MASTER_ADMIN"&&(Ht==null?void 0:Ht.role)!=="SITE_ADMIN"&&(v===""||v==="/"),children:[d.jsx(TO,{className:"w-4 h-4"}),"Add file"]}),qc&&d.jsxs("div",{className:"absolute z-50 mt-2 right-0 w-56 bg-white border rounded-lg shadow-lg py-2 flex flex-col",children:[d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1);const A=document.createElement("input");A.type="file",A.multiple=!0,A.onchange=O=>{const G=O.target.files;G&&ma(G,v,"files")},A.click()},children:[d.jsx(gp,{className:"h-4 w-4 mr-2"})," Tải tệp tin"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1);const A=document.createElement("input");A.type="file",A.multiple=!0,A.webkitdirectory=!0,A.onchange=O=>{const G=O.target.files;G&&ma(G,v,"folder")},A.click()},children:[d.jsx(Js,{className:"h-4 w-4 mr-2"})," Tải lên thư mục"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",disabled:!!s&&!v,onClick:()=>P(!0),children:[d.jsx(wO,{className:"h-4 w-4 mr-2 s3-explr-folder-plus-icon"}),"Thư mục mới"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1),J(!0)},children:[d.jsx(xO,{className:"h-4 w-4 mr-2"})," Thêm Website"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1),tf()},children:[d.jsxs("svg",{viewBox:"0 0 87.3 78",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",children:[d.jsx("path",{d:"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z",fill:"#0066da"}),d.jsx("path",{d:"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z",fill:"#00ac47"}),d.jsx("path",{d:"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z",fill:"#ea4335"}),d.jsx("path",{d:"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z",fill:"#00832d"}),d.jsx("path",{d:"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z",fill:"#2684fc"}),d.jsx("path",{d:"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z",fill:"#ffba00"})]})," ","Đồng bộ Google Drive"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1),Qc()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#094ab2",d:"M47.3 28.2C45.3 18.6 37.1 12 28 12c-8.5 0-15.9 5.6-18.4 13.5C4.2 27.2 0 32.2 0 38c0 6.6 5.4 12 12 12h36c8.3 0 16-6.6 16-15.5 0-6.8-4.9-12.4-11.7-13.3z"}),d.jsx("path",{fill:"#0067c5",d:"M44.9 30.1c-.2 0-.4-.1-.6-.1H26c-3.3 0-6 2.7-6 6 0 .9.2 1.8.6 2.6-1.7-.7-3.5-1.1-5.5-1.1C7.6 37.5 4 41.5 4 46s3.6 8.5 8.1 8.5h34.3c6.8 0 12.6-5.4 12.6-12s-5.5-11.6-11.1-12.4z"})]})," ","Đồng bộ OneDrive"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1),Ot()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#036C70",d:"M19 14.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#17828F",d:"M16 17.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#4DB6AC",d:"M13 20.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#fff",d:"M4.5 15.5v-3c0-.28.22-.5.5-.5h3c.28 0 .5.22.5.5v3c0 .28-.22.5-.5.5H5c-.28 0-.5-.22-.5-.5z"})]})," ","Đồng bộ SharePoint"]})]})]}),na((En==null?void 0:En.prefixPermission)&&y.size>0)&&d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-file-btn bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors aria-disabled:hidden",onClick:()=>Rc({contentType:"application/x-directory",isFolder:!0,key:v||"/",lastModified:"-",name:"",size:0}),children:[d.jsx(RC,{className:"w-4 h-4"}),"Chia sẻ"]}),!o&&d.jsxs(d.Fragment,{children:[y.size>0&&d.jsx(d.Fragment,{children:d.jsxs(lr,{open:Z,onOpenChange:Y,children:[d.jsx(uc,{asChild:!0,children:d.jsxs(He,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[d.jsx(DC,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",y.size,")"]})}),d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),d.jsxs(Ci,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",y.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>Y(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:Qm,disabled:fe,className:"s3-explr-confirm-delete-btn",children:fe?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})}),!u&&d.jsxs(lr,{open:N,onOpenChange:P,children:[d.jsx(uc,{asChild:!0}),d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsx(Kn,{className:"s3-explr-dialog-header",children:d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),d.jsx(jn,{disabled:H,id:"name",value:_,onChange:A=>D(A.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),d.jsxs(He,{onClick:()=>{_.trim()&&Eo(_,v)},disabled:H,className:"s3-explr-create-btn",children:[H&&d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),H?"Đang tạo...":"Tạo"]})]})]})]}),u&&!v?d.jsx(d.Fragment,{}):d.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[Je?d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[d.jsx(Et,{className:"h-4 w-4 animate-spin s3-explr-loader"}),Je.status?d.jsxs(d.Fragment,{children:[Je.status.isProcessing?"Đang thu thập ":"Đang quét sitemap ","(",Je.status.completed,"/",Je.status.total,") -"," ",Math.floor(zo/60),":",String(zo%60).padStart(2,"0")]}):"Đang thu thập..."]}),d.jsxs(He,{variant:"destructive",size:"sm",onClick:()=>void Zm(),className:"flex items-center gap-2",children:[d.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),d.jsx(kO,{className:"h-4 w-4"})]})]})}),Je.status&&d.jsx(On,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2 max-w-md break-words",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Je==null?void 0:Je.url]}),d.jsxs("p",{children:["Tiến độ: ",Je==null?void 0:Je.status.completed,"/",Je==null?void 0:Je.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian: ",Math.floor(zo/60),":",String(zo%60).padStart(2,"0")]}),d.jsxs("p",{children:["Trạng thái:"," ",(Je==null?void 0:Je.status.status)==="scraping"?"Đang thu thập":(Je==null?void 0:Je.status.status)==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):!u&&d.jsxs(lr,{open:L,onOpenChange:J,children:[d.jsx(uc,{asChild:!0}),d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Ci,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(jn,{id:"websiteUrl",value:U,onChange:A=>ae(A.target.value),placeholder:"https://example.com",type:"url",disabled:Ee,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),d.jsx(jn,{id:"crawlLimit",value:ye,onChange:A=>{const O=A.target.value;/^\d*$/.test(O)&&he(O)},placeholder:"1",type:"text",disabled:Ee,className:"s3-explr-input"}),d.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)"})]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>{J(!1),ae(""),he("1")},disabled:Ee,className:"s3-explr-cancel-btn",children:"Hủy"}),Je?d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx("span",{children:d.jsxs(He,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(On,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(He,{onClick:()=>{U.trim()&&nl(U.trim(),parseInt(ye)||1)},disabled:Ee||!U.trim(),className:"s3-explr-crawl-btn",children:Ee?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]}),v.startsWith("BKTTW/")&&d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!v,onClick:Es,children:[ca&&d.jsx(pp,{className:`h-4 w-4 s3-explr-refresh-icon ${ca?"animate-spin":""}`}),"Xuất báo cáo"]})}),(Je==null?void 0:Je.status)&&d.jsx(On,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Je.url]}),d.jsxs("p",{children:["Tiến độ: ",Je.status.completed,"/",Je.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian: ",Math.floor(zo/60),":",String(zo%60).padStart(2,"0")]}),d.jsxs("p",{children:["Trạng thái:"," ",Je.status.status==="scraping"?"Đang thu thập":Je.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}),d.jsxs(lr,{open:L,onOpenChange:J,children:[d.jsx(uc,{asChild:!0}),d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Ci,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(jn,{id:"websiteUrl",value:U,onChange:A=>ae(A.target.value),placeholder:"https://example.com",type:"url",disabled:Ee,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),d.jsx(jn,{id:"crawlLimit",value:ye,onChange:A=>{const O=A.target.value;/^\d*$/.test(O)&&he(O)},placeholder:"1",type:"text",disabled:Ee,className:"s3-explr-input"}),d.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)"})]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsxs(He,{className:`absolute left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Go?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,onClick:()=>Wc(A=>!A),children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Go?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]}),d.jsx(He,{variant:"outline",onClick:()=>{J(!1),ae(""),he("1")},disabled:Ee,className:"s3-explr-cancel-btn",children:"Hủy"}),Je?d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx("span",{children:d.jsxs(He,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(On,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(He,{onClick:()=>{U.trim()&&nl(U.trim(),parseInt(ye)||1)},disabled:Ee||!U.trim(),className:"s3-explr-crawl-btn",children:Ee?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),v.startsWith("BKTTW/")&&d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!v,onClick:Es,children:[ca&&d.jsx(pp,{className:`h-4 w-4 s3-explr-refresh-icon ${ca?"animate-spin":""}`}),"Xuất báo cáo"]})}),ca&&d.jsx(On,{sideOffset:5,children:"Đang xuất báo cáo"})]})}),d.jsxs("div",{className:"flex items-center gap-4",children:[la&&d.jsxs(Qs,{open:la,onOpenChange:us,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(kp,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:Xc,children:"✖"})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My OneDrive"}),d.jsx(Kd,{className:"onedrive-breadcrumb",children:d.jsx(Gd,{className:"onedrive-breadcrumb-list",children:da.map((A,O)=>d.jsxs("div",{className:"flex items-center",children:[O>0&&d.jsx(jd,{className:"onedrive-breadcrumb-separator"}),d.jsx(cc,{className:"onedrive-breadcrumb-item",children:d.jsx(lc,{onClick:()=>Zu(O),className:"cursor-pointer onedrive-breadcrumb-link",children:A.name})})]},O))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Um?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):d.jsx(d.Fragment,{children:[...zu,...$c].length>0?[...zu,...$c].map(A=>d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${hs.some(O=>O.id===A.id)?"bg-blue-100":""}`,children:[d.jsx("input",{type:"checkbox",checked:hs.some(O=>O.id===A.id),onChange:O=>{O.stopPropagation(),Cs(A)},className:"cursor-pointer"}),A.isFolder?d.jsx(Js,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>ga(A.id,A.name)}):d.jsx(gp,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${A.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{A.isFolder?ga(A.id,A.name):Cs(A)},children:A.name}),!A.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[Yr(A.size)," •"," ",Qu(A.lastModified.toISOString())]})]})]},A.id)):d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."})})}),d.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:d.jsx(He,{onClick:()=>{ef(hs,v),Xc()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:hs.length===0,children:"Đồng bộ"})}),d.jsx("button",{onClick:()=>ha(!0),className:"absolute bottom-4 left-4 text-gray-600 hover:text-gray-800",title:"Đăng xuất OneDrive",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),d.jsx("polyline",{points:"16 17 21 12 16 7"}),d.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})]}),d.jsxs(Qs,{open:Bm,onOpenChange:ha,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi OneDrive?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(He,{variant:"outline",onClick:()=>ha(!1),children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:()=>{Qn(),ha(!1)},children:"Đăng xuất"})]})]})]}),So&&d.jsxs(Qs,{open:So,onOpenChange:fa,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(kp,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:Ju,children:"✖"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[gt&&d.jsx("button",{onClick:()=>qr(null),className:"text-gray-600 hover:text-gray-800",children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My SharePoint"})]}),gt&&d.jsx(Kd,{className:"sharepoint-breadcrumb",children:d.jsx(Gd,{className:"sharepoint-breadcrumb-list",children:Kc.map((A,O)=>d.jsxs("div",{className:"flex items-center",children:[O>0&&d.jsx(jd,{className:"sharepoint-breadcrumb-separator"}),d.jsx(cc,{className:"sharepoint-breadcrumb-item",children:d.jsx(lc,{onClick:()=>qm(O),className:"cursor-pointer sharepoint-breadcrumb-link",children:A.name})})]},O))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Ku?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):gt?[...Vc,...ps].length===0?d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."}):[...Vc,...ps].map(A=>{const O=ms.some(G=>G.id===A.id);return d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${O?"bg-blue-100":""}`,children:[d.jsx("input",{type:"checkbox",checked:O,onChange:G=>{G.stopPropagation(),Wm(A)},className:"cursor-pointer"}),A.isFolder?d.jsx(Js,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>ws(A.id,A.name,(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")}):d.jsx(gp,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${A.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{A.isFolder&&ws(A.id,A.name,(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")},children:A.name}),!A.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[Yr(A.size)," •"," ",A.lastModified.toLocaleString()]})]})]},A.id)}):d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6",children:Gc.map(A=>d.jsxs("div",{className:"cursor-pointer bg-white shadow-md rounded-xl p-5 flex flex-col justify-center items-start transition-shadow duration-200 hover:shadow-lg border border-gray-100 min-h-[120px]",style:{overflow:"hidden",wordBreak:"break-word",textOverflow:"ellipsis",whiteSpace:"normal"},onClick:()=>jm(A),children:[d.jsx("div",{className:"font-bold text-lg mb-1 truncate w-full",title:A.name,children:A.name}),d.jsx("div",{className:"text-sm text-gray-500 truncate w-full",title:A.description,children:A.description})]},A.id))})}),d.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:gt&&d.jsxs(d.Fragment,{children:[d.jsx(He,{onClick:()=>{Yu(ms,v),Ju()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:ms.length===0,children:"Đồng bộ"}),d.jsx(He,{onClick:()=>qr(null),children:"Quay lại"})]})}),gt&&d.jsxs("button",{onClick:()=>Wc(A=>!A),className:`absolute bottom-4 left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Go?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,title:"Bật/tắt tự động cập nhật KB",children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Go?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]})]})]}),d.jsxs(Qs,{open:ju,onOpenChange:vs,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi SharePoint?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(He,{variant:"outline",onClick:()=>vs(!1),children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:()=>{It(),vs(!1)},children:"Đăng xuất"})]})]})]})]}),d.jsx(lr,{open:!!Pc,onOpenChange:A=>{A||($u(!1),Uu([]),Fu(""))},children:d.jsxs(Vn,{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:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:d.jsxs("h3",{className:"font-medium mb-2",children:["Danh sách flows đang sử dụng dữ liệu từ folder(",d.jsx("span",{className:"font-bold",children:cs}),"):"," "]})}),d.jsx(Ci,{className:"s3-explr-dialog-description",children:Oc?d.jsxs("div",{className:"flex items-center justify-center py-4",children:[d.jsx(Et,{className:"h-6 w-6 animate-spin"}),d.jsx("span",{className:"ml-2",children:"Đang tải thông tin flows..."})]}):d.jsx("div",{children:ls&&Array.isArray(ls)&&ls.length>0?d.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:d.jsxs("table",{className:"w-full border-collapse",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"bg-gray-100",children:[d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Tên Flow"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"KnowledgeBase Id"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Loại"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Ngày tạo"})]})}),d.jsx("tbody",{children:ls.map((A,O)=>d.jsxs("tr",{className:O%2===0?"bg-white":"bg-gray-50",children:[d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:A.name}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:A.KnowledgeBaseId}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:A.type==="MULTIAGENT"?"Agent Flow":"Chat Flow"}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:A.createdDate?new Date(A.createdDate).toLocaleString("vi-VN"):"N/A"})]},O))})]})}):d.jsx("div",{className:"text-gray-500 italic py-2",children:"Không có flow nào sử dụng dữ liệu từ folder này"})})})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>W(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:()=>xs(ee),disabled:vn,className:"s3-explr-confirm-delete-btn",children:vn?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(lr,{open:!!ee,onOpenChange:A=>!A&&W(null),children:d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),d.jsxs(Ci,{className:"s3-explr-dialog-description break-words whitespace-pre-wrap",children:["Bạn có chắc chắn muốn xóa"," ",d.jsx("span",{className:"font-medium break-all",children:ee==null?void 0:ee.name}),"? Hành động này không thể hoàn tác."]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>W(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:()=>xs(ee),disabled:vn,className:"s3-explr-confirm-delete-btn",children:vn?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(lr,{open:!!$,onOpenChange:A=>{A||(te(null),Pe(null),z(""),Ct(""),Kt("rename"))},children:d.jsxs(Vn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(Kn,{className:"s3-explr-dialog-header",children:d.jsx(Gn,{className:"s3-explr-dialog-title",children:$!=null&&$.isFolder?"Đổi tên thư mục":ta($)?"Quản lý tập tin":"Đổi tên tập tin"})}),$&&d.jsxs(_g,{value:Dn,onValueChange:A=>Kt(A),children:[d.jsxs(ru,{"aria-checked":!ta($),"aria-disabled":$.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[d.jsx(qi,{value:"rename",children:"Đổi tên"}),!$.isFolder&&d.jsxs(d.Fragment,{children:[ta($)&&d.jsx(qi,{value:"edit",children:"Sửa nội dung"}),d.jsx(qi,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),d.jsx(Yi,{value:"rename",children:d.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:d.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),d.jsx(jn,{id:"newName",value:Te,onChange:A=>z(A.target.value),placeholder:"Nhập tên mới",disabled:Ce,className:"s3-explr-input"})]})})}),!$.isFolder&&d.jsxs(d.Fragment,{children:[ta($)&&d.jsx(Yi,{value:"edit",children:d.jsx("div",{className:"space-y-4 py-4",children:Yt?d.jsx("div",{className:"flex items-center justify-center py-10",children:d.jsx(Et,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d.jsxs("div",{className:"max-h-[70dvh] overflow-auto rounded-md border px-4 py-3 bg-muted/30",children:[d.jsx(wr,{htmlFor:"content",className:"block text-sm font-medium mb-2 text-muted-foreground",children:"Nội dung tập tin"}),d.jsx(hc,{id:"content",value:Qe,onChange:A=>Ct(A.target.value),placeholder:"Nhập nội dung tập tin",className:"font-mono text-sm resize-none min-h-[200px] w-full",disabled:rn,style:{height:"auto",maxHeight:"60vh"},rows:Math.max(10,Qe.split(`
228
- `).length+1)})]})})}),d.jsx(Yi,{value:"edit-metadata",children:d.jsx("div",{className:"space-y-4 py-4",children:Yt?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Et,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:xe&&typeof xe=="object"&&Object.entries(xe).map(([A,O],G)=>d.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[d.jsxs(wr,{htmlFor:A,className:"s3-explr-label flex items-center gap-1",children:[aL[A]||A,fg(A)&&d.jsx(GD,{className:"h-[12px] w-[12px] text-red-500"})]}),sL(A)?d.jsx(hc,{id:A,value:typeof O=="string"?O:JSON.stringify(O),onChange:pe=>{const be={...xe,[A]:pe.target.value};Pe(be)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:rn||fg(A)}):d.jsx(jn,{id:A,value:typeof O=="string"?O:JSON.stringify(O),onChange:pe=>{const be={...xe,[A]:pe.target.value};Pe(be)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:rn||fg(A)})]},G))})})})]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>{te(null),Pe(null),z(""),Ct("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Dn==="edit"?d.jsx(He,{onClick:()=>$&&el($,Qe),disabled:rn||Yt,className:"s3-explr-save-btn",children:rn?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):Dn==="edit-metadata"?d.jsx(He,{onClick:()=>xe&&typeof xe=="object"&&$&&tl($),disabled:rn||Yt,className:"s3-explr-save-btn",children:rn?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):d.jsx(He,{onClick:()=>{Te.trim()&&$&&Xm($,Te.trim())},disabled:Ce||!Te.trim()||Te.trim()===($==null?void 0:$.name),className:"s3-explr-rename-btn",children:Ce?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),d.jsx(lr,{open:!!_e,onOpenChange:A=>{A||(ke(null),Ct(""))},children:d.jsxs(Vn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(Kn,{className:"s3-explr-dialog-header",children:d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Xem tập tin"})}),_e&&d.jsxs(_g,{value:"view",children:[d.jsx(ru,{className:"grid w-full grid-cols-1 ",children:!_e.isFolder&&ta(_e)&&d.jsx(qi,{value:"view",children:"Nội dung"})}),!_e.isFolder&&ta(_e)&&d.jsx(Yi,{value:"view",children:d.jsx("div",{className:"space-y-4 py-4",children:Yt?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Et,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"overflow-hidden overflow-y-auto pb-3 px-1",children:d.jsx("div",{className:"rounded-md bg-muted p-4 font-mono text-sm overflow-auto max-h-[60vh] border",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words",children:Qe})})})})})]}),d.jsx(Fr,{className:"s3-explr-dialog-footer",children:d.jsx(He,{variant:"outline",onClick:()=>{ke(null),Ct("")},className:"s3-explr-cancel-btn",children:"Đóng"})})]})}),de&&ce&&d.jsx(VU,{openDialogRename:ce,setOpenDialogRename:Ae,apiBaseUrl:e,setFileToMove:se,fileToMove:de,refreshFiles:an,ignoreCache:fr,autoSyncAfterFileOperation:jo})]})]}),Km&&d.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"}),d.jsx(zU,{onFilesSelected:(A,O)=>ma(A,v,O),children:d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Zd,{className:"s3-explr-table",children:[d.jsx(eu,{className:"s3-explr-table-header",children:_s.getHeaderGroups().map(A=>d.jsx(Hr,{className:"hover:bg-transparent s3-explr-header-row",children:A.headers.map(O=>d.jsx(po,{className:"s3-explr-header-cell",children:O.isPlaceholder?null:Td(O.column.columnDef.header,O.getContext())},O.id))},A.id))}),d.jsx(tu,{className:"s3-explr-table-body",children:_s.getRowModel().rows.length===0?d.jsx(Hr,{className:"s3-explr-empty-row",children:d.jsx(Wn,{colSpan:of.length,className:"h-24 text-center s3-explr-empty-cell",children:g?d.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 "',g,'"']}):d.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:ys?"Đ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"})})}):_s.getRowModel().rows.map(A=>d.jsx(Hr,{className:"h-12 s3-explr-row",children:A.getVisibleCells().map(O=>d.jsx(Wn,{className:"align-middle s3-explr-cell",children:Td(O.column.columnDef.cell,O.getContext())},O.id))},A.id))})]})})}),g&&pa!==0&&d.jsx(d.Fragment,{children:d.jsx(qd,{children:d.jsxs(Yd,{children:[d.jsx(Jd,{onClick:()=>hr(A=>Math.max(A-1,1)),"aria-disabled":Gt===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(pa/20)},(A,O)=>{const G=O+1,pe=Math.ceil(pa/20);return pe>7&&!(G===1||G===pe||G>=Gt-1&&G<=Gt+1)?G===Gt-2&&Gt>4||G===Gt+2&&Gt<pe-3?d.jsx(Xd,{className:"pointer-events-none",children:"..."},O):null:d.jsx($r,{className:"cursor-pointer",children:d.jsx(Qa,{isActive:Gt===G,onClick:()=>hr(G),className:`${Gt===G?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:G})},O)}),d.jsx($r,{children:d.jsx(Qd,{onClick:()=>hr(A=>Math.min(A+1,Math.ceil(pa/20))),"aria-disabled":Gt===Math.ceil(pa/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),o&&a&&d.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[d.jsx("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:ol()}),d.jsx(He,{variant:"default",onClick:()=>a(Ai()),disabled:y.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),d.jsx(i3,{open:!!Mc,onClose:()=>Rc(null),file:Mc,apiBaseUrl:e,rootUrlHostApi:r})]})}),y3=t=>d.jsx(fM,{clientId:c3,children:d.jsx(v3,{...t})});var Ec=t=>t.type==="checkbox",ra=t=>t instanceof Date,Mn=t=>t==null;const e0=t=>typeof t=="object";var qt=t=>!Mn(t)&&!Array.isArray(t)&&e0(t)&&!ra(t),w3=t=>qt(t)&&t.target?Ec(t.target)?t.target.checked:t.target.value:t,C3=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,b3=(t,e)=>t.has(C3(e)),x3=t=>{const e=t.constructor&&t.constructor.prototype;return qt(e)&&e.hasOwnProperty("isPrototypeOf")},Pm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function _n(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(Pm&&(t instanceof Blob||r))&&(n||qt(t)))if(e=n?[]:{},!n&&!x3(t))e=t;else for(const o in t)t.hasOwnProperty(o)&&(e[o]=_n(t[o]));else return t;return e}var Pu=t=>Array.isArray(t)?t.filter(Boolean):[],nn=t=>t===void 0,Fe=(t,e,n)=>{if(!e||!qt(t))return n;const r=Pu(e.split(/[,[\].]+?/)).reduce((o,a)=>Mn(o)?o:o[a],t);return nn(r)||r===t?nn(t[e])?n:t[e]:r},wo=t=>typeof t=="boolean",Om=t=>/^\w*$/.test(t),t0=t=>Pu(t.replace(/["|']|\]/g,"").split(/\.|\[/)),$t=(t,e,n)=>{let r=-1;const o=Om(e)?[e]:t0(e),a=o.length,s=a-1;for(;++r<a;){const l=o[r];let u=n;if(r!==s){const h=t[l];u=qt(h)||Array.isArray(h)?h:isNaN(+o[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;t[l]=u,t=t[l]}};const n0={BLUR:"blur",FOCUS_OUT:"focusout"},Kr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Bo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};M.createContext(null);var S3=(t,e,n,r=!0)=>{const o={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(o,a,{get:()=>{const s=a;return e._proxyFormState[s]!==Kr.all&&(e._proxyFormState[s]=!r||Kr.all),t[s]}});return o};const _3=typeof window<"u"?C.useLayoutEffect:C.useEffect;var Co=t=>typeof t=="string",E3=(t,e,n,r,o)=>Co(t)?(r&&e.watch.add(t),Fe(n,t,o)):Array.isArray(t)?t.map(a=>(r&&e.watch.add(a),Fe(n,a))):(r&&(e.watchAll=!0),n),T3=(t,e,n,r,o)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:o||!0}}:{},Tc=t=>Array.isArray(t)?t:[t],r0=()=>{let t=[];return{get observers(){return t},next:o=>{for(const a of t)a.next&&a.next(o)},subscribe:o=>(t.push(o),{unsubscribe:()=>{t=t.filter(a=>a!==o)}}),unsubscribe:()=>{t=[]}}},Mm=t=>Mn(t)||!e0(t);function Ti(t,e){if(Mm(t)||Mm(e))return t===e;if(ra(t)&&ra(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n){const a=t[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=e[o];if(ra(a)&&ra(s)||qt(a)&&qt(s)||Array.isArray(a)&&Array.isArray(s)?!Ti(a,s):a!==s)return!1}}return!0}var Rn=t=>qt(t)&&!Object.keys(t).length,Rm=t=>t.type==="file",Gr=t=>typeof t=="function",Ou=t=>{if(!Pm)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},o0=t=>t.type==="select-multiple",Dm=t=>t.type==="radio",A3=t=>Dm(t)||Ec(t),Lm=t=>Ou(t)&&t.isConnected;function I3(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=nn(t)?r++:t[e[r++]];return t}function k3(t){for(const e in t)if(t.hasOwnProperty(e)&&!nn(t[e]))return!1;return!0}function on(t,e){const n=Array.isArray(e)?e:Om(e)?[e]:t0(e),r=n.length===1?t:I3(t,n),o=n.length-1,a=n[o];return r&&delete r[a],o!==0&&(qt(r)&&Rn(r)||Array.isArray(r)&&k3(r))&&on(t,n.slice(0,-1)),t}var i0=t=>{for(const e in t)if(Gr(t[e]))return!0;return!1};function Mu(t,e={}){const n=Array.isArray(t);if(qt(t)||n)for(const r in t)Array.isArray(t[r])||qt(t[r])&&!i0(t[r])?(e[r]=Array.isArray(t[r])?[]:{},Mu(t[r],e[r])):Mn(t[r])||(e[r]=!0);return e}function a0(t,e,n){const r=Array.isArray(t);if(qt(t)||r)for(const o in t)Array.isArray(t[o])||qt(t[o])&&!i0(t[o])?nn(e)||Mm(n[o])?n[o]=Array.isArray(t[o])?Mu(t[o],[]):{...Mu(t[o])}:a0(t[o],Mn(e)?{}:e[o],n[o]):n[o]=!Ti(t[o],e[o]);return n}var Ac=(t,e)=>a0(t,e,Mu(e));const s0={value:!1,isValid:!1},c0={value:!0,isValid:!0};var l0=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!nn(t[0].attributes.value)?nn(t[0].value)||t[0].value===""?c0:{value:t[0].value,isValid:!0}:c0:s0}return s0},d0=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>nn(t)?t:e?t===""?NaN:t&&+t:n&&Co(t)?new Date(t):r?r(t):t;const u0={isValid:!1,value:null};var f0=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,u0):u0;function h0(t){const e=t.ref;return Rm(e)?e.files:Dm(e)?f0(t.refs).value:o0(e)?[...e.selectedOptions].map(({value:n})=>n):Ec(e)?l0(t.refs).value:d0(nn(e.value)?t.ref.value:e.value,t)}var N3=(t,e,n,r)=>{const o={};for(const a of t){const s=Fe(e,a);s&&$t(o,a,s._f)}return{criteriaMode:n,names:[...t],fields:o,shouldUseNativeValidation:r}},Ru=t=>t instanceof RegExp,Ic=t=>nn(t)?t:Ru(t)?t.source:qt(t)?Ru(t.value)?t.value.source:t.value:t,p0=t=>({isOnSubmit:!t||t===Kr.onSubmit,isOnBlur:t===Kr.onBlur,isOnChange:t===Kr.onChange,isOnAll:t===Kr.all,isOnTouch:t===Kr.onTouched});const g0="AsyncFunction";var P3=t=>!!t&&!!t.validate&&!!(Gr(t.validate)&&t.validate.constructor.name===g0||qt(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===g0)),O3=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),m0=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const kc=(t,e,n,r)=>{for(const o of n||Object.keys(t)){const a=Fe(t,o);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],o)&&!r)return!0;if(s.ref&&e(s.ref,s.name)&&!r)return!0;if(kc(l,e))break}else if(qt(l)&&kc(l,e))break}}};function v0(t,e,n){const r=Fe(t,n);if(r||Om(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const a=o.join("."),s=Fe(e,a),l=Fe(t,a);if(s&&!Array.isArray(s)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};o.pop()}return{name:n}}var M3=(t,e,n,r)=>{n(t);const{name:o,...a}=t;return Rn(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(s=>e[s]===(!r||Kr.all))},R3=(t,e,n)=>!t||!e||t===e||Tc(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),D3=(t,e,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(e||t):(n?r.isOnBlur:o.isOnBlur)?!t:(n?r.isOnChange:o.isOnChange)?t:!0,L3=(t,e)=>!Pu(Fe(t,e)).length&&on(t,e),F3=(t,e,n)=>{const r=Tc(Fe(t,n));return $t(r,"root",e[n]),$t(t,n,r),t},Du=t=>Co(t);function y0(t,e,n="validate"){if(Du(t)||Array.isArray(t)&&t.every(Du)||wo(t)&&!t)return{type:n,message:Du(t)?t:"",ref:e}}var as=t=>qt(t)&&!Ru(t)?t:{value:t,message:""},w0=async(t,e,n,r,o,a)=>{const{ref:s,refs:l,required:u,maxLength:h,minLength:p,min:g,max:w,pattern:y,validate:x,name:v,valueAsNumber:b,mount:E}=t._f,T=Fe(n,v);if(!E||e.has(v))return{};const N=l?l[0]:s,P=se=>{o&&N.reportValidity&&(N.setCustomValidity(wo(se)?"":se||""),N.reportValidity())},_={},D=Dm(s),H=Ec(s),K=D||H,ee=(b||Rm(s))&&nn(s.value)&&nn(T)||Ou(s)&&s.value===""||T===""||Array.isArray(T)&&!T.length,W=T3.bind(null,v,r,_),de=(se,fe,q,Z=Bo.maxLength,Y=Bo.minLength)=>{const oe=se?fe:q;_[v]={type:se?Z:Y,message:oe,ref:s,...W(se?Z:Y,oe)}};if(a?!Array.isArray(T)||!T.length:u&&(!K&&(ee||Mn(T))||wo(T)&&!T||H&&!l0(l).isValid||D&&!f0(l).isValid)){const{value:se,message:fe}=Du(u)?{value:!!u,message:u}:as(u);if(se&&(_[v]={type:Bo.required,message:fe,ref:N,...W(Bo.required,fe)},!r))return P(fe),_}if(!ee&&(!Mn(g)||!Mn(w))){let se,fe;const q=as(w),Z=as(g);if(!Mn(T)&&!isNaN(T)){const Y=s.valueAsNumber||T&&+T;Mn(q.value)||(se=Y>q.value),Mn(Z.value)||(fe=Y<Z.value)}else{const Y=s.valueAsDate||new Date(T),oe=$=>new Date(new Date().toDateString()+" "+$),Q=s.type=="time",X=s.type=="week";Co(q.value)&&T&&(se=Q?oe(T)>oe(q.value):X?T>q.value:Y>new Date(q.value)),Co(Z.value)&&T&&(fe=Q?oe(T)<oe(Z.value):X?T<Z.value:Y<new Date(Z.value))}if((se||fe)&&(de(!!se,q.message,Z.message,Bo.max,Bo.min),!r))return P(_[v].message),_}if((h||p)&&!ee&&(Co(T)||a&&Array.isArray(T))){const se=as(h),fe=as(p),q=!Mn(se.value)&&T.length>+se.value,Z=!Mn(fe.value)&&T.length<+fe.value;if((q||Z)&&(de(q,se.message,fe.message),!r))return P(_[v].message),_}if(y&&!ee&&Co(T)){const{value:se,message:fe}=as(y);if(Ru(se)&&!T.match(se)&&(_[v]={type:Bo.pattern,message:fe,ref:s,...W(Bo.pattern,fe)},!r))return P(fe),_}if(x){if(Gr(x)){const se=await x(T,n),fe=y0(se,N);if(fe&&(_[v]={...fe,...W(Bo.validate,fe.message)},!r))return P(fe.message),_}else if(qt(x)){let se={};for(const fe in x){if(!Rn(se)&&!r)break;const q=y0(await x[fe](T,n),N,fe);q&&(se={...q,...W(fe,q.message)},P(q.message),r&&(_[v]=se))}if(!Rn(se)&&(_[v]={ref:N,...se},!r))return _}}return P(!0),_};const $3={mode:Kr.onSubmit,reValidateMode:Kr.onChange,shouldFocusError:!0};function H3(t={}){let e={...$3,...t},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Gr(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const r={};let o=qt(e.defaultValues)||qt(e.values)?_n(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:_n(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,h=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const w={array:r0(),state:r0()},y=p0(e.mode),x=p0(e.reValidateMode),v=e.criteriaMode===Kr.all,b=L=>J=>{clearTimeout(h),h=setTimeout(L,J)},E=async L=>{if(!e.disabled&&(p.isValid||g.isValid||L)){const J=e.resolver?Rn((await ee()).errors):await de(r,!0);J!==n.isValid&&w.state.next({isValid:J})}},T=(L,J)=>{!e.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((L||Array.from(l.mount)).forEach(U=>{U&&(J?$t(n.validatingFields,U,J):on(n.validatingFields,U))}),w.state.next({validatingFields:n.validatingFields,isValidating:!Rn(n.validatingFields)}))},N=(L,J=[],U,ae,ye=!0,he=!0)=>{if(ae&&U&&!e.disabled){if(s.action=!0,he&&Array.isArray(Fe(r,L))){const Ee=U(Fe(r,L),ae.argA,ae.argB);ye&&$t(r,L,Ee)}if(he&&Array.isArray(Fe(n.errors,L))){const Ee=U(Fe(n.errors,L),ae.argA,ae.argB);ye&&$t(n.errors,L,Ee),L3(n.errors,L)}if((p.touchedFields||g.touchedFields)&&he&&Array.isArray(Fe(n.touchedFields,L))){const Ee=U(Fe(n.touchedFields,L),ae.argA,ae.argB);ye&&$t(n.touchedFields,L,Ee)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Ac(o,a)),w.state.next({name:L,isDirty:fe(L,J),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else $t(a,L,J)},P=(L,J)=>{$t(n.errors,L,J),w.state.next({errors:n.errors})},_=L=>{n.errors=L,w.state.next({errors:n.errors,isValid:!1})},D=(L,J,U,ae)=>{const ye=Fe(r,L);if(ye){const he=Fe(a,L,nn(U)?Fe(o,L):U);nn(he)||ae&&ae.defaultChecked||J?$t(a,L,J?he:h0(ye._f)):Y(L,he),s.mount&&E()}},H=(L,J,U,ae,ye)=>{let he=!1,Ee=!1;const Xe={name:L};if(!e.disabled){if(!U||ae){(p.isDirty||g.isDirty)&&(Ee=n.isDirty,n.isDirty=Xe.isDirty=fe(),he=Ee!==Xe.isDirty);const ft=Ti(Fe(o,L),J);Ee=!!Fe(n.dirtyFields,L),ft?on(n.dirtyFields,L):$t(n.dirtyFields,L,!0),Xe.dirtyFields=n.dirtyFields,he=he||(p.dirtyFields||g.dirtyFields)&&Ee!==!ft}if(U){const ft=Fe(n.touchedFields,L);ft||($t(n.touchedFields,L,U),Xe.touchedFields=n.touchedFields,he=he||(p.touchedFields||g.touchedFields)&&ft!==U)}he&&ye&&w.state.next(Xe)}return he?Xe:{}},K=(L,J,U,ae)=>{const ye=Fe(n.errors,L),he=(p.isValid||g.isValid)&&wo(J)&&n.isValid!==J;if(e.delayError&&U?(u=b(()=>P(L,U)),u(e.delayError)):(clearTimeout(h),u=null,U?$t(n.errors,L,U):on(n.errors,L)),(U?!Ti(ye,U):ye)||!Rn(ae)||he){const Ee={...ae,...he&&wo(J)?{isValid:J}:{},errors:n.errors,name:L};n={...n,...Ee},w.state.next(Ee)}},ee=async L=>{T(L,!0);const J=await e.resolver(a,e.context,N3(L||l.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return T(L),J},W=async L=>{const{errors:J}=await ee(L);if(L)for(const U of L){const ae=Fe(J,U);ae?$t(n.errors,U,ae):on(n.errors,U)}else n.errors=J;return J},de=async(L,J,U={valid:!0})=>{for(const ae in L){const ye=L[ae];if(ye){const{_f:he,...Ee}=ye;if(he){const Xe=l.array.has(he.name),ft=ye._f&&P3(ye._f);ft&&p.validatingFields&&T([ae],!0);const xt=await w0(ye,l.disabled,a,v,e.shouldUseNativeValidation&&!J,Xe);if(ft&&p.validatingFields&&T([ae]),xt[he.name]&&(U.valid=!1,J))break;!J&&(Fe(xt,he.name)?Xe?F3(n.errors,xt,he.name):$t(n.errors,he.name,xt[he.name]):on(n.errors,he.name))}!Rn(Ee)&&await de(Ee,J,U)}}return U.valid},se=()=>{for(const L of l.unMount){const J=Fe(r,L);J&&(J._f.refs?J._f.refs.every(U=>!Lm(U)):!Lm(J._f.ref))&&Ae(L)}l.unMount=new Set},fe=(L,J)=>!e.disabled&&(L&&J&&$t(a,L,J),!Ti(_e(),o)),q=(L,J,U)=>E3(L,l,{...s.mount?a:nn(J)?o:Co(L)?{[L]:J}:J},U,J),Z=L=>Pu(Fe(s.mount?a:o,L,e.shouldUnregister?Fe(o,L,[]):[])),Y=(L,J,U={})=>{const ae=Fe(r,L);let ye=J;if(ae){const he=ae._f;he&&(!he.disabled&&$t(a,L,d0(J,he)),ye=Ou(he.ref)&&Mn(J)?"":J,o0(he.ref)?[...he.ref.options].forEach(Ee=>Ee.selected=ye.includes(Ee.value)):he.refs?Ec(he.ref)?he.refs.length>1?he.refs.forEach(Ee=>(!Ee.defaultChecked||!Ee.disabled)&&(Ee.checked=Array.isArray(ye)?!!ye.find(Xe=>Xe===Ee.value):ye===Ee.value)):he.refs[0]&&(he.refs[0].checked=!!ye):he.refs.forEach(Ee=>Ee.checked=Ee.value===ye):Rm(he.ref)?he.ref.value="":(he.ref.value=ye,he.ref.type||w.state.next({name:L,values:_n(a)})))}(U.shouldDirty||U.shouldTouch)&&H(L,ye,U.shouldTouch,U.shouldDirty,!0),U.shouldValidate&&te(L)},oe=(L,J,U)=>{for(const ae in J){const ye=J[ae],he=`${L}.${ae}`,Ee=Fe(r,he);(l.array.has(L)||qt(ye)||Ee&&!Ee._f)&&!ra(ye)?oe(he,ye,U):Y(he,ye,U)}},Q=(L,J,U={})=>{const ae=Fe(r,L),ye=l.array.has(L),he=_n(J);$t(a,L,he),ye?(w.array.next({name:L,values:_n(a)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&U.shouldDirty&&w.state.next({name:L,dirtyFields:Ac(o,a),isDirty:fe(L,he)})):ae&&!ae._f&&!Mn(he)?oe(L,he,U):Y(L,he,U),m0(L,l)&&w.state.next({...n}),w.state.next({name:s.mount?L:void 0,values:_n(a)})},X=async L=>{s.mount=!0;const J=L.target;let U=J.name,ae=!0;const ye=Fe(r,U),he=Ee=>{ae=Number.isNaN(Ee)||ra(Ee)&&isNaN(Ee.getTime())||Ti(Ee,Fe(a,U,Ee))};if(ye){let Ee,Xe;const ft=J.type?h0(ye._f):w3(L),xt=L.type===n0.BLUR||L.type===n0.FOCUS_OUT,bo=!O3(ye._f)&&!e.resolver&&!Fe(n.errors,U)&&!ye._f.deps||D3(xt,Fe(n.touchedFields,U),n.isSubmitted,x,y),Jt=m0(U,l,xt);$t(a,U,ft),xt?(ye._f.onBlur&&ye._f.onBlur(L),u&&u(0)):ye._f.onChange&&ye._f.onChange(L);const vn=H(U,ft,xt),jr=!Rn(vn)||Jt;if(!xt&&w.state.next({name:U,type:L.type,values:_n(a)}),bo)return(p.isValid||g.isValid)&&(e.mode==="onBlur"?xt&&E():xt||E()),jr&&w.state.next({name:U,...Jt?{}:vn});if(!xt&&Jt&&w.state.next({...n}),e.resolver){const{errors:Gt}=await ee([U]);if(he(ft),ae){const hr=v0(n.errors,r,U),Wr=v0(Gt,r,hr.name||U);Ee=Wr.error,U=Wr.name,Xe=Rn(Gt)}}else T([U],!0),Ee=(await w0(ye,l.disabled,a,v,e.shouldUseNativeValidation))[U],T([U]),he(ft),ae&&(Ee?Xe=!1:(p.isValid||g.isValid)&&(Xe=await de(r,!0)));ae&&(ye._f.deps&&te(ye._f.deps),K(U,Xe,Ee,vn))}},$=(L,J)=>{if(Fe(n.errors,J)&&L.focus)return L.focus(),1},te=async(L,J={})=>{let U,ae;const ye=Tc(L);if(e.resolver){const he=await W(nn(L)?L:ye);U=Rn(he),ae=L?!ye.some(Ee=>Fe(he,Ee)):U}else L?(ae=(await Promise.all(ye.map(async he=>{const Ee=Fe(r,he);return await de(Ee&&Ee._f?{[he]:Ee}:Ee)}))).every(Boolean),!(!ae&&!n.isValid)&&E()):ae=U=await de(r);return w.state.next({...!Co(L)||(p.isValid||g.isValid)&&U!==n.isValid?{}:{name:L},...e.resolver||!L?{isValid:U}:{},errors:n.errors}),J.shouldFocus&&!ae&&kc(r,$,L?ye:l.mount),ae},_e=L=>{const J={...s.mount?a:o};return nn(L)?J:Co(L)?Fe(J,L):L.map(U=>Fe(J,U))},ke=(L,J)=>({invalid:!!Fe((J||n).errors,L),isDirty:!!Fe((J||n).dirtyFields,L),error:Fe((J||n).errors,L),isValidating:!!Fe(n.validatingFields,L),isTouched:!!Fe((J||n).touchedFields,L)}),xe=L=>{L&&Tc(L).forEach(J=>on(n.errors,J)),w.state.next({errors:L?n.errors:{}})},Pe=(L,J,U)=>{const ae=(Fe(r,L,{_f:{}})._f||{}).ref,ye=Fe(n.errors,L)||{},{ref:he,message:Ee,type:Xe,...ft}=ye;$t(n.errors,L,{...ft,...J,ref:ae}),w.state.next({name:L,errors:n.errors,isValid:!1}),U&&U.shouldFocus&&ae&&ae.focus&&ae.focus()},Te=(L,J)=>Gr(L)?w.state.subscribe({next:U=>L(q(void 0,J),U)}):q(L,J,!0),z=L=>w.state.subscribe({next:J=>{R3(L.name,J.name,L.exact)&&M3(J,L.formState||p,zt,L.reRenderRoot)&&L.callback({values:{...a},...n,...J})}}).unsubscribe,ce=L=>(s.mount=!0,g={...g,...L.formState},z({...L,formState:g})),Ae=(L,J={})=>{for(const U of L?Tc(L):l.mount)l.mount.delete(U),l.array.delete(U),J.keepValue||(on(r,U),on(a,U)),!J.keepError&&on(n.errors,U),!J.keepDirty&&on(n.dirtyFields,U),!J.keepTouched&&on(n.touchedFields,U),!J.keepIsValidating&&on(n.validatingFields,U),!e.shouldUnregister&&!J.keepDefaultValue&&on(o,U);w.state.next({values:_n(a)}),w.state.next({...n,...J.keepDirty?{isDirty:fe()}:{}}),!J.keepIsValid&&E()},Ce=({disabled:L,name:J})=>{(wo(L)&&s.mount||L||l.disabled.has(J))&&(L?l.disabled.add(J):l.disabled.delete(J))},Ne=(L,J={})=>{let U=Fe(r,L);const ae=wo(J.disabled)||wo(e.disabled);return $t(r,L,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:L}},name:L,mount:!0,...J}}),l.mount.add(L),U?Ce({disabled:wo(J.disabled)?J.disabled:e.disabled,name:L}):D(L,!0,J.value),{...ae?{disabled:J.disabled||e.disabled}:{},...e.progressive?{required:!!J.required,min:Ic(J.min),max:Ic(J.max),minLength:Ic(J.minLength),maxLength:Ic(J.maxLength),pattern:Ic(J.pattern)}:{},name:L,onChange:X,onBlur:X,ref:ye=>{if(ye){Ne(L,J),U=Fe(r,L);const he=nn(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Ee=A3(he),Xe=U._f.refs||[];if(Ee?Xe.find(ft=>ft===he):he===U._f.ref)return;$t(r,L,{_f:{...U._f,...Ee?{refs:[...Xe.filter(Lm),he,...Array.isArray(Fe(o,L))?[{}]:[]],ref:{type:he.type,name:L}}:{ref:he}}}),D(L,!1,void 0,he)}else U=Fe(r,L,{}),U._f&&(U._f.mount=!1),(e.shouldUnregister||J.shouldUnregister)&&!(b3(l.array,L)&&s.action)&&l.unMount.add(L)}}},ne=()=>e.shouldFocusError&&kc(r,$,l.mount),Ve=L=>{wo(L)&&(w.state.next({disabled:L}),kc(r,(J,U)=>{const ae=Fe(r,U);ae&&(J.disabled=ae._f.disabled||L,Array.isArray(ae._f.refs)&&ae._f.refs.forEach(ye=>{ye.disabled=ae._f.disabled||L}))},0,!1))},Qe=(L,J)=>async U=>{let ae;U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let ye=_n(a);if(w.state.next({isSubmitting:!0}),e.resolver){const{errors:he,values:Ee}=await ee();n.errors=he,ye=Ee}else await de(r);if(l.disabled.size)for(const he of l.disabled)$t(ye,he,void 0);if(on(n.errors,"root"),Rn(n.errors)){w.state.next({errors:{}});try{await L(ye,U)}catch(he){ae=he}}else J&&await J({...n.errors},U),ne(),setTimeout(ne);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Rn(n.errors)&&!ae,submitCount:n.submitCount+1,errors:n.errors}),ae)throw ae},Ct=(L,J={})=>{Fe(r,L)&&(nn(J.defaultValue)?Q(L,_n(Fe(o,L))):(Q(L,J.defaultValue),$t(o,L,_n(J.defaultValue))),J.keepTouched||on(n.touchedFields,L),J.keepDirty||(on(n.dirtyFields,L),n.isDirty=J.defaultValue?fe(L,_n(Fe(o,L))):fe()),J.keepError||(on(n.errors,L),p.isValid&&E()),w.state.next({...n}))},Yt=(L,J={})=>{const U=L?_n(L):o,ae=_n(U),ye=Rn(L),he=ye?o:ae;if(J.keepDefaultValues||(o=U),!J.keepValues){if(J.keepDirtyValues){const Ee=new Set([...l.mount,...Object.keys(Ac(o,a))]);for(const Xe of Array.from(Ee))Fe(n.dirtyFields,Xe)?$t(he,Xe,Fe(a,Xe)):Q(Xe,Fe(he,Xe))}else{if(Pm&&nn(L))for(const Ee of l.mount){const Xe=Fe(r,Ee);if(Xe&&Xe._f){const ft=Array.isArray(Xe._f.refs)?Xe._f.refs[0]:Xe._f.ref;if(Ou(ft)){const xt=ft.closest("form");if(xt){xt.reset();break}}}}for(const Ee of l.mount)Q(Ee,Fe(he,Ee))}a=_n(he),w.array.next({values:{...he}}),w.state.next({values:{...he}})}l={mount:J.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!p.isValid||!!J.keepIsValid||!!J.keepDirtyValues,s.watch=!!e.shouldUnregister,w.state.next({submitCount:J.keepSubmitCount?n.submitCount:0,isDirty:ye?!1:J.keepDirty?n.isDirty:!!(J.keepDefaultValues&&!Ti(L,o)),isSubmitted:J.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ye?{}:J.keepDirtyValues?J.keepDefaultValues&&a?Ac(o,a):n.dirtyFields:J.keepDefaultValues&&L?Ac(o,L):J.keepDirty?n.dirtyFields:{},touchedFields:J.keepTouched?n.touchedFields:{},errors:J.keepErrors?n.errors:{},isSubmitSuccessful:J.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},bt=(L,J)=>Yt(Gr(L)?L(a):L,J),rn=(L,J={})=>{const U=Fe(r,L),ae=U&&U._f;if(ae){const ye=ae.refs?ae.refs[0]:ae.ref;ye.focus&&(ye.focus(),J.shouldSelect&&Gr(ye.select)&&ye.select())}},zt=L=>{n={...n,...L}},Kt={control:{register:Ne,unregister:Ae,getFieldState:ke,handleSubmit:Qe,setError:Pe,_subscribe:z,_runSchema:ee,_getWatch:q,_getDirty:fe,_setValid:E,_setFieldArray:N,_setDisabledField:Ce,_setErrors:_,_getFieldArray:Z,_reset:Yt,_resetDefaultValues:()=>Gr(e.defaultValues)&&e.defaultValues().then(L=>{bt(L,e.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:se,_disableForm:Ve,_subjects:w,_proxyFormState:p,get _fields(){return r},get _formValues(){return a},get _state(){return s},set _state(L){s=L},get _defaultValues(){return o},get _names(){return l},set _names(L){l=L},get _formState(){return n},get _options(){return e},set _options(L){e={...e,...L}}},subscribe:ce,trigger:te,register:Ne,handleSubmit:Qe,watch:Te,setValue:Q,getValues:_e,reset:bt,resetField:Ct,clearErrors:xe,unregister:Ae,setError:Pe,setFocus:rn,getFieldState:ke};return{...Kt,formControl:Kt}}function U3(t={}){const e=M.useRef(void 0),n=M.useRef(void 0),[r,o]=M.useState({isDirty:!1,isValidating:!1,isLoading:Gr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:Gr(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...t.formControl?t.formControl:H3(t),formState:r},t.formControl&&t.defaultValues&&!Gr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions));const a=e.current.control;return a._options=t,_3(()=>{const s=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(l=>({...l,isReady:!0})),a._formState.isReady=!0,s},[a]),M.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),M.useEffect(()=>{t.mode&&(a._options.mode=t.mode),t.reValidateMode&&(a._options.reValidateMode=t.reValidateMode),t.errors&&!Rn(t.errors)&&a._setErrors(t.errors)},[a,t.errors,t.mode,t.reValidateMode]),M.useEffect(()=>{t.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,t.shouldUnregister]),M.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==r.isDirty&&a._subjects.state.next({isDirty:s})}},[a,r.isDirty]),M.useEffect(()=>{t.values&&!Ti(t.values,n.current)?(a._reset(t.values,a._options.resetOptions),n.current=t.values,o(s=>({...s}))):a._resetDefaultValues()},[a,t.values]),M.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),e.current.formState=S3(r,a),e.current}const C0=({className:t,children:e,content:n,side:r})=>{const[o,a]=M.useState(!1);return d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{open:o,children:[d.jsx(Jn,{asChild:!0,children:d.jsx("button",{type:"button",className:ze("cursor-pointer",t),onClick:()=>a(!o),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onTouchStart:()=>a(!o),onKeyDown:s=>{s.preventDefault(),s.key==="Enter"&&a(!o)},children:e})}),d.jsx(On,{side:r,className:n?"":"hidden",children:d.jsx("span",{className:"inline-block",children:n})})]})})},B3=(t,e)=>{const[n,r]=M.useState(t);return M.useEffect(()=>{const o=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(o)}},[t,e]),n},z3=({apiBaseUrl:t="http://localhost:3000"})=>{var D,H;const[e,n]=M.useState([]),[r,o]=M.useState(!1),[a,s]=M.useState([]),[l,u]=M.useState(1),[h,p]=M.useState(1),[g,w]=M.useState(null),[y,x]=M.useState(""),v=B3(y,500),b=K=>{const ee=K.match(/\d{6}/);if(!ee)return{month:"",year:""};const W=ee[0],de=W.substring(0,2),se=W.substring(2);return{month:de,year:se}},E=K=>K.map(W=>{let de=(W==null?void 0:W.month)||"",se=(W==null?void 0:W.year)||"";if((!de||!se)&&(W!=null&&W.file_name)){const fe=b(W.file_name);de=de||fe.month,se=se||fe.year}return{id:W==null?void 0:W.id,prefix:(W==null?void 0:W.prefix)||"",model:(W==null?void 0:W.model)||"",fileName:(W==null?void 0:W.file_name)||"",code:(W==null?void 0:W.stock_id)||"",month:de,year:se,content:(W==null?void 0:W.text_summary)||"",status:(W==null?void 0:W.status)||"",note:(W==null?void 0:W.note)||"",lastUpdate:W==null?void 0:W.updated_at,stock_id:W==null?void 0:W.stock_id}}),T=K=>{if(!(K!=null&&K.data))return[];const ee=E(K==null?void 0:K.data);n(ee),p(K.pagination.totalPages)},N=async(K=1,ee=15)=>{w(K),o(!0);try{const W=await Le.get(`${t}/api/latest-summaries`,{params:{page:K,limit:ee,search:y}});(W==null?void 0:W.status)===200?T(W.data):console.error(W)}catch(W){console.error("Error fetching data:",W)}finally{w(null),o(!1)}};M.useEffect(()=>{v&&u(1),N(l)},[l,v]);const P=M.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:ee})=>d.jsx("span",{className:"flex flex-col",children:ee.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:ee})=>{const W=ee.original.month,de=ee.original.year;return d.jsx("span",{className:"flex flex-col",children:`${W.toString().padStart(2,"0")}/${de}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:ee})=>{const W=ee.getValue("content");return d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:W})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:ee})=>{const de=ee.original.status!=="unpublish";return d.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${de?"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:de?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:ee})=>d.jsx(C0,{content:d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:ee.original.note}),children:d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:ee.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:ee})=>{const W=new Date(ee.original.lastUpdate),de=W.getDate(),se=W.getMonth()+1,fe=`ngày ${de} tháng ${se}`;return d.jsx("span",{className:"flex flex-col",children:fe})}},{accessorKey:"actions",header:()=>d.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:ee})=>{const[W,de]=M.useState(!1),[se,fe]=M.useState(!1),[q,Z]=M.useState(!1),{handleSubmit:Y,register:oe,reset:Q}=U3(),X=ee.original.id,$=ee.getValue("status"),te=ee.getValue("content"),[_e,ke]=M.useState(!1),xe=async()=>{try{ke(!0);const Te=$==="unpublish"?"published":"unpublish",z=await Le.patch(`${t}/api/toggle-publish/${X}`,{id:X,typeAction:"update",status:$,idInput:X,stock_id:ee.original.stock_id,prefix:ee.original.prefix,model:ee.original.model,summary_result:ee.original.content,note:ee.original.note});z.status===200?n(ce=>ce.map(Ae=>Ae.id===X?{...Ae,status:Te}:Ae)):console.error("Failed to toggle publish status:",z)}catch(Te){console.error("Error toggling publish status:",Te)}finally{ke(!1)}},Pe=async Te=>{de(!0);try{const z=await Le.patch(`${t}/api/update-summary`,{note:Te.note,text_summary:Te.content,id:X});z.status===200?(await N(l),fe(!1)):console.error("Failed to update summary:",z)}catch(z){console.error("Error updating summary:",z)}return de(!1)};return d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx(He,{variant:"outline",size:"sm",onClick:()=>Z(!0),className:"px-2 py-0.5 h-7",children:d.jsx(Ux,{className:"h-4 w-4"})}),d.jsx(lr,{open:q,onOpenChange:Z,children:d.jsxs(Vn,{className:"max-w-3xl max-h-[80vh]",children:[d.jsx(Kn,{children:d.jsx(Gn,{children:"Nội dung chi tiết"})}),d.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:d.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:te})})]})}),d.jsxs(lr,{open:se,onOpenChange:Te=>{fe(Te),Te?Q({content:ee.original.content,note:ee.original.note}):Q()},children:[d.jsx(uc,{asChild:!0,children:d.jsx(He,{variant:"outline",size:"sm",onClick:()=>fe(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),d.jsx(Vn,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:d.jsxs(Kn,{className:"flex flex-col gap-3",children:[d.jsx(Gn,{className:"max-sm:hidden text-center",children:"Sửa summary"}),d.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:Y(Pe),children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Nội dung:"}),d.jsx(hc,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:ee.original.answer||"",rows:10,...oe("content")})]}),d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Ghi chú:"}),d.jsx(hc,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:ee.original.note||"",rows:1,...oe("note")})]})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(He,{disabled:W,type:"submit",variant:"default",children:W?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),d.jsx(He,{variant:"outline",size:"sm",onClick:xe,disabled:_e,className:"w-[70px] px-2 py-0.5 h-7",children:_e?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):$==="unpublish"?"Publish":"Unpublish"})]})}}],[]),_=jb({data:e,columns:P,state:{columnFilters:a},enableRowSelection:!0,onColumnFiltersChange:s,getFilteredRowModel:WM(),getCoreRowModel:Gb()});return d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:d.jsxs("div",{className:"relative max-w-sm",children:[d.jsx(jn,{placeholder:"Tìm kiếm theo mã...",value:y,onChange:K=>x(K.target.value),className:"pr-8"}),y&&d.jsx(He,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>x(""),children:d.jsx(lg,{className:"h-4 w-4"})})]})}),d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Zd,{className:"s3-explr-table",children:[d.jsx(eu,{className:"s3-explr-table-header",children:_.getHeaderGroups().map(K=>d.jsx(Hr,{className:"hover:bg-transparent s3-explr-header-row",children:K.headers.map(ee=>d.jsx(po,{className:"s3-explr-header-cell",children:ee.isPlaceholder?null:Td(ee.column.columnDef.header,ee.getContext())},ee.id))},K.id))}),d.jsx(tu,{className:"s3-explr-table-body",children:r?d.jsx(Hr,{children:d.jsx(Wn,{colSpan:P.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(D=_.getRowModel().rows)!=null&&D.length?(H=_.getRowModel().rows)==null?void 0:H.map(K=>d.jsx(Hr,{className:"h-12 s3-explr-row",children:K.getVisibleCells().map(ee=>d.jsx(Wn,{className:"align-middle s3-explr-cell",children:Td(ee.column.columnDef.cell,ee.getContext())},ee.id))},K.id)):d.jsx(Hr,{children:d.jsx(Wn,{colSpan:P.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(qd,{children:d.jsxs(Yd,{children:[d.jsx($r,{children:d.jsx(Jd,{onClick:()=>u(K=>Math.max(1,K-1)),className:l===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:h},(K,ee)=>ee+1).filter(K=>K===1||K===h||Math.abs(K-l)<=1).map((K,ee,W)=>d.jsxs(d.Fragment,{children:[ee>0&&W[ee-1]!==K-1&&d.jsx($r,{children:d.jsx(Xd,{})},K+"..."),d.jsx($r,{children:d.jsx(Qa,{onClick:()=>u(K),isActive:l===K,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===K?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):K})},K)]})),d.jsx($r,{children:d.jsx(Qd,{onClick:()=>u(K=>Math.min(h,K+1)),className:l===h||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},b0=10,V3=M.memo(({apiBaseUrl:t="http://localhost:3000"})=>{const[e,n]=M.useState(1),[r,o]=M.useState([]),[a,s]=M.useState({total:0,page:1,limit:b0,totalPages:1}),[l,u]=M.useState(!0),[h,p]=M.useState(null),[g,w]=M.useState(new Set),{toast:y}=mc(),[x,v]=M.useState(!1),b=async _=>{try{p(_);const D=await Le.get(`${t}/api/jobs`,{params:{page:_.toString(),limit:b0.toString()}});o(D.data.data),s(D.data.pagination)}catch{y({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{p(null),u(!1)}};M.useEffect(()=>{b(e)},[e,t]);const E=async _=>{w(D=>new Set(D).add(_.toString()));try{await Le.post(`${t}/api/retry-job`,{jobId:_}),y({title:"Job Restarted",description:`Job ${_} has been successfully restarted.`}),b(e)}catch{y({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${_}. Please try again.`})}finally{w(D=>{const H=new Set(D);return H.delete(_.toString()),H})}},T=async()=>{v(!0),n(1),await b(1),v(!1)},N=_=>new Date(_).toLocaleString(),P=_=>{if(_=parseFloat(_),_<60)return`${_.toFixed(2)}s`;const D=Math.floor(_/60),H=(_%60).toFixed(0);return`${D}m ${H}s`};return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[d.jsx(HD,{className:"w-8 h-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),d.jsx(He,{variant:"outline",size:"icon",onClick:T,disabled:x||l,className:"ml-2",children:d.jsx(jD,{className:`h-4 w-4 ${x?"animate-spin":""}`})})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(Zd,{children:[d.jsx(eu,{children:d.jsxs(Hr,{children:[d.jsx(po,{children:"ID"}),d.jsx(po,{children:"Tên Công Việc"}),d.jsx(po,{children:"Thời Gian Bắt Đầu"}),d.jsx(po,{children:"Thời Gian Cập Nhật"}),d.jsx(po,{children:"Thời Gian Thực Thi"}),d.jsx(po,{children:"Trạng Thái"}),d.jsx(po,{children:"Thao Tác"})]})}),d.jsx(tu,{children:l&&r.length===0?d.jsx(Hr,{children:d.jsx(Wn,{colSpan:7,className:"text-center py-4",children:d.jsx(Et,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(_=>{var D,H;return d.jsxs(Hr,{children:[d.jsx(Wn,{className:"!w-[100px]",children:_.id}),d.jsx(Wn,{className:"font-medium",children:(D=_.job_name)==null?void 0:D.replace("Upload file","Summary")}),d.jsx(Wn,{className:"!w-[200px]",children:N(_.created_at)}),d.jsx(Wn,{className:"!w-[200px]",children:N(_.updated_at)}),d.jsx(Wn,{className:"!w-[150px]",children:P(_.execution_time_seconds)}),d.jsx(Wn,{className:"!w-[200px]",children:d.jsx(C0,{content:_.status==="fail"&&_.error?d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:_.error}):null,children:d.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]
227
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GE(t,e){if(t){if(typeof t=="string")return fm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fm(t,e)}}function fm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $U(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,a=!1,s,l;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(u){a=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(a)throw l}}return r}}function HU(t){if(Array.isArray(t))return t}function jE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Bt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jE(Object(n),!0).forEach(function(r){hm(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function hm(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Su(t,e){if(t==null)return{};var n=UU(t,e),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)r=a[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function UU(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var pm=M.forwardRef(function(t,e){var n=t.children,r=Su(t,kU),o=qE(r),a=o.open,s=Su(o,NU);return M.useImperativeHandle(e,function(){return{open:a}},[a]),M.createElement(M.Fragment,null,n(Bt(Bt({},s),{},{open:a})))});pm.displayName="Dropzone";var WE={disabled:!1,getFilesFromEvent:XH,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};pm.defaultProps=WE,pm.propTypes={children:Nt.func,accept:Nt.objectOf(Nt.arrayOf(Nt.string)),multiple:Nt.bool,preventDropOnDocument:Nt.bool,noClick:Nt.bool,noKeyboard:Nt.bool,noDrag:Nt.bool,noDragEventsBubbling:Nt.bool,minSize:Nt.number,maxSize:Nt.number,maxFiles:Nt.number,disabled:Nt.bool,getFilesFromEvent:Nt.func,onFileDialogCancel:Nt.func,onFileDialogOpen:Nt.func,useFsAccessApi:Nt.bool,autoFocus:Nt.bool,onDragEnter:Nt.func,onDragLeave:Nt.func,onDragOver:Nt.func,onDrop:Nt.func,onDropAccepted:Nt.func,onDropRejected:Nt.func,onError:Nt.func,validator:Nt.func};var gm={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function qE(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Bt(Bt({},WE),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,a=e.maxSize,s=e.minSize,l=e.multiple,u=e.maxFiles,h=e.onDragEnter,p=e.onDragLeave,g=e.onDragOver,w=e.onDrop,y=e.onDropAccepted,x=e.onDropRejected,v=e.onFileDialogCancel,b=e.onFileDialogOpen,E=e.useFsAccessApi,T=e.autoFocus,N=e.preventDropOnDocument,P=e.noClick,_=e.noKeyboard,D=e.noDrag,H=e.noDragEventsBubbling,K=e.onError,ee=e.validator,W=M.useMemo(function(){return TU(n)},[n]),de=M.useMemo(function(){return EU(n)},[n]),se=M.useMemo(function(){return typeof b=="function"?b:YE},[b]),he=M.useMemo(function(){return typeof v=="function"?v:YE},[v]),q=M.useRef(null),Z=M.useRef(null),Y=M.useReducer(BU,gm),oe=um(Y,2),Q=oe[0],X=oe[1],$=Q.isFocused,te=Q.isFileDialogActive,_e=M.useRef(typeof window<"u"&&window.isSecureContext&&E&&_U()),ke=function(){!_e.current&&te&&setTimeout(function(){if(Z.current){var ae=Z.current.files;ae.length||(X({type:"closeDialog"}),he())}},300)};M.useEffect(function(){return window.addEventListener("focus",ke,!1),function(){window.removeEventListener("focus",ke,!1)}},[Z,te,he,_e]);var xe=M.useRef([]),Pe=function(ae){q.current&&q.current.contains(ae.target)||(ae.preventDefault(),xe.current=[])};M.useEffect(function(){return N&&(document.addEventListener("dragover",zE,!1),document.addEventListener("drop",Pe,!1)),function(){N&&(document.removeEventListener("dragover",zE),document.removeEventListener("drop",Pe))}},[q,N]),M.useEffect(function(){return!r&&T&&q.current&&q.current.focus(),function(){}},[q,T,r]);var Te=M.useCallback(function(U){K?K(U):console.error(U)},[K]),z=M.useCallback(function(U){U.preventDefault(),U.persist(),Dn(U),xe.current=[].concat(MU(xe.current),[U.target]),xu(U)&&Promise.resolve(o(U)).then(function(ae){if(!(bu(U)&&!H)){var ye=ae.length,pe=ye>0&&CU({files:ae,accept:W,minSize:s,maxSize:a,multiple:l,maxFiles:u,validator:ee}),Ee=ye>0&&!pe;X({isDragAccept:pe,isDragReject:Ee,isDragActive:!0,type:"setDraggedFiles"}),h&&h(U)}}).catch(function(ae){return Te(ae)})},[o,h,Te,H,W,s,a,l,u,ee]),ce=M.useCallback(function(U){U.preventDefault(),U.persist(),Dn(U);var ae=xu(U);if(ae&&U.dataTransfer)try{U.dataTransfer.dropEffect="copy"}catch{}return ae&&g&&g(U),!1},[g,H]),Ae=M.useCallback(function(U){U.preventDefault(),U.persist(),Dn(U);var ae=xe.current.filter(function(pe){return q.current&&q.current.contains(pe)}),ye=ae.indexOf(U.target);ye!==-1&&ae.splice(ye,1),xe.current=ae,!(ae.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),xu(U)&&p&&p(U))},[q,p,H]),Ce=M.useCallback(function(U,ae){var ye=[],pe=[];U.forEach(function(Ee){var Qe=UE(Ee,W),ft=um(Qe,2),xt=ft[0],bo=ft[1],Jt=BE(Ee,s,a),vn=um(Jt,2),jr=vn[0],Gt=vn[1],hr=ee?ee(Ee):null;if(xt&&jr&&!hr)ye.push(Ee);else{var Wr=[bo,Gt];hr&&(Wr=Wr.concat(hr)),pe.push({file:Ee,errors:Wr.filter(function(oa){return oa})})}}),(!l&&ye.length>1||l&&u>=1&&ye.length>u)&&(ye.forEach(function(Ee){pe.push({file:Ee,errors:[wU]})}),ye.splice(0)),X({acceptedFiles:ye,fileRejections:pe,isDragReject:pe.length>0,type:"setFiles"}),w&&w(ye,pe,ae),pe.length>0&&x&&x(pe,ae),ye.length>0&&y&&y(ye,ae)},[X,l,W,s,a,u,w,y,x,ee]),Ne=M.useCallback(function(U){U.preventDefault(),U.persist(),Dn(U),xe.current=[],xu(U)&&Promise.resolve(o(U)).then(function(ae){bu(U)&&!H||Ce(ae,U)}).catch(function(ae){return Te(ae)}),X({type:"reset"})},[o,Ce,Te,H]),ne=M.useCallback(function(){if(_e.current){X({type:"openDialog"}),se();var U={multiple:l,types:de};window.showOpenFilePicker(U).then(function(ae){return o(ae)}).then(function(ae){Ce(ae,null),X({type:"closeDialog"})}).catch(function(ae){AU(ae)?(he(ae),X({type:"closeDialog"})):IU(ae)?(_e.current=!1,Z.current?(Z.current.value=null,Z.current.click()):Te(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Te(ae)});return}Z.current&&(X({type:"openDialog"}),se(),Z.current.value=null,Z.current.click())},[X,se,he,E,Ce,Te,de,l]),Ve=M.useCallback(function(U){!q.current||!q.current.isEqualNode(U.target)||(U.key===" "||U.key==="Enter"||U.keyCode===32||U.keyCode===13)&&(U.preventDefault(),ne())},[q,ne]),Xe=M.useCallback(function(){X({type:"focus"})},[]),Ct=M.useCallback(function(){X({type:"blur"})},[]),Yt=M.useCallback(function(){P||(SU()?setTimeout(ne,0):ne())},[P,ne]),bt=function(ae){return r?null:ae},rn=function(ae){return _?null:bt(ae)},zt=function(ae){return D?null:bt(ae)},Dn=function(ae){H&&ae.stopPropagation()},Kt=M.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=U.refKey,ye=ae===void 0?"ref":ae,pe=U.role,Ee=U.onKeyDown,Qe=U.onFocus,ft=U.onBlur,xt=U.onClick,bo=U.onDragEnter,Jt=U.onDragOver,vn=U.onDragLeave,jr=U.onDrop,Gt=Su(U,PU);return Bt(Bt(hm({onKeyDown:rn(yo(Ee,Ve)),onFocus:rn(yo(Qe,Xe)),onBlur:rn(yo(ft,Ct)),onClick:bt(yo(xt,Yt)),onDragEnter:zt(yo(bo,z)),onDragOver:zt(yo(Jt,ce)),onDragLeave:zt(yo(vn,Ae)),onDrop:zt(yo(jr,Ne)),role:typeof pe=="string"&&pe!==""?pe:"presentation"},ye,q),!r&&!_?{tabIndex:0}:{}),Gt)}},[q,Ve,Xe,Ct,Yt,z,ce,Ae,Ne,_,D,r]),L=M.useCallback(function(U){U.stopPropagation()},[]),J=M.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=U.refKey,ye=ae===void 0?"ref":ae,pe=U.onChange,Ee=U.onClick,Qe=Su(U,OU),ft=hm({accept:W,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:bt(yo(pe,Ne)),onClick:bt(yo(Ee,L)),tabIndex:-1},ye,Z);return Bt(Bt({},ft),Qe)}},[Z,n,l,Ne,r]);return Bt(Bt({},Q),{},{isFocused:$&&!r,getRootProps:Kt,getInputProps:J,rootRef:q,inputRef:Z,open:bt(ne)})}function BU(t,e){switch(e.type){case"focus":return Bt(Bt({},t),{},{isFocused:!0});case"blur":return Bt(Bt({},t),{},{isFocused:!1});case"openDialog":return Bt(Bt({},gm),{},{isFileDialogActive:!0});case"closeDialog":return Bt(Bt({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return Bt(Bt({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return Bt(Bt({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return Bt({},gm);default:return t}}function YE(){}const zU=({onFilesSelected:t,children:e})=>{const[n,r]=M.useState(!1),{getRootProps:o,getInputProps:a}=qE({noClick:!0,onDrop:s=>{if(s&&s.length>0)if(s[0].path.split("/").length>2){const u=s.map(h=>{const g=(h.path||h.relativePath||"").split("/").slice(1).join("/");return(!h.webkitRelativePath||h.webkitRelativePath==="")&&Object.defineProperty(h,"webkitRelativePath",{writable:!0,value:g,enumerable:!0,configurable:!0}),h});t(u,"folder")}else t(s,"files");r(!1)},onDragOver:s=>{s.preventDefault(),n||r(!0)},multiple:!0});return M.useEffect(()=>{const s=l=>{l.clientX===0&&l.clientY===0&&r(!1)};return document.addEventListener("dragleave",s),()=>{document.removeEventListener("dragleave",s)}},[]),d.jsxs("div",{...o(),className:"transition-opacity min-h-[600px]",children:[n?d.jsx("div",{className:"flex flex-col items-center justify-center p-4 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50 h-screen"}):e,d.jsx("input",{...a()})]})},VU=({openDialogRename:t,setOpenDialogRename:e,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:a,ignoreCache:s,autoSyncAfterFileOperation:l})=>{var N;const[u,h]=M.useState({}),[p,g]=M.useState(!1),[w,y]=M.useState(!1),[x,v]=M.useState(""),{toast:b}=mc();M.useEffect(()=>{t&&E(x)},[x,t]);const E=async P=>{try{y(!0);const _=await Le.get(`${n}/api/list-s3-folders?prefix=${P}`);h(_==null?void 0:_.data)}catch{b({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{y(!1)}},T=async()=>{g(!0);try{const P=o.key,_=P.endsWith("/")?P:`${P}/`,D=x.endsWith("/")?x:`${x}/`;if(_===D||P===x){b({title:"Lỗi",description:"Không thể di chuyển file đến cùng vị trí",variant:"destructive"}),g(!1);return}await Le.post(`${n}/api/move`,{oldPath:P,newPath:x}),s.current=!0,await a(),b({title:"Đã di chuyển",description:`Đã di chuyển thành công "${o.name}" đến "${x}"`}),e(!1),r(null),v(""),l&&await l("move")}catch(P){console.error("Error renaming item:",P),b({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{g(!1)}};return d.jsx(lr,{open:t,onOpenChange:P=>{P||(e(!1),r(null),v(""))},children:d.jsxs(Vn,{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:[d.jsxs(Kn,{className:"mb-4 w-full h-full",children:[d.jsx("nav",{className:"mb-4",children:d.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),x.split("/").map((P,_,D)=>d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(P==="Root"?"":D.slice(0,_+1).join("/")+"/"),children:P},_))]})}),d.jsxs(Gn,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",d.jsxs("span",{className:"text-sm text-gray-500",children:["( file hoặc folder sẽ được di chuyển đến thư mục"," ",x===""?"Root":x," )"]})]}),d.jsx(Ci,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:w?d.jsx("div",{className:"flex justify-center items-center py-4",children:d.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):d.jsx("ul",{className:"space-y-2",children:(N=Object.keys(u))==null?void 0:N.map(P=>d.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(P),children:P},P))})})]}),d.jsxs(Fr,{className:"flex justify-end space-x-2",children:[d.jsx(He,{variant:"outline",onClick:()=>e(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),d.jsx(He,{onClick:T,disabled:p,className:"s3-explr-crawl-btn",children:"Move"})]})]})})};function JE(t,[e,n]){return Math.min(n,Math.max(e,t))}function KU(t){const e=t+"CollectionProvider",[n,r]=yr(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:b,children:E}=v,T=M.useRef(null),N=M.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:N,collectionRef:T,children:E})};s.displayName=e;const l=t+"CollectionSlot",u=mi(l),h=M.forwardRef((v,b)=>{const{scope:E,children:T}=v,N=a(l,E),P=rt(b,N.collectionRef);return d.jsx(u,{ref:P,children:T})});h.displayName=l;const p=t+"CollectionItemSlot",g="data-radix-collection-item",w=mi(p),y=M.forwardRef((v,b)=>{const{scope:E,children:T,...N}=v,P=M.useRef(null),_=rt(b,P),D=a(p,E);return M.useEffect(()=>(D.itemMap.set(P,{ref:P,...N}),()=>void D.itemMap.delete(P))),d.jsx(w,{[g]:"",ref:_,children:T})});y.displayName=p;function x(v){const b=a(t+"CollectionConsumer",v);return M.useCallback(()=>{const T=b.collectionRef.current;if(!T)return[];const N=Array.from(T.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((D,H)=>N.indexOf(D.ref.current)-N.indexOf(H.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},x,r]}var GU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mn=GU.reduce((t,e)=>{const n=mi(`Primitive.${e}`),r=C.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function jU(t,e){t&&Aa.flushSync(()=>t.dispatchEvent(e))}var WU="DismissableLayer",mm="dismissableLayer.update",qU="dismissableLayer.pointerDownOutside",YU="dismissableLayer.focusOutside",QE,XE=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ZE=C.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=t,h=C.useContext(XE),[p,g]=C.useState(null),w=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=C.useState({}),x=rt(e,H=>g(H)),v=Array.from(h.layers),[b]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=v.indexOf(b),T=p?v.indexOf(p):-1,N=h.layersWithOutsidePointerEventsDisabled.size>0,P=T>=E,_=XU(H=>{const K=H.target,ee=[...h.branches].some(W=>W.contains(K));!P||ee||(o==null||o(H),s==null||s(H),H.defaultPrevented||l==null||l())},w),D=ZU(H=>{const K=H.target;[...h.branches].some(W=>W.contains(K))||(a==null||a(H),s==null||s(H),H.defaultPrevented||l==null||l())},w);return HC(H=>{T===h.layers.size-1&&(r==null||r(H),!H.defaultPrevented&&l&&(H.preventDefault(),l()))},w),C.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(QE=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),eT(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=QE)}},[p,w,n,h]),C.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),eT())},[p,h]),C.useEffect(()=>{const H=()=>y({});return document.addEventListener(mm,H),()=>document.removeEventListener(mm,H)},[]),d.jsx(mn.div,{...u,ref:x,style:{pointerEvents:N?P?"auto":"none":void 0,...t.style},onFocusCapture:Ue(t.onFocusCapture,D.onFocusCapture),onBlurCapture:Ue(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Ue(t.onPointerDownCapture,_.onPointerDownCapture)})});ZE.displayName=WU;var JU="DismissableLayerBranch",QU=C.forwardRef((t,e)=>{const n=C.useContext(XE),r=C.useRef(null),o=rt(e,r);return C.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(mn.div,{...t,ref:o})});QU.displayName=JU;function XU(t,e=globalThis==null?void 0:globalThis.document){const n=gn(t),r=C.useRef(!1),o=C.useRef(()=>{});return C.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let u=function(){tT(qU,n,h,{discrete:!0})};const h={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=u,e.addEventListener("click",o.current,{once:!0})):u()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",a),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function ZU(t,e=globalThis==null?void 0:globalThis.document){const n=gn(t),r=C.useRef(!1);return C.useEffect(()=>{const o=a=>{a.target&&!r.current&&tT(YU,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function eT(){const t=new CustomEvent(mm);document.dispatchEvent(t)}function tT(t,e,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?jU(o,a):o.dispatchEvent(a)}var vm="focusScope.autoFocusOnMount",ym="focusScope.autoFocusOnUnmount",nT={bubbles:!1,cancelable:!0},eB="FocusScope",rT=C.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=t,[l,u]=C.useState(null),h=gn(o),p=gn(a),g=C.useRef(null),w=rt(e,v=>u(v)),y=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let v=function(N){if(y.paused||!l)return;const P=N.target;l.contains(P)?g.current=P:Si(g.current,{select:!0})},b=function(N){if(y.paused||!l)return;const P=N.relatedTarget;P!==null&&(l.contains(P)||Si(g.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const _ of N)_.removedNodes.length>0&&Si(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const T=new MutationObserver(E);return l&&T.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),T.disconnect()}}},[r,l,y.paused]),C.useEffect(()=>{if(l){aT.add(y);const v=document.activeElement;if(!l.contains(v)){const E=new CustomEvent(vm,nT);l.addEventListener(vm,h),l.dispatchEvent(E),E.defaultPrevented||(tB(aB(oT(l)),{select:!0}),document.activeElement===v&&Si(l))}return()=>{l.removeEventListener(vm,h),setTimeout(()=>{const E=new CustomEvent(ym,nT);l.addEventListener(ym,p),l.dispatchEvent(E),E.defaultPrevented||Si(v??document.body,{select:!0}),l.removeEventListener(ym,p),aT.remove(y)},0)}}},[l,h,p,y]);const x=C.useCallback(v=>{if(!n&&!r||y.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,E=document.activeElement;if(b&&E){const T=v.currentTarget,[N,P]=nB(T);N&&P?!v.shiftKey&&E===P?(v.preventDefault(),n&&Si(N,{select:!0})):v.shiftKey&&E===N&&(v.preventDefault(),n&&Si(P,{select:!0})):E===T&&v.preventDefault()}},[n,r,y.paused]);return d.jsx(mn.div,{tabIndex:-1,...s,ref:w,onKeyDown:x})});rT.displayName=eB;function tB(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Si(r,{select:e}),document.activeElement!==n)return}function nB(t){const e=oT(t),n=iT(e,t),r=iT(e.reverse(),t);return[n,r]}function oT(t){const e=[],n=document.createTreeWalker(t,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();)e.push(n.currentNode);return e}function iT(t,e){for(const n of t)if(!rB(n,{upTo:e}))return n}function rB(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function oB(t){return t instanceof HTMLInputElement&&"select"in t}function Si(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&oB(t)&&e&&t.select()}}var aT=iB();function iB(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=sT(t,e),t.unshift(e)},remove(e){var n;t=sT(t,e),(n=t[0])==null||n.resume()}}}function sT(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function aB(t){return t.filter(e=>e.tagName!=="A")}var sB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cB=sB.reduce((t,e)=>{const n=mi(`Primitive.${e}`),r=C.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),lB="Arrow",cT=C.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...a}=t;return d.jsx(cB.svg,{...a,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});cT.displayName=lB;var dB=cT,uB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lT=uB.reduce((t,e)=>{const n=mi(`Primitive.${e}`),r=C.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),wm="Popper",[dT,uT]=yr(wm),[fB,fT]=dT(wm),hT=t=>{const{__scopePopper:e,children:n}=t,[r,o]=C.useState(null);return d.jsx(fB,{scope:e,anchor:r,onAnchorChange:o,children:n})};hT.displayName=wm;var pT="PopperAnchor",gT=C.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,a=fT(pT,n),s=C.useRef(null),l=rt(e,s);return C.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:d.jsx(lT.div,{...o,ref:l})});gT.displayName=pT;var Cm="PopperContent",[hB,pB]=dT(Cm),mT=C.forwardRef((t,e)=>{var z,ce,Ae,Ce,Ne,ne;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:x,...v}=t,b=fT(Cm,n),[E,T]=C.useState(null),N=rt(e,Ve=>T(Ve)),[P,_]=C.useState(null),D=vg(P),H=(D==null?void 0:D.width)??0,K=(D==null?void 0:D.height)??0,ee=r+(a!=="center"?"-"+a:""),W=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},de=Array.isArray(h)?h:[h],se=de.length>0,he={padding:W,boundary:de.filter(mB),altBoundary:se},{refs:q,floatingStyles:Z,placement:Y,isPositioned:oe,middlewareData:Q}=k_({strategy:"fixed",placement:ee,whileElementsMounted:(...Ve)=>E_(...Ve,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[N_({mainAxis:o+K,alignmentAxis:s}),u&&P_({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?O_():void 0,...he}),u&&M_({...he}),R_({...he,apply:({elements:Ve,rects:Xe,availableWidth:Ct,availableHeight:Yt})=>{const{width:bt,height:rn}=Xe.reference,zt=Ve.floating.style;zt.setProperty("--radix-popper-available-width",`${Ct}px`),zt.setProperty("--radix-popper-available-height",`${Yt}px`),zt.setProperty("--radix-popper-anchor-width",`${bt}px`),zt.setProperty("--radix-popper-anchor-height",`${rn}px`)}}),P&&L_({element:P,padding:l}),vB({arrowWidth:H,arrowHeight:K}),w&&D_({strategy:"referenceHidden",...he})]}),[X,$]=wT(Y),te=gn(x);tn(()=>{oe&&(te==null||te())},[oe,te]);const _e=(z=Q.arrow)==null?void 0:z.x,ke=(ce=Q.arrow)==null?void 0:ce.y,xe=((Ae=Q.arrow)==null?void 0:Ae.centerOffset)!==0,[Pe,Te]=C.useState();return tn(()=>{E&&Te(window.getComputedStyle(E).zIndex)},[E]),d.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:oe?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Pe,"--radix-popper-transform-origin":[(Ce=Q.transformOrigin)==null?void 0:Ce.x,(Ne=Q.transformOrigin)==null?void 0:Ne.y].join(" "),...((ne=Q.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(hB,{scope:n,placedSide:X,onArrowChange:_,arrowX:_e,arrowY:ke,shouldHideArrow:xe,children:d.jsx(lT.div,{"data-side":X,"data-align":$,...v,ref:N,style:{...v.style,animation:oe?void 0:"none"}})})})});mT.displayName=Cm;var vT="PopperArrow",gB={top:"bottom",right:"left",bottom:"top",left:"right"},yT=C.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,a=pB(vT,r),s=gB[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(dB,{...o,ref:n,style:{...o.style,display:"block"}})})});yT.displayName=vT;function mB(t){return t!==null}var vB=t=>({name:"transformOrigin",options:t,fn(e){var b,E,T;const{placement:n,rects:r,middlewareData:o}=e,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,l=s?0:t.arrowWidth,u=s?0:t.arrowHeight,[h,p]=wT(n),g={start:"0%",center:"50%",end:"100%"}[p],w=(((E=o.arrow)==null?void 0:E.x)??0)+l/2,y=(((T=o.arrow)==null?void 0:T.y)??0)+u/2;let x="",v="";return h==="bottom"?(x=s?g:`${w}px`,v=`${-u}px`):h==="top"?(x=s?g:`${w}px`,v=`${r.floating.height+u}px`):h==="right"?(x=`${-u}px`,v=s?g:`${y}px`):h==="left"&&(x=`${r.floating.width+u}px`,v=s?g:`${y}px`),{data:{x,y:v}}}});function wT(t){const[e,n="center"]=t.split("-");return[e,n]}var yB=hT,wB=gT,CB=mT,bB=yT,xB="Portal",CT=C.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[o,a]=C.useState(!1);tn(()=>a(!0),[]);const s=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?zf.createPortal(d.jsx(mn.div,{...r,ref:e}),s):null});CT.displayName=xB;var SB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_B=SB.reduce((t,e)=>{const n=mi(`Primitive.${e}`),r=C.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),bT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),EB="VisuallyHidden",TB=C.forwardRef((t,e)=>d.jsx(_B.span,{...t,ref:e,style:{...bT,...t.style}}));TB.displayName=EB;var AB=[" ","Enter","ArrowUp","ArrowDown"],IB=[" ","Enter"],Xi="Select",[_u,Eu,kB]=KU(Xi),[os,zj]=yr(Xi,[kB,uT]),Tu=uT(),[NB,_i]=os(Xi),[PB,OB]=os(Xi),xT=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:l,onValueChange:u,dir:h,name:p,autoComplete:g,disabled:w,required:y,form:x}=t,v=Tu(e),[b,E]=C.useState(null),[T,N]=C.useState(null),[P,_]=C.useState(!1),D=Cg(h),[H,K]=ui({prop:r,defaultProp:o??!1,onChange:a,caller:Xi}),[ee,W]=ui({prop:s,defaultProp:l,onChange:u,caller:Xi}),de=C.useRef(null),se=b?x||!!b.closest("form"):!0,[he,q]=C.useState(new Set),Z=Array.from(he).map(Y=>Y.props.value).join(";");return d.jsx(yB,{...v,children:d.jsxs(NB,{required:y,scope:e,trigger:b,onTriggerChange:E,valueNode:T,onValueNodeChange:N,valueNodeHasChildren:P,onValueNodeHasChildrenChange:_,contentId:Mo(),value:ee,onValueChange:W,open:H,onOpenChange:K,dir:D,triggerPointerDownPosRef:de,disabled:w,children:[d.jsx(_u.Provider,{scope:e,children:d.jsx(PB,{scope:t.__scopeSelect,onNativeOptionAdd:C.useCallback(Y=>{q(oe=>new Set(oe).add(Y))},[]),onNativeOptionRemove:C.useCallback(Y=>{q(oe=>{const Q=new Set(oe);return Q.delete(Y),Q})},[]),children:n})}),se?d.jsxs(KT,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:g,value:ee,onChange:Y=>W(Y.target.value),disabled:w,form:x,children:[ee===void 0?d.jsx("option",{value:""}):null,Array.from(he)]},Z):null]})})};xT.displayName=Xi;var ST="SelectTrigger",_T=C.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,a=Tu(n),s=_i(ST,n),l=s.disabled||r,u=rt(e,s.onTriggerChange),h=Eu(n),p=C.useRef("touch"),[g,w,y]=jT(v=>{const b=h().filter(N=>!N.disabled),E=b.find(N=>N.value===s.value),T=WT(b,v,E);T!==void 0&&s.onValueChange(T.value)}),x=v=>{l||(s.onOpenChange(!0),y()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return d.jsx(wB,{asChild:!0,...a,children:d.jsx(mn.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":GT(s.value)?"":void 0,...o,ref:u,onClick:Ue(o.onClick,v=>{v.currentTarget.focus(),p.current!=="mouse"&&x(v)}),onPointerDown:Ue(o.onPointerDown,v=>{p.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(x(v),v.preventDefault())}),onKeyDown:Ue(o.onKeyDown,v=>{const b=g.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&w(v.key),!(b&&v.key===" ")&&AB.includes(v.key)&&(x(),v.preventDefault())})})})});_T.displayName=ST;var ET="SelectValue",TT=C.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...l}=t,u=_i(ET,n),{onValueNodeHasChildrenChange:h}=u,p=a!==void 0,g=rt(e,u.onValueNodeChange);return tn(()=>{h(p)},[h,p]),d.jsx(mn.span,{...l,ref:g,style:{pointerEvents:"none"},children:GT(u.value)?d.jsx(d.Fragment,{children:s}):a})});TT.displayName=ET;var MB="SelectIcon",AT=C.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return d.jsx(mn.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});AT.displayName=MB;var RB="SelectPortal",IT=t=>d.jsx(CT,{asChild:!0,...t});IT.displayName=RB;var Zi="SelectContent",kT=C.forwardRef((t,e)=>{const n=_i(Zi,t.__scopeSelect),[r,o]=C.useState();if(tn(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?Aa.createPortal(d.jsx(NT,{scope:t.__scopeSelect,children:d.jsx(_u.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),a):null}return d.jsx(PT,{...t,ref:e})});kT.displayName=Zi;var Vr=10,[NT,Ei]=os(Zi),DB="SelectContentImpl",LB=mi("SelectContent.RemoveScroll"),PT=C.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:u,align:h,alignOffset:p,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:x,hideWhenDetached:v,avoidCollisions:b,...E}=t,T=_i(Zi,n),[N,P]=C.useState(null),[_,D]=C.useState(null),H=rt(e,z=>P(z)),[K,ee]=C.useState(null),[W,de]=C.useState(null),se=Eu(n),[he,q]=C.useState(!1),Z=C.useRef(!1);C.useEffect(()=>{if(N)return pb(N)},[N]),QC();const Y=C.useCallback(z=>{const[ce,...Ae]=se().map(ne=>ne.ref.current),[Ce]=Ae.slice(-1),Ne=document.activeElement;for(const ne of z)if(ne===Ne||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===ce&&_&&(_.scrollTop=0),ne===Ce&&_&&(_.scrollTop=_.scrollHeight),ne==null||ne.focus(),document.activeElement!==Ne))return},[se,_]),oe=C.useCallback(()=>Y([K,N]),[Y,K,N]);C.useEffect(()=>{he&&oe()},[he,oe]);const{onOpenChange:Q,triggerPointerDownPosRef:X}=T;C.useEffect(()=>{if(N){let z={x:0,y:0};const ce=Ce=>{var Ne,ne;z={x:Math.abs(Math.round(Ce.pageX)-(((Ne=X.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((ne=X.current)==null?void 0:ne.y)??0))}},Ae=Ce=>{z.x<=10&&z.y<=10?Ce.preventDefault():N.contains(Ce.target)||Q(!1),document.removeEventListener("pointermove",ce),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[N,Q,X]),C.useEffect(()=>{const z=()=>Q(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[Q]);const[$,te]=jT(z=>{const ce=se().filter(Ne=>!Ne.disabled),Ae=ce.find(Ne=>Ne.ref.current===document.activeElement),Ce=WT(ce,z,Ae);Ce&&setTimeout(()=>Ce.ref.current.focus())}),_e=C.useCallback((z,ce,Ae)=>{const Ce=!Z.current&&!Ae;(T.value!==void 0&&T.value===ce||Ce)&&(ee(z),Ce&&(Z.current=!0))},[T.value]),ke=C.useCallback(()=>N==null?void 0:N.focus(),[N]),xe=C.useCallback((z,ce,Ae)=>{const Ce=!Z.current&&!Ae;(T.value!==void 0&&T.value===ce||Ce)&&de(z)},[T.value]),Pe=r==="popper"?bm:OT,Te=Pe===bm?{side:l,sideOffset:u,align:h,alignOffset:p,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:x,hideWhenDetached:v,avoidCollisions:b}:{};return d.jsx(NT,{scope:n,content:N,viewport:_,onViewportChange:D,itemRefCallback:_e,selectedItem:K,onItemLeave:ke,itemTextRefCallback:xe,focusSelectedItem:oe,selectedItemText:W,position:r,isPositioned:he,searchRef:$,children:d.jsx(_p,{as:LB,allowPinchZoom:!0,children:d.jsx(rT,{asChild:!0,trapped:T.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:Ue(o,z=>{var ce;(ce=T.trigger)==null||ce.focus({preventScroll:!0}),z.preventDefault()}),children:d.jsx(ZE,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:d.jsx(Pe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:z=>z.preventDefault(),...E,...Te,onPlaced:()=>q(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:Ue(E.onKeyDown,z=>{const ce=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!ce&&z.key.length===1&&te(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let Ce=se().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(z.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const Ne=z.target,ne=Ce.indexOf(Ne);Ce=Ce.slice(ne+1)}setTimeout(()=>Y(Ce)),z.preventDefault()}})})})})})})});PT.displayName=DB;var FB="SelectItemAlignedPosition",OT=C.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,a=_i(Zi,n),s=Ei(Zi,n),[l,u]=C.useState(null),[h,p]=C.useState(null),g=rt(e,H=>p(H)),w=Eu(n),y=C.useRef(!1),x=C.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:E,focusSelectedItem:T}=s,N=C.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&h&&v&&b&&E){const H=a.trigger.getBoundingClientRect(),K=h.getBoundingClientRect(),ee=a.valueNode.getBoundingClientRect(),W=E.getBoundingClientRect();if(a.dir!=="rtl"){const Ne=W.left-K.left,ne=ee.left-Ne,Ve=H.left-ne,Xe=H.width+Ve,Ct=Math.max(Xe,K.width),Yt=window.innerWidth-Vr,bt=JE(ne,[Vr,Math.max(Vr,Yt-Ct)]);l.style.minWidth=Xe+"px",l.style.left=bt+"px"}else{const Ne=K.right-W.right,ne=window.innerWidth-ee.right-Ne,Ve=window.innerWidth-H.right-ne,Xe=H.width+Ve,Ct=Math.max(Xe,K.width),Yt=window.innerWidth-Vr,bt=JE(ne,[Vr,Math.max(Vr,Yt-Ct)]);l.style.minWidth=Xe+"px",l.style.right=bt+"px"}const de=w(),se=window.innerHeight-Vr*2,he=v.scrollHeight,q=window.getComputedStyle(h),Z=parseInt(q.borderTopWidth,10),Y=parseInt(q.paddingTop,10),oe=parseInt(q.borderBottomWidth,10),Q=parseInt(q.paddingBottom,10),X=Z+Y+he+Q+oe,$=Math.min(b.offsetHeight*5,X),te=window.getComputedStyle(v),_e=parseInt(te.paddingTop,10),ke=parseInt(te.paddingBottom,10),xe=H.top+H.height/2-Vr,Pe=se-xe,Te=b.offsetHeight/2,z=b.offsetTop+Te,ce=Z+Y+z,Ae=X-ce;if(ce<=xe){const Ne=de.length>0&&b===de[de.length-1].ref.current;l.style.bottom="0px";const ne=h.clientHeight-v.offsetTop-v.offsetHeight,Ve=Math.max(Pe,Te+(Ne?ke:0)+ne+oe),Xe=ce+Ve;l.style.height=Xe+"px"}else{const Ne=de.length>0&&b===de[0].ref.current;l.style.top="0px";const Ve=Math.max(xe,Z+v.offsetTop+(Ne?_e:0)+Te)+Ae;l.style.height=Ve+"px",v.scrollTop=ce-xe+v.offsetTop}l.style.margin=`${Vr}px 0`,l.style.minHeight=$+"px",l.style.maxHeight=se+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,h,v,b,E,a.dir,r]);tn(()=>N(),[N]);const[P,_]=C.useState();tn(()=>{h&&_(window.getComputedStyle(h).zIndex)},[h]);const D=C.useCallback(H=>{H&&x.current===!0&&(N(),T==null||T(),x.current=!1)},[N,T]);return d.jsx(HB,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:D,children:d.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:d.jsx(mn.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});OT.displayName=FB;var $B="SelectPopperPosition",bm=C.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Vr,...a}=t,s=Tu(n);return d.jsx(CB,{...s,...a,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});bm.displayName=$B;var[HB,xm]=os(Zi,{}),Sm="SelectViewport",MT=C.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...o}=t,a=Ei(Sm,n),s=xm(Sm,n),l=rt(e,a.onViewportChange),u=C.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(_u.Slot,{scope:n,children:d.jsx(mn.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ue(o.onScroll,h=>{const p=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w!=null&&w.current&&g){const y=Math.abs(u.current-p.scrollTop);if(y>0){const x=window.innerHeight-Vr*2,v=parseFloat(g.style.minHeight),b=parseFloat(g.style.height),E=Math.max(v,b);if(E<x){const T=E+y,N=Math.min(x,T),P=T-N;g.style.height=N+"px",g.style.bottom==="0px"&&(p.scrollTop=P>0?P:0,g.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});MT.displayName=Sm;var RT="SelectGroup",[UB,BB]=os(RT),zB=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Mo();return d.jsx(UB,{scope:n,id:o,children:d.jsx(mn.div,{role:"group","aria-labelledby":o,...r,ref:e})})});zB.displayName=RT;var DT="SelectLabel",LT=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=BB(DT,n);return d.jsx(mn.div,{id:o.id,...r,ref:e})});LT.displayName=DT;var Au="SelectItem",[VB,FT]=os(Au),$T=C.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=t,l=_i(Au,n),u=Ei(Au,n),h=l.value===r,[p,g]=C.useState(a??""),[w,y]=C.useState(!1),x=rt(e,T=>{var N;return(N=u.itemRefCallback)==null?void 0:N.call(u,T,r,o)}),v=Mo(),b=C.useRef("touch"),E=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(VB,{scope:n,value:r,disabled:o,textId:v,isSelected:h,onItemTextChange:C.useCallback(T=>{g(N=>N||((T==null?void 0:T.textContent)??"").trim())},[]),children:d.jsx(_u.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:d.jsx(mn.div,{role:"option","aria-labelledby":v,"data-highlighted":w?"":void 0,"aria-selected":h&&w,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:x,onFocus:Ue(s.onFocus,()=>y(!0)),onBlur:Ue(s.onBlur,()=>y(!1)),onClick:Ue(s.onClick,()=>{b.current!=="mouse"&&E()}),onPointerUp:Ue(s.onPointerUp,()=>{b.current==="mouse"&&E()}),onPointerDown:Ue(s.onPointerDown,T=>{b.current=T.pointerType}),onPointerMove:Ue(s.onPointerMove,T=>{var N;b.current=T.pointerType,o?(N=u.onItemLeave)==null||N.call(u):b.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ue(s.onPointerLeave,T=>{var N;T.currentTarget===document.activeElement&&((N=u.onItemLeave)==null||N.call(u))}),onKeyDown:Ue(s.onKeyDown,T=>{var P;((P=u.searchRef)==null?void 0:P.current)!==""&&T.key===" "||(IB.includes(T.key)&&E(),T.key===" "&&T.preventDefault())})})})})});$T.displayName=Au;var _c="SelectItemText",HT=C.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...a}=t,s=_i(_c,n),l=Ei(_c,n),u=FT(_c,n),h=OB(_c,n),[p,g]=C.useState(null),w=rt(e,E=>g(E),u.onItemTextChange,E=>{var T;return(T=l.itemTextRefCallback)==null?void 0:T.call(l,E,u.value,u.disabled)}),y=p==null?void 0:p.textContent,x=C.useMemo(()=>d.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=h;return tn(()=>(v(x),()=>b(x)),[v,b,x]),d.jsxs(d.Fragment,{children:[d.jsx(mn.span,{id:u.textId,...a,ref:w}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Aa.createPortal(a.children,s.valueNode):null]})});HT.displayName=_c;var UT="SelectItemIndicator",BT=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return FT(UT,n).isSelected?d.jsx(mn.span,{"aria-hidden":!0,...r,ref:e}):null});BT.displayName=UT;var _m="SelectScrollUpButton",KB=C.forwardRef((t,e)=>{const n=Ei(_m,t.__scopeSelect),r=xm(_m,t.__scopeSelect),[o,a]=C.useState(!1),s=rt(e,r.onScrollButtonChange);return tn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=u.scrollTop>0;a(h)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?d.jsx(zT,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});KB.displayName=_m;var Em="SelectScrollDownButton",GB=C.forwardRef((t,e)=>{const n=Ei(Em,t.__scopeSelect),r=xm(Em,t.__scopeSelect),[o,a]=C.useState(!1),s=rt(e,r.onScrollButtonChange);return tn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<h;a(p)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?d.jsx(zT,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});GB.displayName=Em;var zT=C.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,a=Ei("SelectScrollButton",n),s=C.useRef(null),l=Eu(n),u=C.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return C.useEffect(()=>()=>u(),[u]),tn(()=>{var p;const h=l().find(g=>g.ref.current===document.activeElement);(p=h==null?void 0:h.ref.current)==null||p.scrollIntoView({block:"nearest"})},[l]),d.jsx(mn.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:Ue(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ue(o.onPointerMove,()=>{var h;(h=a.onItemLeave)==null||h.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ue(o.onPointerLeave,()=>{u()})})}),jB="SelectSeparator",VT=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return d.jsx(mn.div,{"aria-hidden":!0,...r,ref:e})});VT.displayName=jB;var Tm="SelectArrow",WB=C.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Tu(n),a=_i(Tm,n),s=Ei(Tm,n);return a.open&&s.position==="popper"?d.jsx(bB,{...o,...r,ref:e}):null});WB.displayName=Tm;var qB="SelectBubbleInput",KT=C.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const o=C.useRef(null),a=rt(r,o),s=iS(e);return C.useEffect(()=>{const l=o.current;if(!l)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==e&&p){const g=new Event("change",{bubbles:!0});p.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(mn.select,{...n,style:{...bT,...n.style},ref:a,defaultValue:e})});KT.displayName=qB;function GT(t){return t===""||t===void 0}function jT(t){const e=gn(t),n=C.useRef(""),r=C.useRef(0),o=C.useCallback(s=>{const l=n.current+s;e(l),function u(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[e]),a=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function WT(t,e,n){const o=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let s=YB(t,Math.max(a,0));o.length===1&&(s=s.filter(h=>h!==n));const u=s.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function YB(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var JB=xT,qT=_T,QB=TT,XB=AT,ZB=IT,YT=kT,e3=MT,JT=LT,QT=$T,t3=HT,n3=BT,XT=VT;const Am=JB,Im=QB,Iu=C.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(qT,{ref:r,className:ze("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[e,d.jsx(XB,{asChild:!0,children:d.jsx(UD,{className:"h-4 w-4 opacity-50"})})]}));Iu.displayName=qT.displayName;const ku=C.forwardRef(({className:t,children:e,position:n="popper",...r},o)=>d.jsx(ZB,{children:d.jsx(YT,{ref:o,className:ze("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:d.jsx(e3,{className:ze("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));ku.displayName=YT.displayName;const r3=C.forwardRef(({className:t,...e},n)=>d.jsx(JT,{ref:n,className:ze("px-2 py-1.5 text-sm font-semibold",t),...e}));r3.displayName=JT.displayName;const ea=C.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(QT,{ref:r,className:ze("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(n3,{children:d.jsx($x,{className:"h-4 w-4"})})}),d.jsx(t3,{children:e})]}));ea.displayName=QT.displayName;const o3=C.forwardRef(({className:t,...e},n)=>d.jsx(XT,{ref:n,className:ze("-mx-1 my-1 h-px bg-muted",t),...e}));o3.displayName=XT.displayName;const km=[{value:"VIEW_DOCUMENT",label:"Chỉ xem"},{value:"EDIT_DOCUMENT",label:"Chỉnh sửa"},{value:"DOWNLOAD_DOCUMENT",label:"Tải xuống"}];function i3({onClose:t,open:e,file:n,apiBaseUrl:r,rootUrlHostApi:o}){const[a,s]=M.useState("users"),[l,u]=M.useState(""),[h,p]=M.useState(""),[g,w]=M.useState(""),[y,x]=M.useState(""),[v,b]=M.useState(zr.VIEW_DOCUMENT),[E,T]=M.useState([]),{users:N,groups:P,sharedUsers:_,sharedGroups:D,fetchData:H,loading:K,postGranted:ee,loadingGrandted:W,setSharedGroups:de,setSharedUsers:se}=$H(r,o),he=Wi(),q=n?n.key:"",Z=N.filter(z=>{var ce;return(he==null?void 0:he.id)!==z.id&&(z.username.toLowerCase().includes(l.toLowerCase())||((ce=z.email)==null?void 0:ce.toLowerCase().includes(l.toLowerCase())))}),Y=P.filter(z=>z.groupname.toLowerCase().includes(h.toLowerCase())),oe=_.filter(z=>{var ce,Ae;return((ce=z.username)==null?void 0:ce.toLowerCase().includes(g.toLowerCase()))||((Ae=z.email)==null?void 0:Ae.toLowerCase().includes(g.toLowerCase()))}),Q=D.filter(z=>{var ce;return(ce=z.groupname)==null?void 0:ce.toLowerCase().includes(y.toLowerCase())}),X=z=>{b(z),T(ce=>ce.map(Ae=>({...Ae,permissions:z})))},$=()=>{a==="users"?(u(""),w("")):(p(""),x(""),s("users")),T([]),b(zr.VIEW_DOCUMENT)};M.useEffect(()=>{e?H(q):$()},[e,q]);const te=z=>{z!==a&&(a==="users"?(u(""),w("")):(p(""),x(""))),s(z)},_e=z=>{n&&T(ce=>{if(ce.find(ne=>ne.userId===z))return ce.filter(ne=>ne.userId!==z);const Ne={path:n.key+n.name,permissions:v,userId:z,grandtedBy:he==null?void 0:he.id};return[...ce,Ne]})},ke=z=>{if(!n)return;const ce=z.groupname;T(Ae=>{if(Ae.find(Ve=>Ve.groupname===ce))return Ae.filter(Ve=>Ve.groupname!==ce);const ne={path:n.key+n.name,permissions:v,groupname:ce,groupId:z.id,grandtedBy:he==null?void 0:he.id,users:z.users};return[...Ae,ne]})},xe=async(z,ce,Ae)=>{const Ce={...z,permissions:ce};T(Ne=>{const ne=Ne.map(Xe=>Xe.id===Ce.id?Ce:Xe);return Ne.some(Xe=>Xe.id===Ce.id)||ne.push(Ce),ne}),Ae==="users"?se(Ne=>Ne.map(ne=>ne.id===z.id?Ce:ne)):de(Ne=>Ne.map(ne=>ne.id===z.id?Ce:ne))},Pe=async()=>{if(n){const z=(n==null?void 0:n.key)||""+(n==null?void 0:n.name),ce=await ee(z,he==null?void 0:he.id,E);(ce==null?void 0:ce.status)==200&&T([])}},Te="flex-1 min-h-0 overflow-y-auto border rounded-lg px-3 py-2 bg-background shadow-sm";return n?d.jsx(lr,{open:e,onOpenChange:t,children:d.jsxs(Vn,{className:"max-w-5xl h-[80vh] flex flex-col overflow-hidden",children:[d.jsx(Kn,{children:d.jsxs(Gn,{className:"text-lg font-semibold",children:["Chia sẻ tài liệu: ",n.name]})}),d.jsxs(_g,{defaultValue:"users",className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs(ru,{className:"grid grid-cols-2 w-1/2 mx-auto mb-4 bg-muted rounded-lg",children:[d.jsx(qi,{value:"users",className:"py-2",onClick:()=>te("users"),children:"Người dùng"}),d.jsx(qi,{value:"groups",className:"py-2",onClick:()=>te("groups"),children:"Nhóm"})]}),d.jsx(Yi,{value:"users",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với người dùng:"}),d.jsx(jn,{placeholder:"Tìm người dùng...",className:"mb-3 border-input bg-background shadow-sm",value:l,onChange:z=>u(z.target.value)}),d.jsx("div",{className:Te,children:K?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Et,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):Z.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy người dùng."}):d.jsx("ul",{className:"space-y-2",children:Z.map(z=>d.jsx("li",{onClick:()=>_e(z.id),className:"flex flex-col space-y-1 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsx(dc,{id:`user-${z.id}`,checked:!!E.find(ce=>ce.userId===z.id)}),d.jsxs(wr,{className:"flex-1",children:[d.jsx("p",{className:"font-medium",children:z.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.groupname})]})]})},z.id))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với người dùng:"}),d.jsx(jn,{placeholder:"Tìm người dùng đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:g,onChange:z=>w(z.target.value)}),d.jsx("div",{className:Te,children:K?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Et,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):oe.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với người dùng nào."}):d.jsx("ul",{className:"space-y-2",children:oe.map(z=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:z.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.groupname})]}),d.jsxs(Am,{value:z.permissions,onValueChange:ce=>xe(z,ce,"users"),disabled:z.permissions===zr.OWNER_DOCUMENT,children:[d.jsx(Iu,{className:"w-[120px]",children:d.jsx(Im,{placeholder:"Chọn quyền"})}),d.jsxs(ku,{children:[km.map(ce=>d.jsx(ea,{value:ce.value,children:ce.label},ce.value)),z.permissions===zr.OWNER_DOCUMENT&&d.jsx(ea,{value:zr.OWNER_DOCUMENT,children:"Chủ sở hữu"},zr.OWNER_DOCUMENT),d.jsx(ea,{value:"None",children:"Thu hồi"},"None")]})]})]},z.id))})})]})]})}),d.jsx(Yi,{value:"groups",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với nhóm:"}),d.jsx(jn,{placeholder:"Tìm nhóm...",className:"mb-3 border-input bg-background shadow-sm",value:h,onChange:z=>p(z.target.value)}),d.jsx("div",{className:Te,children:K?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Et,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):Y.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy nhóm."}):d.jsx("ul",{className:"space-y-2",children:Y.map(z=>d.jsxs("li",{onClick:()=>ke(z),className:"flex items-center space-x-3 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsx(dc,{id:`group-${z.groupname}`,checked:!!E.find(ce=>ce.groupname===z.groupname)}),d.jsxs(wr,{className:"font-medium",children:[d.jsx("p",{className:"font-medium",children:z.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",z.users||0]})]})]},z.groupname))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với nhóm:"}),d.jsx(jn,{placeholder:"Tìm nhóm đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:y,onChange:z=>x(z.target.value)}),d.jsx("div",{className:Te,children:K?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Et,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):Q.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với nhóm nào."}):d.jsx("ul",{className:"space-y-2",children:Q.map(z=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:z.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",z.users||0]})]}),d.jsxs(Am,{value:z.permissions,onValueChange:ce=>xe(z,ce,"groups"),children:[d.jsx(Iu,{className:"w-[120px]",children:d.jsx(Im,{placeholder:"Chọn quyền"})}),d.jsxs(ku,{children:[km.map(ce=>d.jsx(ea,{value:ce.value,children:ce.label},ce.value)),d.jsx(ea,{value:"None",children:"Thu hồi"},"None")]})]})]},z.groupname))})})]})]})})]}),d.jsxs("div",{className:"mt-4 bg-muted/50 p-4 rounded-lg",children:[d.jsx(wr,{className:"font-medium mb-2 block",children:"Phân quyền:"}),d.jsxs(Am,{value:v,onValueChange:X,children:[d.jsx(Iu,{className:"w-1/2 border border-input bg-background shadow-sm hover:bg-accent",children:d.jsx(Im,{placeholder:"Chọn quyền truy cập"})}),d.jsx(ku,{children:km.map(z=>d.jsx(ea,{value:z.value,className:"flex items-center gap-2",children:z.label}))})]})]}),d.jsxs(Fr,{children:[d.jsx(He,{variant:"outline",onClick:t,children:"Huỷ"}),d.jsx(He,{variant:"default",onClick:Pe,disabled:E.length===0||W,className:"w-[120px] justify-center",children:W?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):"Lưu thay đổi"})]})]})}):null}const a3={},s3="AIzaSyBI8KiTWudkw8iR5cjH7ZsA4JBN1NqJw8A",c3="726815747852-5deq413t8kd8j3mgj48d46eatjauapq5.apps.googleusercontent.com",l3="https://www.googleapis.com/auth/drive";Lo(Le,{retries:3,shouldResetTimeout:!0,retryCondition:t=>Lo.isRetryableError(t)&&t.config.method==="get"});const fr={current:!1},ZT="crawl:jobs",is="crawl:current_job",d3=t=>{const[e,n]=M.useState(null),[r,o]=M.useState(0);return M.useEffect(()=>{const a=localStorage.getItem(is);if(a){const s=JSON.parse(a);n(s),s!=null&&s.startTime&&o(Math.floor((Date.now()-s.startTime)/1e3))}},[]),M.useEffect(()=>{if(!(e!=null&&e.startTime))return;const a=setInterval(()=>{o(Math.floor((Date.now()-e.startTime)/1e3))},1e3);return()=>clearInterval(a)},[e==null?void 0:e.startTime]),M.useEffect(()=>{if(!(e!=null&&e.id))return;const a=async()=>{try{const u=(await Le.get(`${t}/api/crawl/${e.id}?taskId=${e.taskId}`)).data;n(h=>{if(!h)return null;const p={...h,status:u};return localStorage.setItem(is,JSON.stringify(p)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(is)},100),p})}catch(l){console.error("Error polling job status:",l)}},s=setInterval(a,3e3);return a(),()=>clearInterval(s)},[e==null?void 0:e.id,t]),{currentJob:e,elapsedTime:r,setCurrentJob:a=>{a&&!a.startTime&&(a.startTime=Date.now()),n(a),a?localStorage.setItem(is,JSON.stringify(a)):localStorage.removeItem(is)}}},Nu=(t,e)=>{const n=[],r=o=>{(t[o]||[]).forEach(s=>{n.push(s.key),s.isFolder&&r(s.key)})};return r(e),n},u3=(t,e)=>{const n=[];return(t[e]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Nu(t,o.key))}),n},f3=(t,e,n=[],r,o,a,s,l,u,h)=>{const[p,g]=M.useState({}),[w,y]=M.useState(!1),[x,v]=M.useState(null),[b,E]=M.useState(0),T=M.useRef(e);M.useEffect(()=>{T.current=e},[e]);const N=async()=>{var _;y(!0);try{const D=Wi(),H=await Le.get(`${t}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:T.current,userId:(D==null?void 0:D.id)||"",groupId:((_=D==null?void 0:D.group)==null?void 0:_.id)||"",groupname:(D==null?void 0:D.groupname)||""},timeout:3e5}),K=[];Bd.forEach(H.data,(ee,W)=>{l!=null&&l.has(W)&&Bd.forEach(ee,de=>{(u==null?void 0:u.current[de.key])!==!1&&K.push(de.key)})}),K.length&&(h==null||h(ee=>{const W=new Set(ee);return K.forEach(de=>W.add(de)),W})),g(H.data),v(null)}catch(D){v(D instanceof Error?D:new Error("Failed to fetch files"))}finally{y(!1),E(0),a("")}},P=async _=>{var D,H;try{if(!_)return;y(!0);const K=await Le.get(`${t}/api/search-db?query=${_}&rootPrefix=${e}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return g({[e]:((D=K==null?void 0:K.data)==null?void 0:D.result)||[]}),E(((H=K==null?void 0:K.data)==null?void 0:H.estimatedTotalHits)||0),K}catch(K){v(K instanceof Error?K:new Error("Failed to fetch files"))}finally{y(!1)}};return M.useEffect(()=>{!r&&!w&&N(),r&&!w&&P(r)},[r,o]),{data:p,isLoading:w,error:x,estimatedTotalHits:b,refetch:N}},ta=t=>{var r,o,a;const e=((a=(o=(r=t==null?void 0:t.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:a.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(e||"")},h3={auth:{clientId:"584d5fa9-5123-4602-a1a5-a3746a83745f",authority:"https://login.microsoftonline.com/consumers",redirectUri:a3.VITE_ONE_DRIVE_REDIRECT_URI||"https://s3-explorer.cmcts1.studio.ai.vn/sharepoint/redirect"}},p3=new hp(h3),Nm={[zr.VIEW_DOCUMENT]:1,[zr.DOWNLOAD_DOCUMENT]:2,[zr.EDIT_DOCUMENT]:10,[zr.OWNER_DOCUMENT]:100},na=t=>{const e=Wi();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Nm[t]>=10:!1},g3=t=>{const e=Wi();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Nm[t]>=2:!1},m3=t=>{const e=Wi();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Nm[t]>=1:!1},v3=M.memo(({homeLabel:t="Kho tài liệu",apiBaseUrl:e="http://localhost:3000",rootPrefix:n="",rootUrlHostApi:r="http://localhost:3003/api/v1",asSelector:o=!1,onSelected:a=h=>console.log("Đã chọn:",h),displayPrefixes:s,preSelectedFiles:l,idCreator:u})=>{var Ii;const[h,p]=M.useState([]),[g,w]=M.useState(""),[y,x]=M.useState(new Set(l)),[v,b]=M.useState(n),[E,T]=M.useState(""),[N,P]=M.useState(!1),[_,D]=M.useState(""),[H,K]=M.useState(!1),[ee,W]=M.useState(null),[de,se]=M.useState(null),[he,q]=M.useState(!1),[Z,Y]=M.useState(!1),[,oe]=M.useState(null),Q=M.useRef(null),{toast:X}=mc(),[$,te]=M.useState(null),[_e,ke]=M.useState(null),[xe,Pe]=M.useState(null),[Te,z]=M.useState(""),[ce,Ae]=M.useState(!1),[Ce,Ne]=M.useState(!1),[ne,Ve]=M.useState(new Set),[Xe,Ct]=M.useState(""),[Yt,bt]=M.useState(!1),[rn,zt]=M.useState(!1),[Dn,Kt]=M.useState("rename"),[L,J]=M.useState(!1),[U,ae]=M.useState(""),[ye,pe]=M.useState("1"),[Ee,Qe]=M.useState(!1),[ft,xt]=M.useState(!1),[bo,Jt]=M.useState(!1),[vn,jr]=M.useState(!1),[Gt,hr]=M.useState(1),[Wr,oa]=M.useState(!1),{currentJob:Je,elapsedTime:zo,setCurrentJob:Nc}=d3(e),[xo,ia]=M.useState(null),[aa,ss]=M.useState(""),[Lu,sa]=M.useState(!1),[cs,Fu]=M.useState(""),[Pc,$u]=M.useState(!1),[Oc,Hu]=M.useState(!1),[ls,Uu]=M.useState([]),[ca,Bu]=M.useState(!1),[ds,Fm]=M.useState(""),Vo=M.useRef({}),[Mc,Rc]=M.useState(null),$m=async A=>{Hu(!0);try{const O=await Le.get(`${r}get-knowledge-base/knowledge-base-name/${A}`,{headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjAyOTliMmIwLTk4MGEtNGQ1Yy04NjkyLWJjNjllM2I1NzZlMiIsInVzZXJuYW1lIjoiY21jX3RzX2FkbWluIiwiaWF0IjoxNzQ3MTk0MTg3fQ.7LB2rgd0fQnhZP_cFgTTCPMSYl0_apwffcNEd7oqjeM"}});O.status===200&&Uu(O.data.knowledgeBase.chatflows.map(G=>({...G,KnowledgeBaseId:O.data.knowledgeBase.knowledge_base_id})))}catch{}finally{Hu(!1)}};M.useEffect(()=>{cs&&r&&$m(cs)},[cs]),M.useEffect(()=>{console.log("pre selected files",l)},[l]);const[Pt,Dc]=M.useState(null),[x0,Hm]=M.useState(!1),[Lc,Fc]=M.useState(!1),[la,us]=M.useState(!1),[zu,Vu]=M.useState([]),[$c,Hc]=M.useState([]),[da,Uc]=M.useState([{id:"root",name:"OneDrive"}]),[Um,fs]=M.useState(!1),[hs,Bc]=M.useState([]),[Ku,Ko]=M.useState(!1),[ps,zc]=M.useState([]),[Vc,gs]=M.useState([]),[ms,Gu]=M.useState([]),[Kc,ua]=M.useState([{id:"root",name:"SharePoint"}]),[So,fa]=M.useState(!1),[Gc,jc]=M.useState([]),[gt,qr]=M.useState(null),[ju,vs]=M.useState(!1),[Bm,ha]=M.useState(!1),[Go,Wc]=M.useState(!1),Vm=new URL(window.location.href).searchParams.get("prefix")||""||E||n,[_0,Wu]=M.useState(null),{data:En,isLoading:ys,error:Km,estimatedTotalHits:pa,refetch:an}=f3(e,Vm,s,g,Gt,w,u,y,Vo,x),[qc,_o]=M.useState(!1),Yc=M.useRef(null),Jc=Wi(),Ht=(()=>{const A=localStorage.getItem("dataLogin");try{if(A){const O=JSON.parse(A);return(O==null?void 0:O.user)??null}}catch{return null}return null})();M.useEffect(()=>{if(!qc)return;function A(O){Yc.current&&!Yc.current.contains(O.target)&&_o(!1)}return document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}},[qc]);const Ot=async()=>{try{const A=await Le.get(`${e}/api/login-sharepoint`),{loginUrl:O}=A.data,G=window.open(O,"SharePoint Login","width=600,height=600");if(!G)throw new Error("Không thể mở cửa sổ pop-up");G.focus();const fe=setInterval(()=>{try{if(G.closed){clearInterval(fe);return}const be=G.location.href;if(be.includes("code=")){const Ie=new URL(be).searchParams.get("code");Ie&&(qu(Ie),G.close(),clearInterval(fe))}}catch(be){be instanceof Error&&!be.message.includes("cross-origin")&&console.error("SharePoint login error:",be)}},1e3)}catch(A){st.error("Lỗi khi đăng nhập SharePoint: "+(A instanceof Error?A.message:"Lỗi không xác định"))}},It=async()=>{try{zc([]),ua([{id:"root",name:"SharePoint"}]),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin),X({title:"Success",description:"Logged out from SharePoint"})}catch(A){console.error("Error logging out from SharePoint:",A),X({title:"Error",description:"Failed to logout from SharePoint",variant:"destructive"})}},qu=async A=>{try{const O=await Le.post(`${e}/api/get-sharepoint-access-token`,{code:A,userId:"1"}),{accessToken:G,refreshToken:fe}=O.data;localStorage.setItem("sharepoint_access_token",G),localStorage.setItem("refresh_sharepoint_access_token",fe),Fc(!0),fa(!0)}catch(O){console.error("❌ Error fetching SharePoint access token:",O),X({title:"Error",description:"Failed to connect to SharePoint",variant:"destructive"})}},Gm=async()=>{try{Ko(!0);const O=(await Le.post(`${e}/api/list-site-sharepoint`,{userId:"1"})).data.sites.map(G=>{const fe=new URL(G.webUrl);return{id:G.id,name:G.name,description:G.description,hostname:G.hostname||fe.hostname,sitePath:G.sitePath||fe.pathname.replace(/^\/+/,"")}});console.log("data",O),jc(O),Ko(!1)}catch(A){console.error("❌ Error fetching SharePoint sites:",A),X({title:"Error",description:"Failed to fetch SharePoint sites",variant:"destructive"}),Ko(!1)}},jm=async A=>{qr(A),console.log(A),await ws("root",A.name,A.hostname||"",A.sitePath||"")},ws=async(A,O,G,fe)=>{try{Ko(!0);const Ie=(await Le.post(`${e}/api/list-file-sharepoint`,{folderId:A,userId:"1",hostname:G,sitePath:fe})).data.files.map(Me=>({id:Me.id,name:Me.name,size:Me.size??0,lastModified:Me.lastModifiedDateTime?new Date(Me.lastModifiedDateTime):new Date,contentType:Me.mimeType??void 0,isFolder:Me.type==="folder",parentId:Me.parentId??""}));gs(Ie.filter(Me=>Me.isFolder)),zc(Ie.filter(Me=>!Me.isFolder)),fa(!0),ua(Me=>Me.some(Mt=>Mt.id===A)?Me:[...Me,{id:A,name:O==="root"?"SharePoint":O}]),Ko(!1)}catch(be){console.error("❌ Error fetching SharePoint files:",be),X({title:"Error",description:"Failed to fetch SharePoint files",variant:"destructive"}),Ko(!1)}},Wm=A=>{Gu(O=>O.some(fe=>fe.id===A.id)?O.filter(fe=>fe.id!==A.id):[...O,{id:A.id,name:A.name,size:A.size,lastModified:A.lastModified,contentType:A.contentType,isFolder:A.isFolder,parentId:A.parentId}])},qm=A=>{var G;ua(fe=>fe.slice(0,A+1));const O=(G=Kc[A])==null?void 0:G.id;O&&ws(O,"SharePoint",(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")},Yu=async(A,O)=>{const G=localStorage.getItem("sharepoint_access_token");if(!G){st.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const fe=st.loading("Đang đồng bộ SharePoint...",{position:"bottom-right",autoClose:!1});try{const be={prefix:O,folders:[],files:[],hostname:(gt==null?void 0:gt.hostname)||"",sitePath:(gt==null?void 0:gt.sitePath)||"",isAutoUpdateKB:Go,refreshAccessToken:localStorage.getItem("refresh_sharepoint_access_token")||""};A.forEach(Me=>{Me.isFolder?be.folders.push({id:Me.id,name:Me.name}):be.files.push({id:Me.id,name:Me.name})});const Ie=await Le.post(`${e}/api/sync-sharepoint-to-s3`,be,{headers:{Authorization:`Bearer ${G}`}});an(),st.update(fe,{render:`Đồng bộ thành công! Đã tải lên ${Ie.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"}),fa(!1)}catch(be){console.error("Lỗi khi đồng bộ file từ SharePoint:",be),st.update(fe,{render:"Không thể đồng bộ file từ SharePoint.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},Ju=()=>{fa(!1),zc([]),Gu([]),ua([{id:"root",name:"SharePoint"}])};M.useEffect(()=>{if(So){const O=new URLSearchParams(window.location.search).get("code");O&&(qu(O),window.history.replaceState({},document.title,window.location.pathname))}},[So]),M.useEffect(()=>{p3.initialize().then(()=>{Hm(!0)}).catch(A=>console.error("❌ Lỗi khởi tạo MSAL:",A))},[]),M.useEffect(()=>{sn()},[]);async function sn(){localStorage.getItem("onedrive_access_token")&&Fc(!0)}const Cs=A=>{Bc(O=>O.some(fe=>fe.id===A.id)?O.filter(fe=>fe.id!==A.id):[...O,{id:A.id,name:A.name,size:A.size,lastModified:A.lastModified,contentType:A.contentType,isFolder:A.isFolder,parentId:A.parentId}])};function Yr(A){if(A===0)return"0 B";const O=1024,G=["B","KB","MB","GB","TB"],fe=Math.floor(Math.log(A)/Math.log(O));return parseFloat((A/Math.pow(O,fe)).toFixed(1))+" "+G[fe]}function Qu(A){const O=new Date(A);return O.toLocaleDateString()+" "+O.toLocaleTimeString()}const Qc=async()=>{try{const A=await Le.get(`${e}/api/login-one-drive`),{loginUrl:O}=A.data,G=window.open(O,"OneDrive Login","width=600,height=600");if(!G)throw new Error("Không thể mở cửa sổ pop-up");G.focus();const fe=setInterval(()=>{try{if(G.closed){clearInterval(fe);return}const be=G.location.href;if(be.includes("code=")){const Ie=new URL(be).searchParams.get("code");Ie&&(Xu(Ie),G.close(),clearInterval(fe))}}catch(be){be instanceof Error&&!be.message.includes("cross-origin")&&console.error("OneDrive login error:",be)}},1e3)}catch(A){st.error("Lỗi khi đăng nhập OneDrive: "+(A instanceof Error?A.message:"Lỗi không xác định"))}},Qn=async()=>{try{await Le.post(`${e}/api/logout-one-drive`),localStorage.removeItem("onedrive_access_token"),st.success("Đã đăng xuất khỏi OneDrive"),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin)}catch(A){st.error("Lỗi khi đăng xuất OneDrive: "+(A instanceof Error?A.message:"Lỗi không xác định"))}},Xu=async A=>{try{const G=await Le.post(`${e}/api/get-one-drive-access-token`,{authorizationCode:A,userId:"1"}),{accessToken:fe}=G.data;localStorage.setItem("onedrive_access_token",fe),Fc(!0),us(!0),await ga("root","One Drive")}catch(O){console.error("❌ Lỗi khi lấy Access Token:",O)}},ga=async(A,O)=>{try{fs(!0);const be=(await Le.post(`${e}/api/list-file-one-drive`,{folderId:A,userId:"1"})).data.map(Ie=>({id:Ie.id,name:Ie.name,size:Ie.size??0,lastModified:Ie.lastModifiedDateTime?new Date(Ie.lastModifiedDateTime):new Date,contentType:Ie.mimeType??void 0,isFolder:Ie.type==="folder",parentId:Ie.parentId??""}));Vu(be.filter(Ie=>Ie.isFolder)),Hc(be.filter(Ie=>!Ie.isFolder)),us(!0),Uc(Ie=>Ie.some(Me=>Me.id===A)?Ie:[...Ie,{id:A,name:O==="root"?"OneDrive":O}]),fs(!1)}catch(G){console.error("Lỗi lấy danh sách file:",G),fs(!1)}},Zu=A=>{if(A===da.length-1)return;const O=da[A];O&&(Uc(da.slice(0,A+1)),ga(O.id,O.name))},ef=async(A,O)=>{const G=localStorage.getItem("onedrive_access_token");if(!G){st.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const fe=st.loading("Đang đồng bộ OneDrive...",{position:"bottom-right",autoClose:!1});try{const be={prefix:O,folders:[],files:[]};A.forEach(Me=>{Me.isFolder?be.folders.push({id:Me.id,name:Me.name}):be.files.push({id:Me.id,name:Me.name})});const Ie=await Le.post(`${e}/api/sync-one-drive-to-s3`,be,{headers:{Authorization:`Bearer ${G}`}});an(),st.update(fe,{render:`Đồng bộ thành công! Đã tải lên ${Ie.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(be){console.error("Lỗi khi đồng bộ file từ OneDrive:",be),st.update(fe,{render:"Không thể đồng bộ file từ OneDrive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},Xc=()=>{us(!1),Uc([{id:"root",name:"OneDrive"}]),Vu([]),Hc([]),Bc([]),fs(!1)},tf=pM({onSuccess:A=>{Wu(A.access_token),localStorage.setItem("google_access_token",A.access_token),Ln(A.access_token)},onError:()=>{console.log("Đăng nhập thất bại!")},scope:l3}),Ln=A=>{const O=document.createElement("script");O.src="https://apis.google.com/js/api.js",O.onload=()=>{window.gapi.load("picker",()=>Ym(A))},document.body.appendChild(O)},Ym=A=>{const O=new window.google.picker.DocsView(window.google.picker.ViewId.DOCS).setIncludeFolders(!0).setSelectFolderEnabled(!0).setOwnedByMe(!1),G=new window.google.picker.DocsView(window.google.picker.ViewId.DRIVE).setIncludeFolders(!0).setSelectFolderEnabled(!0);new window.google.picker.PickerBuilder().setDeveloperKey(s3).setOAuthToken(A).enableFeature(window.google.picker.Feature.MULTISELECT_ENABLED).setLocale("vi").addView(O).addView(G).setCallback(async be=>{if(be.action===window.google.picker.Action.PICKED){const Ie=be.docs.map(Me=>({id:Me.id,name:Me.name,mimeType:Me.mimeType}));await Xn(Ie,v)}}).build().setVisible(!0)},Xn=async(A,O="")=>{const G=localStorage.getItem("google_access_token");if(!G){console.error("❌ Không tìm thấy access token. Vui lòng đăng nhập lại."),st.error("Không tìm thấy access token. Vui lòng đăng nhập lại.",{position:"bottom-right"});return}const fe=st.loading("Đang đồng bộ...",{position:"bottom-right",autoClose:!1});try{const be={prefix:O,folders:[],files:[]};A.forEach(Me=>{Me.mimeType==="application/vnd.google-apps.folder"?be.folders.push({id:Me.id,name:Me.name}):be.files.push({id:Me.id,name:Me.name})});const Ie=await Le.post(`${e}/api/sync-drive-to-s3`,be,{headers:{Authorization:`Bearer ${G}`}});fr.current=!0,an(),st.update(fe,{render:`Đồng bộ thành công! Đã tải lên ${Ie.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(be){console.error("❌ Lỗi khi đồng bộ file từ Google Drive:",be),st.update(fe,{render:"Không thể đồng bộ file từ Google Drive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}};M.useEffect(()=>{const A=O=>{if(O.data.action==="logout"){const G=document.createElement("iframe");G.style.display="none",G.src="https://accounts.google.com/Logout",document.body.appendChild(G),setTimeout(()=>document.body.removeChild(G),2e3)}};return window.addEventListener("message",A),()=>window.removeEventListener("message",A)},[]),M.useEffect(()=>{const A=new Set(l);x(A)},[]),M.useEffect(()=>{Je!=null&&Je.status&&(Je.status.status==="completed"?(X({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${Je.url} với ${Je.status.completed} trang`}),fr.current=!0,an()):Je.status.status==="failed"&&X({title:"Thu thập website thất bại",description:`Không thể thu thập ${Je.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Ii=Je==null?void 0:Je.status)==null?void 0:Ii.status]);const nf=M.useMemo(()=>En[v]||[],[En,v]),Jr=M.useMemo(()=>nf.filter(A=>m3(A.permission)),[nf,v,En]),Zn=M.useMemo(()=>{const A={};return Jr.forEach((O,G)=>{y.has(O.key)&&(A[G]=!0)}),A},[y,Jr]),bs=A=>{const O=Nu(En,A);if(O.length===0)return y.has(A)?"all":"none";const G=O.filter(fe=>y.has(fe)).length;return G===0?"none":G===O.length?"all":"partial"},Qr=(A,O=!0)=>{if(v!==A){if(u&&!v)oa(!0),T(A+u),b(A+u);else if(oa(!0),T(A),b(A),O&&!o){const G=window.location.pathname==="/"?"":window.location.pathname,fe=A?`${window.location.origin}${G}?prefix=${encodeURIComponent(A)}`:`${window.location.origin}${G}`;window.history.pushState({path:fe},"",fe)}}},Lt=A=>{const O=A.lastIndexOf("/"),G=O>0?A.substring(0,O+1):"";G?(Qr(G),setTimeout(()=>{x(new Set([A]))},500)):x(new Set([A]))};M.useEffect(()=>{Wr&&(fr.current=!0,an().finally(()=>oa(!1)))},[Wr]);const Eo=async(A,O)=>{var G,fe;K(!0);try{if(Jr.some(Mt=>Mt.isFolder&&Mt.name.toLowerCase()===A.toLowerCase())){X({title:"Lỗi",description:`Thư mục "${A}" đã tồn tại trong thư mục hiện tại.`,variant:"destructive"}),K(!1);return}const Ie=`${O}${A}/`;if((await Le.post(`${e}/api/create-folder`,{prefix:Ie,userId:(Jc==null?void 0:Jc.id)||""})).status!==200){X({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}fr.current=!0,await an(),X({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${A}"`}),D(""),P(!1)}catch(be){console.error("Error creating folder:",be);const Ie=((fe=(G=be==null?void 0:be.response)==null?void 0:G.data)==null?void 0:fe.error)||"Không thể tạo thư mục";X({title:"Lỗi",description:Ie,variant:"destructive"})}finally{K(!1)}},ma=async(A,O,G)=>{var fe,be,Ie,Me,Mt,Zr,ya,Ts,il;oe(G),Jt(!0);try{if(Array.from(A).reduce((Tn,Cr)=>Tn+Cr.size,0)>=100*1024*1024){X({title:"Lỗi",description:"Tổng kích thước các tập tin vượt quá 100 MB",variant:"destructive"}),oe(null),Jt(!1);return}const Wo=Array.from(A).filter(Tn=>Tn.size===0);if(Wo.length>0){const Tn=Wo.map(Cr=>Cr.name).join(", ");X({title:"Lỗi tải lên",description:`Không thể tải lên tập tin rỗng: ${Tn}`,variant:"destructive"}),Jt(!1),oe(null);return}const qo=new FormData;if(Ht!=null&&Ht.id&&qo.append("metadata",JSON.stringify({creator:Ht.username,creatorId:Ht.id,DataSource:"Tệp tải lên"})),G==="folder"&&A[0]){const Tn=A[0].webkitRelativePath.split("/")[0];Tn&&qo.append("folderName",Tn)}qo.append("prefix",O),Array.from(A).forEach(Tn=>G==="folder"?qo.append("files",Tn,Tn.webkitRelativePath):qo.append("files",Tn)),fr.current=!0;const Qt=await Le.post(`${e}/api/check-files-existed`,qo,{headers:{"Content-Type":"multipart/form-data"}});if(((fe=Qt==null?void 0:Qt.data)==null?void 0:fe.status)===200)await Le.post(`${e}/api/upload`,qo,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),w(""),T(O),setTimeout(async()=>{oe(null),await an(),Jt(!1),await jo("upload")},500);else{if(((Ie=(be=Qt==null?void 0:Qt.data)==null?void 0:be.names)==null?void 0:Ie.length)>0&&!((Me=Qt==null?void 0:Qt.data)!=null&&Me.isFolder)){const Tn=Array.from(A).filter(Cr=>Qt.data.names.includes(Cr.name));ia(Tn),sa(!0)}(Mt=Qt==null?void 0:Qt.data)!=null&&Mt.isFolder&&((Zr=Qt==null?void 0:Qt.data)!=null&&Zr.name)&&(ss((ya=Qt==null?void 0:Qt.data)==null?void 0:ya.name),ia(A),sa(!0))}}catch(er){console.error("Lỗi tải lên:",er);const Wo=((il=(Ts=er==null?void 0:er.response)==null?void 0:Ts.data)==null?void 0:il.error)||"Không thể tải lên tập tin";X({title:"Lỗi",description:Wo,variant:"destructive"}),oe(null),Jt(!1)}},Jm=async()=>{var A,O;try{Jt(!0);const G=new FormData;if(xo){oe(aa?"folder":"files"),sa(!1);let fe=localStorage.getItem("dataLogin"),be;try{fe&&(fe=JSON.parse(fe),be=fe.user)}catch{fe=null}if(aa&&xo[0]){const Ie=xo[0].webkitRelativePath.split("/")[0];Ie&&G.append("folderName",Ie)}G.append("prefix",v),Array.from(xo).forEach(Ie=>aa&&xo[0]?G.append("files",Ie,Ie.webkitRelativePath):G.append("files",Ie)),be!=null&&be.id&&G.append("metadata",JSON.stringify({creator:be.username,creatorId:be.id,DataSource:"Tệp tải lên"})),await Le.post(`${e}/api/upload`,G,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),w(""),T(v),fr.current=!0}}catch(G){console.error("Lỗi tải lên:",G);const fe=((O=(A=G==null?void 0:G.response)==null?void 0:A.data)==null?void 0:O.error)||"Không thể tải lên tập tin";X({title:"Lỗi",description:fe,variant:"destructive"})}finally{setTimeout(async()=>{oe(null),await an(),Jt(!1),ss(""),ia(null),await jo("overwrite")},500)}},xs=async A=>{var O;try{if(await Le.delete(`${e}/api/files`,{data:{paths:[A.key]}}),y.has(A.key)){const fe=new Set(y);fe.delete(A.key),x(fe)}const G=((O=A.key)==null?void 0:O.replace(/^(.*?)(\/.*)?$/,(fe,be,Ie)=>!Ie||Ie==="/"?"":be+"/"))||"";T(G),fr.current=!0,X({title:"Đã xóa tập tin",description:`Đã xóa thành công "${A.name}"`}),W(null),await jo("delete")}catch(G){console.error("Error deleting file:",G),X({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{jr(!1),await an()}},Ss=A=>{const O=new Set(y),G=typeof A=="function"?A(Zn):A;new Set(Object.keys(Zn).map(Number)).forEach(be=>{const Ie=Jr[be];Ie&&(G[be]||(O.delete(Ie.key),Ie.isFolder&&Nu(En,Ie.key).forEach(Me=>O.delete(Me))))}),Object.entries(G).forEach(([be,Ie])=>{const Me=parseInt(be),Mt=Jr[Me];Mt&&Ie&&(O.add(Mt.key),Mt.isFolder&&Nu(En,Mt.key).forEach(Zr=>O.add(Zr)))}),x(O)},Qm=async()=>{var A;q(!0);try{const O=Array.from(y),G=O.map(be=>Object.values(En).flat().find(Ie=>Ie.key===be)).filter(be=>be!==void 0);if(G.length===0){X({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await Le.delete(`${e}/api/files`,{data:{paths:O}});const fe=((A=G[0])==null?void 0:A.key.replace(/^(.*?)(\/.*)?$/,(be,Ie,Me)=>!Me||Me==="/"?"":Ie+"/"))||"";T(fe),fr.current=!0,an(),X({title:"Đã xóa tập tin",description:`Đã xóa thành công ${G.length} mục`}),Y(!1),x(new Set),await jo("bulk-delete")}catch(O){console.error("Error deleting files:",O),X({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{q(!1)}},Xm=async(A,O)=>{if(!v.trim()){X({title:"Lỗi",description:"Không thể đổi tên tập tin hoặc thư mục ở thư mục gốc. Chỉ có thể xóa.",variant:"destructive"});return}Ne(!0);try{const G=A.key;let fe;A.isFolder?fe=G.split("/").slice(0,-2).join("/")+"/":fe=G.substring(0,G.lastIndexOf("/")+1);const be=fe+O+(A.isFolder?"/":"");await Le.post(`${e}/api/rename`,{oldPath:G,newPath:be}),fr.current=!0,await an(),X({title:"Đã đổi tên",description:`Đã đổi tên thành công "${A.name}" thành "${O}"`}),te(null),z(""),Pe(null),await jo("rename")}catch(G){console.error("Error renaming item:",G),X({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{Ne(!1)}},rf=async A=>{Ve(O=>new Set([...O,...A]));try{const O=await Le.post(`${e}/api/download`,{paths:A},{responseType:"blob"}),G=window.URL.createObjectURL(O.data),fe=document.createElement("a");fe.href=G;const be=O.headers["Content-Disposition"]||O.headers["content-disposition"],Ie=be==null?void 0:be.match(/filename="(.+)"/),Me=Ie?decodeURIComponent(Ie[1]):"download.zip";fe.setAttribute("download",Me),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),window.URL.revokeObjectURL(G),X({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${A.length} mục${A.length>1,""}`})}catch(O){console.error("Error downloading files:",O),X({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Ve(O=>{const G=new Set(O);return A.forEach(fe=>G.delete(fe)),G})}},va=v?v.replace(n,"").split("/").filter(Boolean):[],Ai=()=>{let A=Array.from(y).map(G=>({key:G}));A.length>1&&(A=A.filter(G=>G.key!==n));const O=G=>Bd.findIndex(A,fe=>!fe.key.endsWith("/")&&fe.key.startsWith(G))!==-1;return A=A.filter(G=>G.key.endsWith("/")?!O(G.key):!0),A},of=M.useMemo(()=>{const A=[...(Ht==null?void 0:Ht.role)!=="MASTER_ADMIN"&&(Ht==null?void 0:Ht.role)!=="SITE_ADMIN"&&(v===""||v==="/")?[]:[{id:"select",header:()=>{const O=u3(En,v),G=O.length>0&&O.every(be=>y.has(be)),fe=O.some(be=>y.has(be));return d.jsx(dc,{checked:G?!0:fe?"indeterminate":!1,onCheckedChange:be=>{if(be){const Ie=Jr.reduce((Me,Mt,Zr)=>(Me[Zr]=!0,Me),{});Ss(Ie)}else{for(const Ie of Array.from(y))Ie.startsWith(v)&&(y.delete(Ie),Vo.current[Ie]=!1);Bd.forEach(Vo.current,(Ie,Me)=>{Me.startsWith(v)&&(Vo.current[Me]=!1)}),Ss({})}},"aria-label":"Chọn tất cả"})},cell:({row:O})=>{const G=O.original;let be=G.isFolder?bs(G.key):y.has(G.key)?"all":"none";if(be==="none"&&G.key.endsWith("/")){for(const Ie of Array.from(y))if(Ie.startsWith(G.key)){be="all";break}}return d.jsx("div",{className:"flex items-center",children:d.jsx(dc,{checked:be==="partial"?"indeterminate":be==="all",onCheckedChange:Ie=>{var Mt,Zr;const Me={...Zn};if(Ie?Me[O.index]=!0:delete Me[O.index],Vo.current[((Mt=O.original)==null?void 0:Mt.key)||"_"]=!!Ie,(Zr=O.original)!=null&&Zr.key.endsWith("/"))for(const ya of Array.from(y))ya.startsWith(O.original.key)&&(Vo.current[O.original.key]=!1,y.delete(ya));Ss(Me)},"aria-label":"Chọn dòng"})})},enableSorting:!1}],{id:"fileName",header:({column:O})=>d.jsxs(He,{variant:"ghost",onClick:()=>O.toggleSorting(O.getIsSorted()==="asc"),children:["Tên tập tin",d.jsx(sg,{})]}),accessorKey:"name",cell:({row:O})=>{const G=O.original,fe=G.key.substring(0,G.key.lastIndexOf("/"))||"/",be=g.trim()!==""&&fe!==v,Ie=fe.split("/").filter(Boolean);return d.jsxs("div",{className:"flex flex-col group",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsxs("div",{className:`flex items-center gap-2 ${G.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{G.isFolder&&Qr(G.key)},children:[G.isFolder?d.jsx(Js,{className:"h-5 w-5 text-blue-500"}):null,G.name]}),d.jsx("button",{className:"ml-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Me=>{Me.stopPropagation(),navigator.clipboard.writeText(G.key),X({title:"Copied to clipboard",description:`Path: ${G.key}`,duration:2e3})},title:"Copy path to clipboard",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),be&&d.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[d.jsx(Js,{className:"h-4 w-4 text-gray-500 my-auto"}),d.jsxs("span",{className:"flex items-center ml-1",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Qr("")},children:"/"}),Ie.map((Me,Mt)=>d.jsxs("span",{className:"flex items-center",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Qr(Ie.slice(0,Mt+1).join("/")+"/")},children:Me}),Mt<Ie.length-1&&d.jsx("span",{children:"/"})]},Mt))]})]})]})}}];return o||A.push({id:"size",header:({column:O})=>d.jsxs(He,{variant:"ghost",onClick:()=>O.toggleSorting(O.getIsSorted()==="asc"),children:["Kích thước",d.jsx(sg,{})]}),accessorKey:"size",cell:({getValue:O,row:G})=>{const fe=O();return d.jsx("span",{children:G.original.isFolder?"-":Yr(fe)})}},{id:"lastModified",header:({column:O})=>d.jsxs(He,{variant:"ghost",onClick:()=>O.toggleSorting(O.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Sửa đổi lần cuối",d.jsx(sg,{})]}),accessorKey:"lastModified",cell:({row:O})=>{const G=O.original.lastModified;return d.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:d.jsx("span",{children:G&&Lx(G).isValid()?Lx(G).format("DD/MM/YYYY HH:mm"):"-"})})},size:200},{id:"actions",header:()=>d.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:O})=>d.jsxs("div",{className:"flex items-center gap-2",children:[v===""&&r&&d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>{Fu(O.original.key),$u(!0)},className:"h-8 w-8 p-0",children:ne.has(O.original.key)?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):d.jsx(vO,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Những Flow sử dụng Folder này làm Data"})]})}),d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:!O.original.isFolder&&d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>rf([O.original.key]),className:"h-8 w-8 p-0",disabled:!g3(O.original.permission)||ne.has(O.original.key),children:ne.has(O.original.key)?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):d.jsx(hO,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Tải xuống"})]})}),v.trim()!==""&&(na(O.original.permission)?d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>{te(O.original),z(O.original.name)},className:"h-8 w-8 p-0",disabled:!na(O.original.permission),children:d.jsx(_O,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Đổi tên"})]})}):d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>{console.log("call"),ke(O.original)},className:"h-8 w-8 p-0",disabled:O.original.isFolder,children:d.jsx(Ux,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Xem"})]})})),d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>{Ae(!0),se(O.original)},className:"h-8 w-8 p-0",disabled:!na(O.original.permission),children:d.jsx(KD,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Di chuyển"})]})}),!((Ht==null?void 0:Ht.role)!=="MASTER_ADMIN"&&(Ht==null?void 0:Ht.role)!=="SITE_ADMIN"&&(v===""||v==="/"))&&d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>W(O.original),className:"h-8 w-8 p-0",disabled:!na(O.original.permission),children:d.jsx(DC,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Xóa"})]})}),d.jsx(qn,{children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx(He,{variant:"ghost",size:"icon",onClick:()=>Rc(O.original),className:"h-8 w-8 p-0",disabled:!na(O.original.permission),children:d.jsx(RC,{className:"h-4 w-4"})})}),d.jsx(On,{children:"Chia sẻ"})]})})]})}),A},[y,Jr,Zn,ne,o]),_s=jb({data:Jr,columns:of,state:{rowSelection:Zn,sorting:h},onSortingChange:p,enableRowSelection:!0,onRowSelectionChange:Ss,getCoreRowModel:Gb(),getSortedRowModel:qM()}),Zc=async A=>{var O,G;bt(!0);try{if(ta(A)){const fe=await Le.get(`${e}/api/read-text`,{params:{path:A.key}});Ct(fe.data.content)}try{const fe=await Le.get(`${e}/api/read-json`,{params:{path:A.key+".metadata.json"}}),be=((G=(O=fe==null?void 0:fe.data)==null?void 0:O.content)==null?void 0:G.metadataAttributes)||null;return Pe({fullPath:$==null?void 0:$.key,...be})}catch{return Pe("Lỗi phân tích siêu dữ liệu")}}catch(fe){console.error("Error loading file content:",fe),X({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{bt(!1)}},el=async(A,O)=>{zt(!0);try{await Le.post(`${e}/api/modify-text`,{path:A.key,content:O}),X({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),fr.current=!0,await an(),te(null),Ct(""),Kt("rename"),await jo("edit-content")}catch(G){console.error("Error saving file content:",G),X({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{zt(!1)}},tl=async A=>{zt(!0);try{await Le.post(`${e}/api/modify-json`,{path:A.key+".metadata.json",content:{metadataAttributes:xe}}),X({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),fr.current=!0,await an(),te(null),Ct(""),Kt("rename")}catch(O){console.error("Error saving file content:",O),X({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{zt(!1)}};M.useEffect(()=>{$&&($.isFolder||Zc($),Kt("rename"))},[$]),M.useEffect(()=>{_e&&!_e.isFolder&&Zc(_e)},[_e]);const nl=async(A,O)=>{var G;if(Je){X({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}Qe(!0);try{if((await Le.get(A)).status!==200){X({title:"Lỗi",description:"Không thể lấy dữ liệu. Vui lòng kiểm tra lại đường dẫn.",variant:"destructive"}),Qe(!1);return}}catch{X({title:"Lỗi",description:"Đường dẫn không hợp lệ. Vui lòng kiểm tra lại.",variant:"destructive"}),Qe(!1);return}try{const{data:fe}=await Le.post(`${e}/api/crawl`,{url:A,limit:O,prefix:v,isAutoUpdateKB:Go});if(fe.id){Nc({id:fe.id,url:A,limit:O,prefix:v,taskId:((G=fe.task)==null?void 0:G.id)||""});const be=localStorage.getItem(ZT),Ie=be?JSON.parse(be):[];Ie.some(Me=>Me.id===fe.id)||(Ie.unshift({url:A,id:fe.id,limit:O,prefix:v,timestamp:Date.now()}),Ie.length>20&&(Ie.length=20),localStorage.setItem(ZT,JSON.stringify(Ie))),X({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${A} với giới hạn ${O}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),J(!1),ae(""),pe("1")}}catch(fe){console.error("Error crawling website:",fe),X({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Qe(!1)}},Zm=async()=>{try{if(!(Je!=null&&Je.id))return;Nc(null),localStorage.removeItem(is),X({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${Je.url}`})}catch(A){console.error("Error stopping job:",A),X({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};M.useEffect(()=>{if(o)return;const A=(O=!0)=>{const fe=new URL(window.location.href).searchParams.get("prefix")||"";fe?Qr(fe,!1):(O&&!l&&x(new Set),T(n),b(n),fr.current=!0,setTimeout(()=>{an()},0))};return A(!1),window.addEventListener("popstate",()=>A(!0)),()=>{window.removeEventListener("popstate",()=>A(!0))}},[]);const Es=async()=>{Bu(!0);try{await Le.post(`${e}/api/prediction-report`),X({title:"Xuất báo cáo thành công",description:"Báo cáo dự đoán đã được xuất"})}catch(A){console.error("Error exporting report:",A),X({title:"Lỗi",description:"Không thể xuất báo cáo dự đoán",variant:"destructive"})}finally{Bu(!1)}},rl=async()=>{try{const A=Wi();A&&(await Le.post(`${e}/api/start-ingestion-job`,{prefix:v,user_id:A.id,userName:A.username})).status===200&&await dn()}catch(A){xt(!1),console.log(A)}},jo=async A=>{try{ds&&v.includes(ds)&&(console.log(`Auto syncing knowledge base after ${A} operation`),await dn())}catch(O){console.log(`Error auto syncing after ${A}:`,O)}},Xr=M.useRef(),dn=async()=>{try{xt(!0);const A=await Le.post(`${e}/api/get-ingestion-job-status`,{prefix:v}),{status:O}=A==null?void 0:A.data;O==="FAILED"||O==="COMPLETE"||O==="STOPPED"||O==="STOPPING"||!O?(xt(!1),Xr.current&&(clearInterval(Xr.current),Xr.current=null),Dc(A==null?void 0:A.data)):(Xr.current||(Xr.current=setInterval(()=>dn(),5e3)),Dc(A==null?void 0:A.data))}catch(A){console.log(A)}},ol=()=>{const A=Array.from(y);let O;return v?O=A.filter(G=>G.startsWith(v)&&G!==v).length:O=new Set(A.filter(G=>G.split("/").shift())).size,`Đang chọn: ${O}`};return M.useEffect(()=>{const A=v==null?void 0:v.split("/")[0];return A!==ds&&(xt(!1),Xr.current&&(clearInterval(Xr.current),Xr.current=null),Fm(A||""),Dc(null),A&&dn()),()=>{}},[ds,v]),M.useEffect(()=>{So&&Gc.length===0&&(Gm(),qr(null))},[So]),M.useEffect(()=>{if(l)for(const A of Array.from(l))Vo.current[A]=!0},[]),d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx(l_,{}),d.jsx(lr,{open:Lu,onOpenChange:A=>{sa(A),A||(ss(""),ia(null),Jt(!1),oe(null))},children:d.jsxs(Vn,{children:[d.jsxs(Kn,{children:[d.jsx(Gn,{children:"Cảnh báo trùng lặp"}),d.jsxs(Ci,{children:[aa&&d.jsxs(d.Fragment,{children:["Folder $",aa," đã có."]}),xo&&xo.length>0&&d.jsxs(d.Fragment,{children:["Những tệp sau bị lặp:",d.jsx("ul",{className:"mt-2 list-disc pl-5 text-sm text-red-600",children:Array.from(xo).map((A,O)=>d.jsx("li",{children:A.name},O))})]})]})]}),d.jsxs(Fr,{children:[d.jsx(He,{variant:"outline",onClick:()=>{sa(!1),ss(""),ia(null),Jt(!1),oe(null)},children:"Bỏ qua"}),d.jsx(He,{variant:"destructive",onClick:()=>Jm(),children:"Ghi đè"})]})]})}),d.jsx(Kd,{className:"s3-explr-breadcrumb",children:d.jsxs(Gd,{className:"s3-explr-breadcrumb-list",children:[d.jsx(cc,{className:"s3-explr-breadcrumb-item",children:d.jsx(lc,{onClick:()=>Qr(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:t})}),!u&&va.map((A,O)=>d.jsxs("div",{className:"flex items-center",children:[d.jsx(jd,{className:"s3-explr-breadcrumb-separator"},`sep-${O}`),d.jsx(cc,{className:"s3-explr-breadcrumb-item",children:d.jsx(lc,{onClick:()=>Qr(n+va.slice(0,O+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:A})},`item-${A}`)]},O))]})}),d.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[d.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:d.jsx(FH,{ref:Q,onChange:A=>w(A)})}),v&&v!=="/"&&d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsxs(He,{variant:"outline",size:"sm",onClick:()=>{ys||ft||(xt(!0),rl())},"aria-disabled":ys||ft,className:"flex items-center gap-2 s3-explr-refresh-btn aria-disabled:opacity-50",children:[d.jsx(pp,{className:`h-4 w-4 s3-explr-refresh-icon ${ys||ft?"animate-spin":""}`}),"Đồng bộ KB"]})}),Pt&&d.jsx(On,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-2 p-3 max-w-md",children:[d.jsx("p",{className:"font-semibold text-lg border-b pb-1",children:"Thông tin đồng bộ"}),d.jsx("div",{className:"space-y-1",children:d.jsxs("p",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:"Trạng thái:"}),d.jsxs("span",{className:`flex items-center gap-1 font-semibold ${Pt.status==="COMPLETE"?"text-green-600":Pt.status==="FAILED"?"text-red-600":"text-yellow-600"}`,children:[Pt.status==="COMPLETE"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),Pt.status==="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),Pt.status!=="COMPLETE"&&Pt.status!=="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),lL(Pt.status)]})]})}),Pt.statistics&&d.jsxs("div",{className:"space-y-1 border-t pt-2",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Thống kê xử lý:"}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu quét:"}),d.jsx("span",{className:"font-medium",children:Pt.statistics.numberOfDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata quét:"}),d.jsx("span",{className:"font-medium",children:Pt.statistics.numberOfMetadataDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu mới:"}),d.jsx("span",{className:"font-medium text-green-600",children:Pt.statistics.numberOfNewDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Pt.statistics.numberOfModifiedDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Pt.statistics.numberOfMetadataDocumentsModified})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu xóa:"}),d.jsx("span",{className:"font-medium text-orange-600",children:Pt.statistics.numberOfDocumentsDeleted})]}),d.jsxs("div",{className:"flex justify-between col-span-2",children:[d.jsx("span",{children:"Tài liệu lỗi:"}),d.jsx("span",{className:"font-medium text-red-600",children:Pt.statistics.numberOfDocumentsFailed})]})]})]}),d.jsxs("div",{className:"space-y-1 border-t pt-2 text-sm text-gray-200",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Chi tiết Job:"}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"DataSource ID:"})," ",Pt.dataSourceId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Ingestion Job ID:"})," ",Pt.ingestionJobId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Knowledge Base ID:"})," ",Pt.knowledgeBaseId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Job trong queue:"})," ",Pt.is_still_in_stock?"Còn":"Không"]})]}),Pt.errorMessage&&d.jsxs("div",{className:"border-t pt-2",children:[d.jsx("p",{className:"text-red-600 font-medium",children:"Lỗi:"}),d.jsx("p",{className:"text-red-600 text-sm bg-red-50 p-2 rounded",children:Pt.errorMessage})]}),Pt.failureReasons&&Pt.failureReasons.length>0&&d.jsx(HH,{failureReasons:Pt.failureReasons,onNavigateToFile:Lt})]})})]})}),na(En==null?void 0:En.prefixPermission)&&d.jsxs("div",{className:"relative",ref:Yc,children:[d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-file-btn bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors aria-disabled:hidden",onClick:()=>_o(A=>!A),"aria-disabled":(Ht==null?void 0:Ht.role)!=="MASTER_ADMIN"&&(Ht==null?void 0:Ht.role)!=="SITE_ADMIN"&&(v===""||v==="/"),children:[d.jsx(TO,{className:"w-4 h-4"}),"Add file"]}),qc&&d.jsxs("div",{className:"absolute z-50 mt-2 right-0 w-56 bg-white border rounded-lg shadow-lg py-2 flex flex-col",children:[d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1);const A=document.createElement("input");A.type="file",A.multiple=!0,A.onchange=O=>{const G=O.target.files;G&&ma(G,v,"files")},A.click()},children:[d.jsx(gp,{className:"h-4 w-4 mr-2"})," Tải tệp tin"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1);const A=document.createElement("input");A.type="file",A.multiple=!0,A.webkitdirectory=!0,A.onchange=O=>{const G=O.target.files;G&&ma(G,v,"folder")},A.click()},children:[d.jsx(Js,{className:"h-4 w-4 mr-2"})," Tải lên thư mục"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",disabled:!!s&&!v,onClick:()=>P(!0),children:[d.jsx(wO,{className:"h-4 w-4 mr-2 s3-explr-folder-plus-icon"}),"Thư mục mới"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1),J(!0)},children:[d.jsx(xO,{className:"h-4 w-4 mr-2"})," Thêm Website"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1),tf()},children:[d.jsxs("svg",{viewBox:"0 0 87.3 78",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",children:[d.jsx("path",{d:"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z",fill:"#0066da"}),d.jsx("path",{d:"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z",fill:"#00ac47"}),d.jsx("path",{d:"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z",fill:"#ea4335"}),d.jsx("path",{d:"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z",fill:"#00832d"}),d.jsx("path",{d:"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z",fill:"#2684fc"}),d.jsx("path",{d:"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z",fill:"#ffba00"})]})," ","Đồng bộ Google Drive"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1),Qc()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#094ab2",d:"M47.3 28.2C45.3 18.6 37.1 12 28 12c-8.5 0-15.9 5.6-18.4 13.5C4.2 27.2 0 32.2 0 38c0 6.6 5.4 12 12 12h36c8.3 0 16-6.6 16-15.5 0-6.8-4.9-12.4-11.7-13.3z"}),d.jsx("path",{fill:"#0067c5",d:"M44.9 30.1c-.2 0-.4-.1-.6-.1H26c-3.3 0-6 2.7-6 6 0 .9.2 1.8.6 2.6-1.7-.7-3.5-1.1-5.5-1.1C7.6 37.5 4 41.5 4 46s3.6 8.5 8.1 8.5h34.3c6.8 0 12.6-5.4 12.6-12s-5.5-11.6-11.1-12.4z"})]})," ","Đồng bộ OneDrive"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{_o(!1),Ot()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#036C70",d:"M19 14.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#17828F",d:"M16 17.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#4DB6AC",d:"M13 20.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#fff",d:"M4.5 15.5v-3c0-.28.22-.5.5-.5h3c.28 0 .5.22.5.5v3c0 .28-.22.5-.5.5H5c-.28 0-.5-.22-.5-.5z"})]})," ","Đồng bộ SharePoint"]})]})]}),na((En==null?void 0:En.prefixPermission)&&y.size>0)&&d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-file-btn bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors aria-disabled:hidden",onClick:()=>Rc({contentType:"application/x-directory",isFolder:!0,key:v||"/",lastModified:"-",name:"",size:0}),children:[d.jsx(RC,{className:"w-4 h-4"}),"Chia sẻ"]}),!o&&d.jsxs(d.Fragment,{children:[y.size>0&&d.jsx(d.Fragment,{children:d.jsxs(lr,{open:Z,onOpenChange:Y,children:[d.jsx(uc,{asChild:!0,children:d.jsxs(He,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[d.jsx(DC,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",y.size,")"]})}),d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),d.jsxs(Ci,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",y.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>Y(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:Qm,disabled:he,className:"s3-explr-confirm-delete-btn",children:he?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})}),!u&&d.jsxs(lr,{open:N,onOpenChange:P,children:[d.jsx(uc,{asChild:!0}),d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsx(Kn,{className:"s3-explr-dialog-header",children:d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),d.jsx(jn,{disabled:H,id:"name",value:_,onChange:A=>D(A.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),d.jsxs(He,{onClick:()=>{_.trim()&&Eo(_,v)},disabled:H,className:"s3-explr-create-btn",children:[H&&d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),H?"Đang tạo...":"Tạo"]})]})]})]}),u&&!v?d.jsx(d.Fragment,{}):d.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[Je?d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[d.jsx(Et,{className:"h-4 w-4 animate-spin s3-explr-loader"}),Je.status?d.jsxs(d.Fragment,{children:[Je.status.isProcessing?"Đang thu thập ":"Đang quét sitemap ","(",Je.status.completed,"/",Je.status.total,") -"," ",Math.floor(zo/60),":",String(zo%60).padStart(2,"0")]}):"Đang thu thập..."]}),d.jsxs(He,{variant:"destructive",size:"sm",onClick:()=>void Zm(),className:"flex items-center gap-2",children:[d.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),d.jsx(kO,{className:"h-4 w-4"})]})]})}),Je.status&&d.jsx(On,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2 max-w-md break-words",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Je==null?void 0:Je.url]}),d.jsxs("p",{children:["Tiến độ: ",Je==null?void 0:Je.status.completed,"/",Je==null?void 0:Je.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian: ",Math.floor(zo/60),":",String(zo%60).padStart(2,"0")]}),d.jsxs("p",{children:["Trạng thái:"," ",(Je==null?void 0:Je.status.status)==="scraping"?"Đang thu thập":(Je==null?void 0:Je.status.status)==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):!u&&d.jsxs(lr,{open:L,onOpenChange:J,children:[d.jsx(uc,{asChild:!0}),d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Ci,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(jn,{id:"websiteUrl",value:U,onChange:A=>ae(A.target.value),placeholder:"https://example.com",type:"url",disabled:Ee,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),d.jsx(jn,{id:"crawlLimit",value:ye,onChange:A=>{const O=A.target.value;/^\d*$/.test(O)&&pe(O)},placeholder:"1",type:"text",disabled:Ee,className:"s3-explr-input"}),d.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)"})]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>{J(!1),ae(""),pe("1")},disabled:Ee,className:"s3-explr-cancel-btn",children:"Hủy"}),Je?d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx("span",{children:d.jsxs(He,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(On,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(He,{onClick:()=>{U.trim()&&nl(U.trim(),parseInt(ye)||1)},disabled:Ee||!U.trim(),className:"s3-explr-crawl-btn",children:Ee?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]}),v.startsWith("BKTTW/")&&d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!v,onClick:Es,children:[ca&&d.jsx(pp,{className:`h-4 w-4 s3-explr-refresh-icon ${ca?"animate-spin":""}`}),"Xuất báo cáo"]})}),(Je==null?void 0:Je.status)&&d.jsx(On,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Je.url]}),d.jsxs("p",{children:["Tiến độ: ",Je.status.completed,"/",Je.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian: ",Math.floor(zo/60),":",String(zo%60).padStart(2,"0")]}),d.jsxs("p",{children:["Trạng thái:"," ",Je.status.status==="scraping"?"Đang thu thập":Je.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}),d.jsxs(lr,{open:L,onOpenChange:J,children:[d.jsx(uc,{asChild:!0}),d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Ci,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(jn,{id:"websiteUrl",value:U,onChange:A=>ae(A.target.value),placeholder:"https://example.com",type:"url",disabled:Ee,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),d.jsx(jn,{id:"crawlLimit",value:ye,onChange:A=>{const O=A.target.value;/^\d*$/.test(O)&&pe(O)},placeholder:"1",type:"text",disabled:Ee,className:"s3-explr-input"}),d.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)"})]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsxs(He,{className:`absolute left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Go?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,onClick:()=>Wc(A=>!A),children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Go?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]}),d.jsx(He,{variant:"outline",onClick:()=>{J(!1),ae(""),pe("1")},disabled:Ee,className:"s3-explr-cancel-btn",children:"Hủy"}),Je?d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsx("span",{children:d.jsxs(He,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(On,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(He,{onClick:()=>{U.trim()&&nl(U.trim(),parseInt(ye)||1)},disabled:Ee||!U.trim(),className:"s3-explr-crawl-btn",children:Ee?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),v.startsWith("BKTTW/")&&d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{children:[d.jsx(Jn,{asChild:!0,children:d.jsxs(He,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!v,onClick:Es,children:[ca&&d.jsx(pp,{className:`h-4 w-4 s3-explr-refresh-icon ${ca?"animate-spin":""}`}),"Xuất báo cáo"]})}),ca&&d.jsx(On,{sideOffset:5,children:"Đang xuất báo cáo"})]})}),d.jsxs("div",{className:"flex items-center gap-4",children:[la&&d.jsxs(Qs,{open:la,onOpenChange:us,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(kp,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:Xc,children:"✖"})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My OneDrive"}),d.jsx(Kd,{className:"onedrive-breadcrumb",children:d.jsx(Gd,{className:"onedrive-breadcrumb-list",children:da.map((A,O)=>d.jsxs("div",{className:"flex items-center",children:[O>0&&d.jsx(jd,{className:"onedrive-breadcrumb-separator"}),d.jsx(cc,{className:"onedrive-breadcrumb-item",children:d.jsx(lc,{onClick:()=>Zu(O),className:"cursor-pointer onedrive-breadcrumb-link",children:A.name})})]},O))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Um?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):d.jsx(d.Fragment,{children:[...zu,...$c].length>0?[...zu,...$c].map(A=>d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${hs.some(O=>O.id===A.id)?"bg-blue-100":""}`,children:[d.jsx("input",{type:"checkbox",checked:hs.some(O=>O.id===A.id),onChange:O=>{O.stopPropagation(),Cs(A)},className:"cursor-pointer"}),A.isFolder?d.jsx(Js,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>ga(A.id,A.name)}):d.jsx(gp,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${A.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{A.isFolder?ga(A.id,A.name):Cs(A)},children:A.name}),!A.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[Yr(A.size)," •"," ",Qu(A.lastModified.toISOString())]})]})]},A.id)):d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."})})}),d.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:d.jsx(He,{onClick:()=>{ef(hs,v),Xc()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:hs.length===0,children:"Đồng bộ"})}),d.jsx("button",{onClick:()=>ha(!0),className:"absolute bottom-4 left-4 text-gray-600 hover:text-gray-800",title:"Đăng xuất OneDrive",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),d.jsx("polyline",{points:"16 17 21 12 16 7"}),d.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})]}),d.jsxs(Qs,{open:Bm,onOpenChange:ha,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi OneDrive?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(He,{variant:"outline",onClick:()=>ha(!1),children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:()=>{Qn(),ha(!1)},children:"Đăng xuất"})]})]})]}),So&&d.jsxs(Qs,{open:So,onOpenChange:fa,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(kp,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:Ju,children:"✖"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[gt&&d.jsx("button",{onClick:()=>qr(null),className:"text-gray-600 hover:text-gray-800",children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My SharePoint"})]}),gt&&d.jsx(Kd,{className:"sharepoint-breadcrumb",children:d.jsx(Gd,{className:"sharepoint-breadcrumb-list",children:Kc.map((A,O)=>d.jsxs("div",{className:"flex items-center",children:[O>0&&d.jsx(jd,{className:"sharepoint-breadcrumb-separator"}),d.jsx(cc,{className:"sharepoint-breadcrumb-item",children:d.jsx(lc,{onClick:()=>qm(O),className:"cursor-pointer sharepoint-breadcrumb-link",children:A.name})})]},O))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Ku?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):gt?[...Vc,...ps].length===0?d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."}):[...Vc,...ps].map(A=>{const O=ms.some(G=>G.id===A.id);return d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${O?"bg-blue-100":""}`,children:[d.jsx("input",{type:"checkbox",checked:O,onChange:G=>{G.stopPropagation(),Wm(A)},className:"cursor-pointer"}),A.isFolder?d.jsx(Js,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>ws(A.id,A.name,(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")}):d.jsx(gp,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${A.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{A.isFolder&&ws(A.id,A.name,(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")},children:A.name}),!A.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[Yr(A.size)," •"," ",A.lastModified.toLocaleString()]})]})]},A.id)}):d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6",children:Gc.map(A=>d.jsxs("div",{className:"cursor-pointer bg-white shadow-md rounded-xl p-5 flex flex-col justify-center items-start transition-shadow duration-200 hover:shadow-lg border border-gray-100 min-h-[120px]",style:{overflow:"hidden",wordBreak:"break-word",textOverflow:"ellipsis",whiteSpace:"normal"},onClick:()=>jm(A),children:[d.jsx("div",{className:"font-bold text-lg mb-1 truncate w-full",title:A.name,children:A.name}),d.jsx("div",{className:"text-sm text-gray-500 truncate w-full",title:A.description,children:A.description})]},A.id))})}),d.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:gt&&d.jsxs(d.Fragment,{children:[d.jsx(He,{onClick:()=>{Yu(ms,v),Ju()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:ms.length===0,children:"Đồng bộ"}),d.jsx(He,{onClick:()=>qr(null),children:"Quay lại"})]})}),gt&&d.jsxs("button",{onClick:()=>Wc(A=>!A),className:`absolute bottom-4 left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Go?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,title:"Bật/tắt tự động cập nhật KB",children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Go?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]})]})]}),d.jsxs(Qs,{open:ju,onOpenChange:vs,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi SharePoint?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(He,{variant:"outline",onClick:()=>vs(!1),children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:()=>{It(),vs(!1)},children:"Đăng xuất"})]})]})]})]}),d.jsx(lr,{open:!!Pc,onOpenChange:A=>{A||($u(!1),Uu([]),Fu(""))},children:d.jsxs(Vn,{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:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:d.jsxs("h3",{className:"font-medium mb-2",children:["Danh sách flows đang sử dụng dữ liệu từ folder(",d.jsx("span",{className:"font-bold",children:cs}),"):"," "]})}),d.jsx(Ci,{className:"s3-explr-dialog-description",children:Oc?d.jsxs("div",{className:"flex items-center justify-center py-4",children:[d.jsx(Et,{className:"h-6 w-6 animate-spin"}),d.jsx("span",{className:"ml-2",children:"Đang tải thông tin flows..."})]}):d.jsx("div",{children:ls&&Array.isArray(ls)&&ls.length>0?d.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:d.jsxs("table",{className:"w-full border-collapse",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"bg-gray-100",children:[d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Tên Flow"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"KnowledgeBase Id"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Loại"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Ngày tạo"})]})}),d.jsx("tbody",{children:ls.map((A,O)=>d.jsxs("tr",{className:O%2===0?"bg-white":"bg-gray-50",children:[d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:A.name}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:A.KnowledgeBaseId}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:A.type==="MULTIAGENT"?"Agent Flow":"Chat Flow"}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:A.createdDate?new Date(A.createdDate).toLocaleString("vi-VN"):"N/A"})]},O))})]})}):d.jsx("div",{className:"text-gray-500 italic py-2",children:"Không có flow nào sử dụng dữ liệu từ folder này"})})})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>W(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:()=>xs(ee),disabled:vn,className:"s3-explr-confirm-delete-btn",children:vn?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(lr,{open:!!ee,onOpenChange:A=>!A&&W(null),children:d.jsxs(Vn,{className:"s3-explr-dialog-content",children:[d.jsxs(Kn,{className:"s3-explr-dialog-header",children:[d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),d.jsxs(Ci,{className:"s3-explr-dialog-description break-words whitespace-pre-wrap",children:["Bạn có chắc chắn muốn xóa"," ",d.jsx("span",{className:"font-medium break-all",children:ee==null?void 0:ee.name}),"? Hành động này không thể hoàn tác."]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>W(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(He,{variant:"destructive",onClick:()=>xs(ee),disabled:vn,className:"s3-explr-confirm-delete-btn",children:vn?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(lr,{open:!!$,onOpenChange:A=>{A||(te(null),Pe(null),z(""),Ct(""),Kt("rename"))},children:d.jsxs(Vn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(Kn,{className:"s3-explr-dialog-header",children:d.jsx(Gn,{className:"s3-explr-dialog-title",children:$!=null&&$.isFolder?"Đổi tên thư mục":ta($)?"Quản lý tập tin":"Đổi tên tập tin"})}),$&&d.jsxs(_g,{value:Dn,onValueChange:A=>Kt(A),children:[d.jsxs(ru,{"aria-checked":!ta($),"aria-disabled":$.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[d.jsx(qi,{value:"rename",children:"Đổi tên"}),!$.isFolder&&d.jsxs(d.Fragment,{children:[ta($)&&d.jsx(qi,{value:"edit",children:"Sửa nội dung"}),d.jsx(qi,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),d.jsx(Yi,{value:"rename",children:d.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:d.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[d.jsx(wr,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),d.jsx(jn,{id:"newName",value:Te,onChange:A=>z(A.target.value),placeholder:"Nhập tên mới",disabled:Ce,className:"s3-explr-input"})]})})}),!$.isFolder&&d.jsxs(d.Fragment,{children:[ta($)&&d.jsx(Yi,{value:"edit",children:d.jsx("div",{className:"space-y-4 py-4",children:Yt?d.jsx("div",{className:"flex items-center justify-center py-10",children:d.jsx(Et,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d.jsxs("div",{className:"max-h-[70dvh] overflow-auto rounded-md border px-4 py-3 bg-muted/30",children:[d.jsx(wr,{htmlFor:"content",className:"block text-sm font-medium mb-2 text-muted-foreground",children:"Nội dung tập tin"}),d.jsx(hc,{id:"content",value:Xe,onChange:A=>Ct(A.target.value),placeholder:"Nhập nội dung tập tin",className:"font-mono text-sm resize-none min-h-[200px] w-full",disabled:rn,style:{height:"auto",maxHeight:"60vh"},rows:Math.max(10,Xe.split(`
228
+ `).length+1)})]})})}),d.jsx(Yi,{value:"edit-metadata",children:d.jsx("div",{className:"space-y-4 py-4",children:Yt?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Et,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:xe&&typeof xe=="object"&&Object.entries(xe).map(([A,O],G)=>d.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[d.jsxs(wr,{htmlFor:A,className:"s3-explr-label flex items-center gap-1",children:[aL[A]||A,fg(A)&&d.jsx(GD,{className:"h-[12px] w-[12px] text-red-500"})]}),sL(A)?d.jsx(hc,{id:A,value:typeof O=="string"?O:JSON.stringify(O),onChange:fe=>{const be={...xe,[A]:fe.target.value};Pe(be)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:rn||fg(A)}):d.jsx(jn,{id:A,value:typeof O=="string"?O:JSON.stringify(O),onChange:fe=>{const be={...xe,[A]:fe.target.value};Pe(be)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:rn||fg(A)})]},G))})})})]})]}),d.jsxs(Fr,{className:"s3-explr-dialog-footer",children:[d.jsx(He,{variant:"outline",onClick:()=>{te(null),Pe(null),z(""),Ct("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Dn==="edit"?d.jsx(He,{onClick:()=>$&&el($,Xe),disabled:rn||Yt,className:"s3-explr-save-btn",children:rn?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):Dn==="edit-metadata"?d.jsx(He,{onClick:()=>xe&&typeof xe=="object"&&$&&tl($),disabled:rn||Yt,className:"s3-explr-save-btn",children:rn?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):d.jsx(He,{onClick:()=>{Te.trim()&&$&&Xm($,Te.trim())},disabled:Ce||!Te.trim()||Te.trim()===($==null?void 0:$.name),className:"s3-explr-rename-btn",children:Ce?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),d.jsx(lr,{open:!!_e,onOpenChange:A=>{A||(ke(null),Ct(""))},children:d.jsxs(Vn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(Kn,{className:"s3-explr-dialog-header",children:d.jsx(Gn,{className:"s3-explr-dialog-title",children:"Xem tập tin"})}),_e&&d.jsxs(_g,{value:"view",children:[d.jsx(ru,{className:"grid w-full grid-cols-1 ",children:!_e.isFolder&&ta(_e)&&d.jsx(qi,{value:"view",children:"Nội dung"})}),!_e.isFolder&&ta(_e)&&d.jsx(Yi,{value:"view",children:d.jsx("div",{className:"space-y-4 py-4",children:Yt?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Et,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"overflow-hidden overflow-y-auto pb-3 px-1",children:d.jsx("div",{className:"rounded-md bg-muted p-4 font-mono text-sm overflow-auto max-h-[60vh] border",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words",children:Xe})})})})})]}),d.jsx(Fr,{className:"s3-explr-dialog-footer",children:d.jsx(He,{variant:"outline",onClick:()=>{ke(null),Ct("")},className:"s3-explr-cancel-btn",children:"Đóng"})})]})}),de&&ce&&d.jsx(VU,{openDialogRename:ce,setOpenDialogRename:Ae,apiBaseUrl:e,setFileToMove:se,fileToMove:de,refreshFiles:an,ignoreCache:fr,autoSyncAfterFileOperation:jo})]})]}),Km&&d.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"}),d.jsx(zU,{onFilesSelected:(A,O)=>ma(A,v,O),children:d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Zd,{className:"s3-explr-table",children:[d.jsx(eu,{className:"s3-explr-table-header",children:_s.getHeaderGroups().map(A=>d.jsx(Hr,{className:"hover:bg-transparent s3-explr-header-row",children:A.headers.map(O=>d.jsx(po,{className:"s3-explr-header-cell",children:O.isPlaceholder?null:Td(O.column.columnDef.header,O.getContext())},O.id))},A.id))}),d.jsx(tu,{className:"s3-explr-table-body",children:_s.getRowModel().rows.length===0?d.jsx(Hr,{className:"s3-explr-empty-row",children:d.jsx(Wn,{colSpan:of.length,className:"h-24 text-center s3-explr-empty-cell",children:g?d.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 "',g,'"']}):d.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:ys?"Đ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"})})}):_s.getRowModel().rows.map(A=>d.jsx(Hr,{className:"h-12 s3-explr-row",children:A.getVisibleCells().map(O=>d.jsx(Wn,{className:"align-middle s3-explr-cell",children:Td(O.column.columnDef.cell,O.getContext())},O.id))},A.id))})]})})}),g&&pa!==0&&d.jsx(d.Fragment,{children:d.jsx(qd,{children:d.jsxs(Yd,{children:[d.jsx(Jd,{onClick:()=>hr(A=>Math.max(A-1,1)),"aria-disabled":Gt===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(pa/20)},(A,O)=>{const G=O+1,fe=Math.ceil(pa/20);return fe>7&&!(G===1||G===fe||G>=Gt-1&&G<=Gt+1)?G===Gt-2&&Gt>4||G===Gt+2&&Gt<fe-3?d.jsx(Xd,{className:"pointer-events-none",children:"..."},O):null:d.jsx($r,{className:"cursor-pointer",children:d.jsx(Qa,{isActive:Gt===G,onClick:()=>hr(G),className:`${Gt===G?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:G})},O)}),d.jsx($r,{children:d.jsx(Qd,{onClick:()=>hr(A=>Math.min(A+1,Math.ceil(pa/20))),"aria-disabled":Gt===Math.ceil(pa/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),o&&a&&d.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[d.jsx("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:ol()}),d.jsx(He,{variant:"default",onClick:()=>a(Ai()),disabled:y.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),d.jsx(i3,{open:!!Mc,onClose:()=>Rc(null),file:Mc,apiBaseUrl:e,rootUrlHostApi:r})]})}),y3=t=>d.jsx(fM,{clientId:c3,children:d.jsx(v3,{...t})});var Ec=t=>t.type==="checkbox",ra=t=>t instanceof Date,Mn=t=>t==null;const e0=t=>typeof t=="object";var qt=t=>!Mn(t)&&!Array.isArray(t)&&e0(t)&&!ra(t),w3=t=>qt(t)&&t.target?Ec(t.target)?t.target.checked:t.target.value:t,C3=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,b3=(t,e)=>t.has(C3(e)),x3=t=>{const e=t.constructor&&t.constructor.prototype;return qt(e)&&e.hasOwnProperty("isPrototypeOf")},Pm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function _n(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(Pm&&(t instanceof Blob||r))&&(n||qt(t)))if(e=n?[]:{},!n&&!x3(t))e=t;else for(const o in t)t.hasOwnProperty(o)&&(e[o]=_n(t[o]));else return t;return e}var Pu=t=>Array.isArray(t)?t.filter(Boolean):[],nn=t=>t===void 0,Fe=(t,e,n)=>{if(!e||!qt(t))return n;const r=Pu(e.split(/[,[\].]+?/)).reduce((o,a)=>Mn(o)?o:o[a],t);return nn(r)||r===t?nn(t[e])?n:t[e]:r},wo=t=>typeof t=="boolean",Om=t=>/^\w*$/.test(t),t0=t=>Pu(t.replace(/["|']|\]/g,"").split(/\.|\[/)),$t=(t,e,n)=>{let r=-1;const o=Om(e)?[e]:t0(e),a=o.length,s=a-1;for(;++r<a;){const l=o[r];let u=n;if(r!==s){const h=t[l];u=qt(h)||Array.isArray(h)?h:isNaN(+o[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;t[l]=u,t=t[l]}};const n0={BLUR:"blur",FOCUS_OUT:"focusout"},Kr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Bo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};M.createContext(null);var S3=(t,e,n,r=!0)=>{const o={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(o,a,{get:()=>{const s=a;return e._proxyFormState[s]!==Kr.all&&(e._proxyFormState[s]=!r||Kr.all),t[s]}});return o};const _3=typeof window<"u"?C.useLayoutEffect:C.useEffect;var Co=t=>typeof t=="string",E3=(t,e,n,r,o)=>Co(t)?(r&&e.watch.add(t),Fe(n,t,o)):Array.isArray(t)?t.map(a=>(r&&e.watch.add(a),Fe(n,a))):(r&&(e.watchAll=!0),n),T3=(t,e,n,r,o)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:o||!0}}:{},Tc=t=>Array.isArray(t)?t:[t],r0=()=>{let t=[];return{get observers(){return t},next:o=>{for(const a of t)a.next&&a.next(o)},subscribe:o=>(t.push(o),{unsubscribe:()=>{t=t.filter(a=>a!==o)}}),unsubscribe:()=>{t=[]}}},Mm=t=>Mn(t)||!e0(t);function Ti(t,e){if(Mm(t)||Mm(e))return t===e;if(ra(t)&&ra(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n){const a=t[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=e[o];if(ra(a)&&ra(s)||qt(a)&&qt(s)||Array.isArray(a)&&Array.isArray(s)?!Ti(a,s):a!==s)return!1}}return!0}var Rn=t=>qt(t)&&!Object.keys(t).length,Rm=t=>t.type==="file",Gr=t=>typeof t=="function",Ou=t=>{if(!Pm)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},o0=t=>t.type==="select-multiple",Dm=t=>t.type==="radio",A3=t=>Dm(t)||Ec(t),Lm=t=>Ou(t)&&t.isConnected;function I3(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=nn(t)?r++:t[e[r++]];return t}function k3(t){for(const e in t)if(t.hasOwnProperty(e)&&!nn(t[e]))return!1;return!0}function on(t,e){const n=Array.isArray(e)?e:Om(e)?[e]:t0(e),r=n.length===1?t:I3(t,n),o=n.length-1,a=n[o];return r&&delete r[a],o!==0&&(qt(r)&&Rn(r)||Array.isArray(r)&&k3(r))&&on(t,n.slice(0,-1)),t}var i0=t=>{for(const e in t)if(Gr(t[e]))return!0;return!1};function Mu(t,e={}){const n=Array.isArray(t);if(qt(t)||n)for(const r in t)Array.isArray(t[r])||qt(t[r])&&!i0(t[r])?(e[r]=Array.isArray(t[r])?[]:{},Mu(t[r],e[r])):Mn(t[r])||(e[r]=!0);return e}function a0(t,e,n){const r=Array.isArray(t);if(qt(t)||r)for(const o in t)Array.isArray(t[o])||qt(t[o])&&!i0(t[o])?nn(e)||Mm(n[o])?n[o]=Array.isArray(t[o])?Mu(t[o],[]):{...Mu(t[o])}:a0(t[o],Mn(e)?{}:e[o],n[o]):n[o]=!Ti(t[o],e[o]);return n}var Ac=(t,e)=>a0(t,e,Mu(e));const s0={value:!1,isValid:!1},c0={value:!0,isValid:!0};var l0=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!nn(t[0].attributes.value)?nn(t[0].value)||t[0].value===""?c0:{value:t[0].value,isValid:!0}:c0:s0}return s0},d0=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>nn(t)?t:e?t===""?NaN:t&&+t:n&&Co(t)?new Date(t):r?r(t):t;const u0={isValid:!1,value:null};var f0=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,u0):u0;function h0(t){const e=t.ref;return Rm(e)?e.files:Dm(e)?f0(t.refs).value:o0(e)?[...e.selectedOptions].map(({value:n})=>n):Ec(e)?l0(t.refs).value:d0(nn(e.value)?t.ref.value:e.value,t)}var N3=(t,e,n,r)=>{const o={};for(const a of t){const s=Fe(e,a);s&&$t(o,a,s._f)}return{criteriaMode:n,names:[...t],fields:o,shouldUseNativeValidation:r}},Ru=t=>t instanceof RegExp,Ic=t=>nn(t)?t:Ru(t)?t.source:qt(t)?Ru(t.value)?t.value.source:t.value:t,p0=t=>({isOnSubmit:!t||t===Kr.onSubmit,isOnBlur:t===Kr.onBlur,isOnChange:t===Kr.onChange,isOnAll:t===Kr.all,isOnTouch:t===Kr.onTouched});const g0="AsyncFunction";var P3=t=>!!t&&!!t.validate&&!!(Gr(t.validate)&&t.validate.constructor.name===g0||qt(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===g0)),O3=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),m0=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const kc=(t,e,n,r)=>{for(const o of n||Object.keys(t)){const a=Fe(t,o);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],o)&&!r)return!0;if(s.ref&&e(s.ref,s.name)&&!r)return!0;if(kc(l,e))break}else if(qt(l)&&kc(l,e))break}}};function v0(t,e,n){const r=Fe(t,n);if(r||Om(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const a=o.join("."),s=Fe(e,a),l=Fe(t,a);if(s&&!Array.isArray(s)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};o.pop()}return{name:n}}var M3=(t,e,n,r)=>{n(t);const{name:o,...a}=t;return Rn(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(s=>e[s]===(!r||Kr.all))},R3=(t,e,n)=>!t||!e||t===e||Tc(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),D3=(t,e,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(e||t):(n?r.isOnBlur:o.isOnBlur)?!t:(n?r.isOnChange:o.isOnChange)?t:!0,L3=(t,e)=>!Pu(Fe(t,e)).length&&on(t,e),F3=(t,e,n)=>{const r=Tc(Fe(t,n));return $t(r,"root",e[n]),$t(t,n,r),t},Du=t=>Co(t);function y0(t,e,n="validate"){if(Du(t)||Array.isArray(t)&&t.every(Du)||wo(t)&&!t)return{type:n,message:Du(t)?t:"",ref:e}}var as=t=>qt(t)&&!Ru(t)?t:{value:t,message:""},w0=async(t,e,n,r,o,a)=>{const{ref:s,refs:l,required:u,maxLength:h,minLength:p,min:g,max:w,pattern:y,validate:x,name:v,valueAsNumber:b,mount:E}=t._f,T=Fe(n,v);if(!E||e.has(v))return{};const N=l?l[0]:s,P=se=>{o&&N.reportValidity&&(N.setCustomValidity(wo(se)?"":se||""),N.reportValidity())},_={},D=Dm(s),H=Ec(s),K=D||H,ee=(b||Rm(s))&&nn(s.value)&&nn(T)||Ou(s)&&s.value===""||T===""||Array.isArray(T)&&!T.length,W=T3.bind(null,v,r,_),de=(se,he,q,Z=Bo.maxLength,Y=Bo.minLength)=>{const oe=se?he:q;_[v]={type:se?Z:Y,message:oe,ref:s,...W(se?Z:Y,oe)}};if(a?!Array.isArray(T)||!T.length:u&&(!K&&(ee||Mn(T))||wo(T)&&!T||H&&!l0(l).isValid||D&&!f0(l).isValid)){const{value:se,message:he}=Du(u)?{value:!!u,message:u}:as(u);if(se&&(_[v]={type:Bo.required,message:he,ref:N,...W(Bo.required,he)},!r))return P(he),_}if(!ee&&(!Mn(g)||!Mn(w))){let se,he;const q=as(w),Z=as(g);if(!Mn(T)&&!isNaN(T)){const Y=s.valueAsNumber||T&&+T;Mn(q.value)||(se=Y>q.value),Mn(Z.value)||(he=Y<Z.value)}else{const Y=s.valueAsDate||new Date(T),oe=$=>new Date(new Date().toDateString()+" "+$),Q=s.type=="time",X=s.type=="week";Co(q.value)&&T&&(se=Q?oe(T)>oe(q.value):X?T>q.value:Y>new Date(q.value)),Co(Z.value)&&T&&(he=Q?oe(T)<oe(Z.value):X?T<Z.value:Y<new Date(Z.value))}if((se||he)&&(de(!!se,q.message,Z.message,Bo.max,Bo.min),!r))return P(_[v].message),_}if((h||p)&&!ee&&(Co(T)||a&&Array.isArray(T))){const se=as(h),he=as(p),q=!Mn(se.value)&&T.length>+se.value,Z=!Mn(he.value)&&T.length<+he.value;if((q||Z)&&(de(q,se.message,he.message),!r))return P(_[v].message),_}if(y&&!ee&&Co(T)){const{value:se,message:he}=as(y);if(Ru(se)&&!T.match(se)&&(_[v]={type:Bo.pattern,message:he,ref:s,...W(Bo.pattern,he)},!r))return P(he),_}if(x){if(Gr(x)){const se=await x(T,n),he=y0(se,N);if(he&&(_[v]={...he,...W(Bo.validate,he.message)},!r))return P(he.message),_}else if(qt(x)){let se={};for(const he in x){if(!Rn(se)&&!r)break;const q=y0(await x[he](T,n),N,he);q&&(se={...q,...W(he,q.message)},P(q.message),r&&(_[v]=se))}if(!Rn(se)&&(_[v]={ref:N,...se},!r))return _}}return P(!0),_};const $3={mode:Kr.onSubmit,reValidateMode:Kr.onChange,shouldFocusError:!0};function H3(t={}){let e={...$3,...t},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Gr(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const r={};let o=qt(e.defaultValues)||qt(e.values)?_n(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:_n(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,h=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const w={array:r0(),state:r0()},y=p0(e.mode),x=p0(e.reValidateMode),v=e.criteriaMode===Kr.all,b=L=>J=>{clearTimeout(h),h=setTimeout(L,J)},E=async L=>{if(!e.disabled&&(p.isValid||g.isValid||L)){const J=e.resolver?Rn((await ee()).errors):await de(r,!0);J!==n.isValid&&w.state.next({isValid:J})}},T=(L,J)=>{!e.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((L||Array.from(l.mount)).forEach(U=>{U&&(J?$t(n.validatingFields,U,J):on(n.validatingFields,U))}),w.state.next({validatingFields:n.validatingFields,isValidating:!Rn(n.validatingFields)}))},N=(L,J=[],U,ae,ye=!0,pe=!0)=>{if(ae&&U&&!e.disabled){if(s.action=!0,pe&&Array.isArray(Fe(r,L))){const Ee=U(Fe(r,L),ae.argA,ae.argB);ye&&$t(r,L,Ee)}if(pe&&Array.isArray(Fe(n.errors,L))){const Ee=U(Fe(n.errors,L),ae.argA,ae.argB);ye&&$t(n.errors,L,Ee),L3(n.errors,L)}if((p.touchedFields||g.touchedFields)&&pe&&Array.isArray(Fe(n.touchedFields,L))){const Ee=U(Fe(n.touchedFields,L),ae.argA,ae.argB);ye&&$t(n.touchedFields,L,Ee)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Ac(o,a)),w.state.next({name:L,isDirty:he(L,J),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else $t(a,L,J)},P=(L,J)=>{$t(n.errors,L,J),w.state.next({errors:n.errors})},_=L=>{n.errors=L,w.state.next({errors:n.errors,isValid:!1})},D=(L,J,U,ae)=>{const ye=Fe(r,L);if(ye){const pe=Fe(a,L,nn(U)?Fe(o,L):U);nn(pe)||ae&&ae.defaultChecked||J?$t(a,L,J?pe:h0(ye._f)):Y(L,pe),s.mount&&E()}},H=(L,J,U,ae,ye)=>{let pe=!1,Ee=!1;const Qe={name:L};if(!e.disabled){if(!U||ae){(p.isDirty||g.isDirty)&&(Ee=n.isDirty,n.isDirty=Qe.isDirty=he(),pe=Ee!==Qe.isDirty);const ft=Ti(Fe(o,L),J);Ee=!!Fe(n.dirtyFields,L),ft?on(n.dirtyFields,L):$t(n.dirtyFields,L,!0),Qe.dirtyFields=n.dirtyFields,pe=pe||(p.dirtyFields||g.dirtyFields)&&Ee!==!ft}if(U){const ft=Fe(n.touchedFields,L);ft||($t(n.touchedFields,L,U),Qe.touchedFields=n.touchedFields,pe=pe||(p.touchedFields||g.touchedFields)&&ft!==U)}pe&&ye&&w.state.next(Qe)}return pe?Qe:{}},K=(L,J,U,ae)=>{const ye=Fe(n.errors,L),pe=(p.isValid||g.isValid)&&wo(J)&&n.isValid!==J;if(e.delayError&&U?(u=b(()=>P(L,U)),u(e.delayError)):(clearTimeout(h),u=null,U?$t(n.errors,L,U):on(n.errors,L)),(U?!Ti(ye,U):ye)||!Rn(ae)||pe){const Ee={...ae,...pe&&wo(J)?{isValid:J}:{},errors:n.errors,name:L};n={...n,...Ee},w.state.next(Ee)}},ee=async L=>{T(L,!0);const J=await e.resolver(a,e.context,N3(L||l.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return T(L),J},W=async L=>{const{errors:J}=await ee(L);if(L)for(const U of L){const ae=Fe(J,U);ae?$t(n.errors,U,ae):on(n.errors,U)}else n.errors=J;return J},de=async(L,J,U={valid:!0})=>{for(const ae in L){const ye=L[ae];if(ye){const{_f:pe,...Ee}=ye;if(pe){const Qe=l.array.has(pe.name),ft=ye._f&&P3(ye._f);ft&&p.validatingFields&&T([ae],!0);const xt=await w0(ye,l.disabled,a,v,e.shouldUseNativeValidation&&!J,Qe);if(ft&&p.validatingFields&&T([ae]),xt[pe.name]&&(U.valid=!1,J))break;!J&&(Fe(xt,pe.name)?Qe?F3(n.errors,xt,pe.name):$t(n.errors,pe.name,xt[pe.name]):on(n.errors,pe.name))}!Rn(Ee)&&await de(Ee,J,U)}}return U.valid},se=()=>{for(const L of l.unMount){const J=Fe(r,L);J&&(J._f.refs?J._f.refs.every(U=>!Lm(U)):!Lm(J._f.ref))&&Ae(L)}l.unMount=new Set},he=(L,J)=>!e.disabled&&(L&&J&&$t(a,L,J),!Ti(_e(),o)),q=(L,J,U)=>E3(L,l,{...s.mount?a:nn(J)?o:Co(L)?{[L]:J}:J},U,J),Z=L=>Pu(Fe(s.mount?a:o,L,e.shouldUnregister?Fe(o,L,[]):[])),Y=(L,J,U={})=>{const ae=Fe(r,L);let ye=J;if(ae){const pe=ae._f;pe&&(!pe.disabled&&$t(a,L,d0(J,pe)),ye=Ou(pe.ref)&&Mn(J)?"":J,o0(pe.ref)?[...pe.ref.options].forEach(Ee=>Ee.selected=ye.includes(Ee.value)):pe.refs?Ec(pe.ref)?pe.refs.length>1?pe.refs.forEach(Ee=>(!Ee.defaultChecked||!Ee.disabled)&&(Ee.checked=Array.isArray(ye)?!!ye.find(Qe=>Qe===Ee.value):ye===Ee.value)):pe.refs[0]&&(pe.refs[0].checked=!!ye):pe.refs.forEach(Ee=>Ee.checked=Ee.value===ye):Rm(pe.ref)?pe.ref.value="":(pe.ref.value=ye,pe.ref.type||w.state.next({name:L,values:_n(a)})))}(U.shouldDirty||U.shouldTouch)&&H(L,ye,U.shouldTouch,U.shouldDirty,!0),U.shouldValidate&&te(L)},oe=(L,J,U)=>{for(const ae in J){const ye=J[ae],pe=`${L}.${ae}`,Ee=Fe(r,pe);(l.array.has(L)||qt(ye)||Ee&&!Ee._f)&&!ra(ye)?oe(pe,ye,U):Y(pe,ye,U)}},Q=(L,J,U={})=>{const ae=Fe(r,L),ye=l.array.has(L),pe=_n(J);$t(a,L,pe),ye?(w.array.next({name:L,values:_n(a)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&U.shouldDirty&&w.state.next({name:L,dirtyFields:Ac(o,a),isDirty:he(L,pe)})):ae&&!ae._f&&!Mn(pe)?oe(L,pe,U):Y(L,pe,U),m0(L,l)&&w.state.next({...n}),w.state.next({name:s.mount?L:void 0,values:_n(a)})},X=async L=>{s.mount=!0;const J=L.target;let U=J.name,ae=!0;const ye=Fe(r,U),pe=Ee=>{ae=Number.isNaN(Ee)||ra(Ee)&&isNaN(Ee.getTime())||Ti(Ee,Fe(a,U,Ee))};if(ye){let Ee,Qe;const ft=J.type?h0(ye._f):w3(L),xt=L.type===n0.BLUR||L.type===n0.FOCUS_OUT,bo=!O3(ye._f)&&!e.resolver&&!Fe(n.errors,U)&&!ye._f.deps||D3(xt,Fe(n.touchedFields,U),n.isSubmitted,x,y),Jt=m0(U,l,xt);$t(a,U,ft),xt?(ye._f.onBlur&&ye._f.onBlur(L),u&&u(0)):ye._f.onChange&&ye._f.onChange(L);const vn=H(U,ft,xt),jr=!Rn(vn)||Jt;if(!xt&&w.state.next({name:U,type:L.type,values:_n(a)}),bo)return(p.isValid||g.isValid)&&(e.mode==="onBlur"?xt&&E():xt||E()),jr&&w.state.next({name:U,...Jt?{}:vn});if(!xt&&Jt&&w.state.next({...n}),e.resolver){const{errors:Gt}=await ee([U]);if(pe(ft),ae){const hr=v0(n.errors,r,U),Wr=v0(Gt,r,hr.name||U);Ee=Wr.error,U=Wr.name,Qe=Rn(Gt)}}else T([U],!0),Ee=(await w0(ye,l.disabled,a,v,e.shouldUseNativeValidation))[U],T([U]),pe(ft),ae&&(Ee?Qe=!1:(p.isValid||g.isValid)&&(Qe=await de(r,!0)));ae&&(ye._f.deps&&te(ye._f.deps),K(U,Qe,Ee,vn))}},$=(L,J)=>{if(Fe(n.errors,J)&&L.focus)return L.focus(),1},te=async(L,J={})=>{let U,ae;const ye=Tc(L);if(e.resolver){const pe=await W(nn(L)?L:ye);U=Rn(pe),ae=L?!ye.some(Ee=>Fe(pe,Ee)):U}else L?(ae=(await Promise.all(ye.map(async pe=>{const Ee=Fe(r,pe);return await de(Ee&&Ee._f?{[pe]:Ee}:Ee)}))).every(Boolean),!(!ae&&!n.isValid)&&E()):ae=U=await de(r);return w.state.next({...!Co(L)||(p.isValid||g.isValid)&&U!==n.isValid?{}:{name:L},...e.resolver||!L?{isValid:U}:{},errors:n.errors}),J.shouldFocus&&!ae&&kc(r,$,L?ye:l.mount),ae},_e=L=>{const J={...s.mount?a:o};return nn(L)?J:Co(L)?Fe(J,L):L.map(U=>Fe(J,U))},ke=(L,J)=>({invalid:!!Fe((J||n).errors,L),isDirty:!!Fe((J||n).dirtyFields,L),error:Fe((J||n).errors,L),isValidating:!!Fe(n.validatingFields,L),isTouched:!!Fe((J||n).touchedFields,L)}),xe=L=>{L&&Tc(L).forEach(J=>on(n.errors,J)),w.state.next({errors:L?n.errors:{}})},Pe=(L,J,U)=>{const ae=(Fe(r,L,{_f:{}})._f||{}).ref,ye=Fe(n.errors,L)||{},{ref:pe,message:Ee,type:Qe,...ft}=ye;$t(n.errors,L,{...ft,...J,ref:ae}),w.state.next({name:L,errors:n.errors,isValid:!1}),U&&U.shouldFocus&&ae&&ae.focus&&ae.focus()},Te=(L,J)=>Gr(L)?w.state.subscribe({next:U=>L(q(void 0,J),U)}):q(L,J,!0),z=L=>w.state.subscribe({next:J=>{R3(L.name,J.name,L.exact)&&M3(J,L.formState||p,zt,L.reRenderRoot)&&L.callback({values:{...a},...n,...J})}}).unsubscribe,ce=L=>(s.mount=!0,g={...g,...L.formState},z({...L,formState:g})),Ae=(L,J={})=>{for(const U of L?Tc(L):l.mount)l.mount.delete(U),l.array.delete(U),J.keepValue||(on(r,U),on(a,U)),!J.keepError&&on(n.errors,U),!J.keepDirty&&on(n.dirtyFields,U),!J.keepTouched&&on(n.touchedFields,U),!J.keepIsValidating&&on(n.validatingFields,U),!e.shouldUnregister&&!J.keepDefaultValue&&on(o,U);w.state.next({values:_n(a)}),w.state.next({...n,...J.keepDirty?{isDirty:he()}:{}}),!J.keepIsValid&&E()},Ce=({disabled:L,name:J})=>{(wo(L)&&s.mount||L||l.disabled.has(J))&&(L?l.disabled.add(J):l.disabled.delete(J))},Ne=(L,J={})=>{let U=Fe(r,L);const ae=wo(J.disabled)||wo(e.disabled);return $t(r,L,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:L}},name:L,mount:!0,...J}}),l.mount.add(L),U?Ce({disabled:wo(J.disabled)?J.disabled:e.disabled,name:L}):D(L,!0,J.value),{...ae?{disabled:J.disabled||e.disabled}:{},...e.progressive?{required:!!J.required,min:Ic(J.min),max:Ic(J.max),minLength:Ic(J.minLength),maxLength:Ic(J.maxLength),pattern:Ic(J.pattern)}:{},name:L,onChange:X,onBlur:X,ref:ye=>{if(ye){Ne(L,J),U=Fe(r,L);const pe=nn(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Ee=A3(pe),Qe=U._f.refs||[];if(Ee?Qe.find(ft=>ft===pe):pe===U._f.ref)return;$t(r,L,{_f:{...U._f,...Ee?{refs:[...Qe.filter(Lm),pe,...Array.isArray(Fe(o,L))?[{}]:[]],ref:{type:pe.type,name:L}}:{ref:pe}}}),D(L,!1,void 0,pe)}else U=Fe(r,L,{}),U._f&&(U._f.mount=!1),(e.shouldUnregister||J.shouldUnregister)&&!(b3(l.array,L)&&s.action)&&l.unMount.add(L)}}},ne=()=>e.shouldFocusError&&kc(r,$,l.mount),Ve=L=>{wo(L)&&(w.state.next({disabled:L}),kc(r,(J,U)=>{const ae=Fe(r,U);ae&&(J.disabled=ae._f.disabled||L,Array.isArray(ae._f.refs)&&ae._f.refs.forEach(ye=>{ye.disabled=ae._f.disabled||L}))},0,!1))},Xe=(L,J)=>async U=>{let ae;U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let ye=_n(a);if(w.state.next({isSubmitting:!0}),e.resolver){const{errors:pe,values:Ee}=await ee();n.errors=pe,ye=Ee}else await de(r);if(l.disabled.size)for(const pe of l.disabled)$t(ye,pe,void 0);if(on(n.errors,"root"),Rn(n.errors)){w.state.next({errors:{}});try{await L(ye,U)}catch(pe){ae=pe}}else J&&await J({...n.errors},U),ne(),setTimeout(ne);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Rn(n.errors)&&!ae,submitCount:n.submitCount+1,errors:n.errors}),ae)throw ae},Ct=(L,J={})=>{Fe(r,L)&&(nn(J.defaultValue)?Q(L,_n(Fe(o,L))):(Q(L,J.defaultValue),$t(o,L,_n(J.defaultValue))),J.keepTouched||on(n.touchedFields,L),J.keepDirty||(on(n.dirtyFields,L),n.isDirty=J.defaultValue?he(L,_n(Fe(o,L))):he()),J.keepError||(on(n.errors,L),p.isValid&&E()),w.state.next({...n}))},Yt=(L,J={})=>{const U=L?_n(L):o,ae=_n(U),ye=Rn(L),pe=ye?o:ae;if(J.keepDefaultValues||(o=U),!J.keepValues){if(J.keepDirtyValues){const Ee=new Set([...l.mount,...Object.keys(Ac(o,a))]);for(const Qe of Array.from(Ee))Fe(n.dirtyFields,Qe)?$t(pe,Qe,Fe(a,Qe)):Q(Qe,Fe(pe,Qe))}else{if(Pm&&nn(L))for(const Ee of l.mount){const Qe=Fe(r,Ee);if(Qe&&Qe._f){const ft=Array.isArray(Qe._f.refs)?Qe._f.refs[0]:Qe._f.ref;if(Ou(ft)){const xt=ft.closest("form");if(xt){xt.reset();break}}}}for(const Ee of l.mount)Q(Ee,Fe(pe,Ee))}a=_n(pe),w.array.next({values:{...pe}}),w.state.next({values:{...pe}})}l={mount:J.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!p.isValid||!!J.keepIsValid||!!J.keepDirtyValues,s.watch=!!e.shouldUnregister,w.state.next({submitCount:J.keepSubmitCount?n.submitCount:0,isDirty:ye?!1:J.keepDirty?n.isDirty:!!(J.keepDefaultValues&&!Ti(L,o)),isSubmitted:J.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ye?{}:J.keepDirtyValues?J.keepDefaultValues&&a?Ac(o,a):n.dirtyFields:J.keepDefaultValues&&L?Ac(o,L):J.keepDirty?n.dirtyFields:{},touchedFields:J.keepTouched?n.touchedFields:{},errors:J.keepErrors?n.errors:{},isSubmitSuccessful:J.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},bt=(L,J)=>Yt(Gr(L)?L(a):L,J),rn=(L,J={})=>{const U=Fe(r,L),ae=U&&U._f;if(ae){const ye=ae.refs?ae.refs[0]:ae.ref;ye.focus&&(ye.focus(),J.shouldSelect&&Gr(ye.select)&&ye.select())}},zt=L=>{n={...n,...L}},Kt={control:{register:Ne,unregister:Ae,getFieldState:ke,handleSubmit:Xe,setError:Pe,_subscribe:z,_runSchema:ee,_getWatch:q,_getDirty:he,_setValid:E,_setFieldArray:N,_setDisabledField:Ce,_setErrors:_,_getFieldArray:Z,_reset:Yt,_resetDefaultValues:()=>Gr(e.defaultValues)&&e.defaultValues().then(L=>{bt(L,e.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:se,_disableForm:Ve,_subjects:w,_proxyFormState:p,get _fields(){return r},get _formValues(){return a},get _state(){return s},set _state(L){s=L},get _defaultValues(){return o},get _names(){return l},set _names(L){l=L},get _formState(){return n},get _options(){return e},set _options(L){e={...e,...L}}},subscribe:ce,trigger:te,register:Ne,handleSubmit:Xe,watch:Te,setValue:Q,getValues:_e,reset:bt,resetField:Ct,clearErrors:xe,unregister:Ae,setError:Pe,setFocus:rn,getFieldState:ke};return{...Kt,formControl:Kt}}function U3(t={}){const e=M.useRef(void 0),n=M.useRef(void 0),[r,o]=M.useState({isDirty:!1,isValidating:!1,isLoading:Gr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:Gr(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...t.formControl?t.formControl:H3(t),formState:r},t.formControl&&t.defaultValues&&!Gr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions));const a=e.current.control;return a._options=t,_3(()=>{const s=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(l=>({...l,isReady:!0})),a._formState.isReady=!0,s},[a]),M.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),M.useEffect(()=>{t.mode&&(a._options.mode=t.mode),t.reValidateMode&&(a._options.reValidateMode=t.reValidateMode),t.errors&&!Rn(t.errors)&&a._setErrors(t.errors)},[a,t.errors,t.mode,t.reValidateMode]),M.useEffect(()=>{t.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,t.shouldUnregister]),M.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==r.isDirty&&a._subjects.state.next({isDirty:s})}},[a,r.isDirty]),M.useEffect(()=>{t.values&&!Ti(t.values,n.current)?(a._reset(t.values,a._options.resetOptions),n.current=t.values,o(s=>({...s}))):a._resetDefaultValues()},[a,t.values]),M.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),e.current.formState=S3(r,a),e.current}const C0=({className:t,children:e,content:n,side:r})=>{const[o,a]=M.useState(!1);return d.jsx(qn,{delayDuration:0,children:d.jsxs(Yn,{open:o,children:[d.jsx(Jn,{asChild:!0,children:d.jsx("button",{type:"button",className:ze("cursor-pointer",t),onClick:()=>a(!o),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onTouchStart:()=>a(!o),onKeyDown:s=>{s.preventDefault(),s.key==="Enter"&&a(!o)},children:e})}),d.jsx(On,{side:r,className:n?"":"hidden",children:d.jsx("span",{className:"inline-block",children:n})})]})})},B3=(t,e)=>{const[n,r]=M.useState(t);return M.useEffect(()=>{const o=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(o)}},[t,e]),n},z3=({apiBaseUrl:t="http://localhost:3000"})=>{var D,H;const[e,n]=M.useState([]),[r,o]=M.useState(!1),[a,s]=M.useState([]),[l,u]=M.useState(1),[h,p]=M.useState(1),[g,w]=M.useState(null),[y,x]=M.useState(""),v=B3(y,500),b=K=>{const ee=K.match(/\d{6}/);if(!ee)return{month:"",year:""};const W=ee[0],de=W.substring(0,2),se=W.substring(2);return{month:de,year:se}},E=K=>K.map(W=>{let de=(W==null?void 0:W.month)||"",se=(W==null?void 0:W.year)||"";if((!de||!se)&&(W!=null&&W.file_name)){const he=b(W.file_name);de=de||he.month,se=se||he.year}return{id:W==null?void 0:W.id,prefix:(W==null?void 0:W.prefix)||"",model:(W==null?void 0:W.model)||"",fileName:(W==null?void 0:W.file_name)||"",code:(W==null?void 0:W.stock_id)||"",month:de,year:se,content:(W==null?void 0:W.text_summary)||"",status:(W==null?void 0:W.status)||"",note:(W==null?void 0:W.note)||"",lastUpdate:W==null?void 0:W.updated_at,stock_id:W==null?void 0:W.stock_id}}),T=K=>{if(!(K!=null&&K.data))return[];const ee=E(K==null?void 0:K.data);n(ee),p(K.pagination.totalPages)},N=async(K=1,ee=15)=>{w(K),o(!0);try{const W=await Le.get(`${t}/api/latest-summaries`,{params:{page:K,limit:ee,search:y}});(W==null?void 0:W.status)===200?T(W.data):console.error(W)}catch(W){console.error("Error fetching data:",W)}finally{w(null),o(!1)}};M.useEffect(()=>{v&&u(1),N(l)},[l,v]);const P=M.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:ee})=>d.jsx("span",{className:"flex flex-col",children:ee.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:ee})=>{const W=ee.original.month,de=ee.original.year;return d.jsx("span",{className:"flex flex-col",children:`${W.toString().padStart(2,"0")}/${de}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:ee})=>{const W=ee.getValue("content");return d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:W})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:ee})=>{const de=ee.original.status!=="unpublish";return d.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${de?"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:de?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:ee})=>d.jsx(C0,{content:d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:ee.original.note}),children:d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:ee.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:ee})=>{const W=new Date(ee.original.lastUpdate),de=W.getDate(),se=W.getMonth()+1,he=`ngày ${de} tháng ${se}`;return d.jsx("span",{className:"flex flex-col",children:he})}},{accessorKey:"actions",header:()=>d.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:ee})=>{const[W,de]=M.useState(!1),[se,he]=M.useState(!1),[q,Z]=M.useState(!1),{handleSubmit:Y,register:oe,reset:Q}=U3(),X=ee.original.id,$=ee.getValue("status"),te=ee.getValue("content"),[_e,ke]=M.useState(!1),xe=async()=>{try{ke(!0);const Te=$==="unpublish"?"published":"unpublish",z=await Le.patch(`${t}/api/toggle-publish/${X}`,{id:X,typeAction:"update",status:$,idInput:X,stock_id:ee.original.stock_id,prefix:ee.original.prefix,model:ee.original.model,summary_result:ee.original.content,note:ee.original.note});z.status===200?n(ce=>ce.map(Ae=>Ae.id===X?{...Ae,status:Te}:Ae)):console.error("Failed to toggle publish status:",z)}catch(Te){console.error("Error toggling publish status:",Te)}finally{ke(!1)}},Pe=async Te=>{de(!0);try{const z=await Le.patch(`${t}/api/update-summary`,{note:Te.note,text_summary:Te.content,id:X});z.status===200?(await N(l),he(!1)):console.error("Failed to update summary:",z)}catch(z){console.error("Error updating summary:",z)}return de(!1)};return d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx(He,{variant:"outline",size:"sm",onClick:()=>Z(!0),className:"px-2 py-0.5 h-7",children:d.jsx(Ux,{className:"h-4 w-4"})}),d.jsx(lr,{open:q,onOpenChange:Z,children:d.jsxs(Vn,{className:"max-w-3xl max-h-[80vh]",children:[d.jsx(Kn,{children:d.jsx(Gn,{children:"Nội dung chi tiết"})}),d.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:d.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:te})})]})}),d.jsxs(lr,{open:se,onOpenChange:Te=>{he(Te),Te?Q({content:ee.original.content,note:ee.original.note}):Q()},children:[d.jsx(uc,{asChild:!0,children:d.jsx(He,{variant:"outline",size:"sm",onClick:()=>he(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),d.jsx(Vn,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:d.jsxs(Kn,{className:"flex flex-col gap-3",children:[d.jsx(Gn,{className:"max-sm:hidden text-center",children:"Sửa summary"}),d.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:Y(Pe),children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Nội dung:"}),d.jsx(hc,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:ee.original.answer||"",rows:10,...oe("content")})]}),d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Ghi chú:"}),d.jsx(hc,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:ee.original.note||"",rows:1,...oe("note")})]})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(He,{disabled:W,type:"submit",variant:"default",children:W?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),d.jsx(He,{variant:"outline",size:"sm",onClick:xe,disabled:_e,className:"w-[70px] px-2 py-0.5 h-7",children:_e?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):$==="unpublish"?"Publish":"Unpublish"})]})}}],[]),_=jb({data:e,columns:P,state:{columnFilters:a},enableRowSelection:!0,onColumnFiltersChange:s,getFilteredRowModel:WM(),getCoreRowModel:Gb()});return d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:d.jsxs("div",{className:"relative max-w-sm",children:[d.jsx(jn,{placeholder:"Tìm kiếm theo mã...",value:y,onChange:K=>x(K.target.value),className:"pr-8"}),y&&d.jsx(He,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>x(""),children:d.jsx(lg,{className:"h-4 w-4"})})]})}),d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Zd,{className:"s3-explr-table",children:[d.jsx(eu,{className:"s3-explr-table-header",children:_.getHeaderGroups().map(K=>d.jsx(Hr,{className:"hover:bg-transparent s3-explr-header-row",children:K.headers.map(ee=>d.jsx(po,{className:"s3-explr-header-cell",children:ee.isPlaceholder?null:Td(ee.column.columnDef.header,ee.getContext())},ee.id))},K.id))}),d.jsx(tu,{className:"s3-explr-table-body",children:r?d.jsx(Hr,{children:d.jsx(Wn,{colSpan:P.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(D=_.getRowModel().rows)!=null&&D.length?(H=_.getRowModel().rows)==null?void 0:H.map(K=>d.jsx(Hr,{className:"h-12 s3-explr-row",children:K.getVisibleCells().map(ee=>d.jsx(Wn,{className:"align-middle s3-explr-cell",children:Td(ee.column.columnDef.cell,ee.getContext())},ee.id))},K.id)):d.jsx(Hr,{children:d.jsx(Wn,{colSpan:P.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(qd,{children:d.jsxs(Yd,{children:[d.jsx($r,{children:d.jsx(Jd,{onClick:()=>u(K=>Math.max(1,K-1)),className:l===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:h},(K,ee)=>ee+1).filter(K=>K===1||K===h||Math.abs(K-l)<=1).map((K,ee,W)=>d.jsxs(d.Fragment,{children:[ee>0&&W[ee-1]!==K-1&&d.jsx($r,{children:d.jsx(Xd,{})},K+"..."),d.jsx($r,{children:d.jsx(Qa,{onClick:()=>u(K),isActive:l===K,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===K?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):K})},K)]})),d.jsx($r,{children:d.jsx(Qd,{onClick:()=>u(K=>Math.min(h,K+1)),className:l===h||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},b0=10,V3=M.memo(({apiBaseUrl:t="http://localhost:3000"})=>{const[e,n]=M.useState(1),[r,o]=M.useState([]),[a,s]=M.useState({total:0,page:1,limit:b0,totalPages:1}),[l,u]=M.useState(!0),[h,p]=M.useState(null),[g,w]=M.useState(new Set),{toast:y}=mc(),[x,v]=M.useState(!1),b=async _=>{try{p(_);const D=await Le.get(`${t}/api/jobs`,{params:{page:_.toString(),limit:b0.toString()}});o(D.data.data),s(D.data.pagination)}catch{y({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{p(null),u(!1)}};M.useEffect(()=>{b(e)},[e,t]);const E=async _=>{w(D=>new Set(D).add(_.toString()));try{await Le.post(`${t}/api/retry-job`,{jobId:_}),y({title:"Job Restarted",description:`Job ${_} has been successfully restarted.`}),b(e)}catch{y({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${_}. Please try again.`})}finally{w(D=>{const H=new Set(D);return H.delete(_.toString()),H})}},T=async()=>{v(!0),n(1),await b(1),v(!1)},N=_=>new Date(_).toLocaleString(),P=_=>{if(_=parseFloat(_),_<60)return`${_.toFixed(2)}s`;const D=Math.floor(_/60),H=(_%60).toFixed(0);return`${D}m ${H}s`};return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[d.jsx(HD,{className:"w-8 h-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),d.jsx(He,{variant:"outline",size:"icon",onClick:T,disabled:x||l,className:"ml-2",children:d.jsx(jD,{className:`h-4 w-4 ${x?"animate-spin":""}`})})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(Zd,{children:[d.jsx(eu,{children:d.jsxs(Hr,{children:[d.jsx(po,{children:"ID"}),d.jsx(po,{children:"Tên Công Việc"}),d.jsx(po,{children:"Thời Gian Bắt Đầu"}),d.jsx(po,{children:"Thời Gian Cập Nhật"}),d.jsx(po,{children:"Thời Gian Thực Thi"}),d.jsx(po,{children:"Trạng Thái"}),d.jsx(po,{children:"Thao Tác"})]})}),d.jsx(tu,{children:l&&r.length===0?d.jsx(Hr,{children:d.jsx(Wn,{colSpan:7,className:"text-center py-4",children:d.jsx(Et,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(_=>{var D,H;return d.jsxs(Hr,{children:[d.jsx(Wn,{className:"!w-[100px]",children:_.id}),d.jsx(Wn,{className:"font-medium",children:(D=_.job_name)==null?void 0:D.replace("Upload file","Summary")}),d.jsx(Wn,{className:"!w-[200px]",children:N(_.created_at)}),d.jsx(Wn,{className:"!w-[200px]",children:N(_.updated_at)}),d.jsx(Wn,{className:"!w-[150px]",children:P(_.execution_time_seconds)}),d.jsx(Wn,{className:"!w-[200px]",children:d.jsx(C0,{content:_.status==="fail"&&_.error?d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:_.error}):null,children:d.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]
229
229
  ${_.status==="done"?"bg-green-100 text-green-800":_.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:_.status==="fail"?"FAILED":(H=_.status)==null?void 0:H.toUpperCase()})})}),d.jsx(Wn,{className:"!w-[200px]",children:_.status==="fail"?d.jsx(He,{variant:"outline",size:"sm",onClick:()=>E(_.id),disabled:g.has(_.id.toString()),className:"h-[32px]",children:g.has(_.id.toString())?d.jsxs(d.Fragment,{children:[d.jsx(Et,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):d.jsx("div",{className:"h-[32px]"})})]},_.id)})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(qd,{children:d.jsxs(Yd,{children:[d.jsx($r,{children:d.jsx(Jd,{onClick:()=>n(_=>Math.max(1,_-1)),className:e===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:a.totalPages},(_,D)=>D+1).filter(_=>_===1||_===a.totalPages||Math.abs(_-e)<=1).map((_,D,H)=>d.jsxs(d.Fragment,{children:[D>0&&H[D-1]!==_-1&&d.jsx($r,{children:d.jsx(Xd,{})},_+"..."),d.jsx($r,{children:d.jsx(Qa,{onClick:()=>n(_),isActive:e===_,className:`cursor-pointer ${h!==null?"pointer-events-none":""}`,children:h===_?d.jsx(Et,{className:"h-4 w-4 animate-spin"}):_})},_)]})),d.jsx($r,{children:d.jsx(Qd,{onClick:()=>n(_=>Math.min(a.totalPages,_+1)),className:e===a.totalPages||h!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),d.jsx(l_,{})]})});Ar.Job=V3,Ar.S3Explorer=y3,Ar.Summary=z3,Object.defineProperty(Ar,Symbol.toStringTag,{value:"Module"})});
230
230
  //# sourceMappingURL=s3-explorer.umd.cjs.map