function Aj(e,t){for(var r=0;rn[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();function Ax(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qs(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var Mx={exports:{}},Ad={},Ix={exports:{}},dt={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Xs=Symbol.for("react.element"),Mj=Symbol.for("react.portal"),Ij=Symbol.for("react.fragment"),Dj=Symbol.for("react.strict_mode"),Lj=Symbol.for("react.profiler"),Fj=Symbol.for("react.provider"),zj=Symbol.for("react.context"),Bj=Symbol.for("react.forward_ref"),Vj=Symbol.for("react.suspense"),Uj=Symbol.for("react.memo"),Wj=Symbol.for("react.lazy"),Uv=Symbol.iterator;function Hj(e){return e===null||typeof e!="object"?null:(e=Uv&&e[Uv]||e["@@iterator"],typeof e=="function"?e:null)}var Dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Lx=Object.assign,Fx={};function fl(e,t,r){this.props=e,this.context=t,this.refs=Fx,this.updater=r||Dx}fl.prototype.isReactComponent={};fl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};fl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zx(){}zx.prototype=fl.prototype;function $h(e,t,r){this.props=e,this.context=t,this.refs=Fx,this.updater=r||Dx}var qh=$h.prototype=new zx;qh.constructor=$h;Lx(qh,fl.prototype);qh.isPureReactComponent=!0;var Wv=Array.isArray,Bx=Object.prototype.hasOwnProperty,Gh={current:null},Vx={key:!0,ref:!0,__self:!0,__source:!0};function Ux(e,t,r){var n,o={},a=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)Bx.call(t,n)&&!Vx.hasOwnProperty(n)&&(o[n]=t[n]);var u=arguments.length-2;if(u===1)o.children=r;else if(1t=>{const r=t2.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),qn=e=>(e=e.toLowerCase(),t=>Md(t)===e),Id=e=>t=>typeof t===e,{isArray:pl}=Array,_s=Id("undefined");function r2(e){return e!==null&&!_s(e)&&e.constructor!==null&&!_s(e.constructor)&&tn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $x=qn("ArrayBuffer");function n2(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$x(e.buffer),t}const o2=Id("string"),tn=Id("function"),qx=Id("number"),Dd=e=>e!==null&&typeof e=="object",a2=e=>e===!0||e===!1,sc=e=>{if(Md(e)!=="object")return!1;const t=Qh(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},i2=qn("Date"),l2=qn("File"),s2=qn("Blob"),u2=qn("FileList"),c2=e=>Dd(e)&&tn(e.pipe),d2=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||tn(e.append)&&((t=Md(e))==="formdata"||t==="object"&&tn(e.toString)&&e.toString()==="[object FormData]"))},f2=qn("URLSearchParams"),[p2,h2,g2,m2]=["ReadableStream","Request","Response","Headers"].map(qn),b2=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Js(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),pl(e))for(n=0,o=e.length;n0;)if(o=r[n],t===o.toLowerCase())return o;return null}const za=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Kx=e=>!_s(e)&&e!==za;function d0(){const{caseless:e}=Kx(this)&&this||{},t={},r=(n,o)=>{const a=e&&Gx(t,o)||o;sc(t[a])&&sc(n)?t[a]=d0(t[a],n):sc(n)?t[a]=d0({},n):pl(n)?t[a]=n.slice():t[a]=n};for(let n=0,o=arguments.length;n(Js(t,(o,a)=>{r&&tn(o)?e[a]=Hx(o,r):e[a]=o},{allOwnKeys:n}),e),y2=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),w2=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},x2=(e,t,r,n)=>{let o,a,i;const u={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],(!n||n(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=r!==!1&&Qh(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},_2=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},C2=e=>{if(!e)return null;if(pl(e))return e;let t=e.length;if(!qx(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},S2=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qh(Uint8Array)),T2=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const a=o.value;t.call(e,a[0],a[1])}},O2=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},P2=qn("HTMLFormElement"),k2=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),$v=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),E2=qn("RegExp"),Yx=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Js(r,(o,a)=>{let i;(i=t(o,a,e))!==!1&&(n[a]=i||o)}),Object.defineProperties(e,n)},N2=e=>{Yx(e,(t,r)=>{if(tn(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(tn(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},j2=(e,t)=>{const r={},n=o=>{o.forEach(a=>{r[a]=!0})};return pl(e)?n(e):n(String(e).split(t)),r},R2=()=>{},A2=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,hp="abcdefghijklmnopqrstuvwxyz",qv="0123456789",Qx={DIGIT:qv,ALPHA:hp,ALPHA_DIGIT:hp+hp.toUpperCase()+qv},M2=(e=16,t=Qx.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function I2(e){return!!(e&&tn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const D2=e=>{const t=new Array(10),r=(n,o)=>{if(Dd(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[o]=n;const a=pl(n)?[]:{};return Js(n,(i,u)=>{const f=r(i,o+1);!_s(f)&&(a[u]=f)}),t[o]=void 0,a}}return n};return r(e,0)},L2=qn("AsyncFunction"),F2=e=>e&&(Dd(e)||tn(e))&&tn(e.then)&&tn(e.catch),Xx=((e,t)=>e?setImmediate:t?((r,n)=>(za.addEventListener("message",({source:o,data:a})=>{o===za&&a===r&&n.length&&n.shift()()},!1),o=>{n.push(o),za.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",tn(za.postMessage)),z2=typeof queueMicrotask<"u"?queueMicrotask.bind(za):typeof process<"u"&&process.nextTick||Xx,ye={isArray:pl,isArrayBuffer:$x,isBuffer:r2,isFormData:d2,isArrayBufferView:n2,isString:o2,isNumber:qx,isBoolean:a2,isObject:Dd,isPlainObject:sc,isReadableStream:p2,isRequest:h2,isResponse:g2,isHeaders:m2,isUndefined:_s,isDate:i2,isFile:l2,isBlob:s2,isRegExp:E2,isFunction:tn,isStream:c2,isURLSearchParams:f2,isTypedArray:S2,isFileList:u2,forEach:Js,merge:d0,extend:v2,trim:b2,stripBOM:y2,inherits:w2,toFlatObject:x2,kindOf:Md,kindOfTest:qn,endsWith:_2,toArray:C2,forEachEntry:T2,matchAll:O2,isHTMLForm:P2,hasOwnProperty:$v,hasOwnProp:$v,reduceDescriptors:Yx,freezeMethods:N2,toObjectSet:j2,toCamelCase:k2,noop:R2,toFiniteNumber:A2,findKey:Gx,global:za,isContextDefined:Kx,ALPHABET:Qx,generateString:M2,isSpecCompliantForm:I2,toJSONObject:D2,isAsyncFn:L2,isThenable:F2,setImmediate:Xx,asap:z2};function it(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}ye.inherits(it,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ye.toJSONObject(this.config),code:this.code,status:this.status}}});const Jx=it.prototype,Zx={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Zx[e]={value:e}});Object.defineProperties(it,Zx);Object.defineProperty(Jx,"isAxiosError",{value:!0});it.from=(e,t,r,n,o,a)=>{const i=Object.create(Jx);return ye.toFlatObject(e,i,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),it.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};const B2=null;function f0(e){return ye.isPlainObject(e)||ye.isArray(e)}function e_(e){return ye.endsWith(e,"[]")?e.slice(0,-2):e}function Gv(e,t,r){return e?e.concat(t).map(function(o,a){return o=e_(o),!r&&a?"["+o+"]":o}).join(r?".":""):t}function V2(e){return ye.isArray(e)&&!e.some(f0)}const U2=ye.toFlatObject(ye,{},null,function(t){return/^is[A-Z]/.test(t)});function Ld(e,t,r){if(!ye.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=ye.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,m){return!ye.isUndefined(m[w])});const n=r.metaTokens,o=r.visitor||b,a=r.dots,i=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&ye.isSpecCompliantForm(t);if(!ye.isFunction(o))throw new TypeError("visitor must be a function");function g(C){if(C===null)return"";if(ye.isDate(C))return C.toISOString();if(!f&&ye.isBlob(C))throw new it("Blob is not supported. Use a Buffer instead.");return ye.isArrayBuffer(C)||ye.isTypedArray(C)?f&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function b(C,w,m){let d=C;if(C&&!m&&typeof C=="object"){if(ye.endsWith(w,"{}"))w=n?w:w.slice(0,-2),C=JSON.stringify(C);else if(ye.isArray(C)&&V2(C)||(ye.isFileList(C)||ye.endsWith(w,"[]"))&&(d=ye.toArray(C)))return w=e_(w),d.forEach(function(c,s){!(ye.isUndefined(c)||c===null)&&t.append(i===!0?Gv([w],s,a):i===null?w:w+"[]",g(c))}),!1}return f0(C)?!0:(t.append(Gv(m,w,a),g(C)),!1)}const _=[],O=Object.assign(U2,{defaultVisitor:b,convertValue:g,isVisitable:f0});function S(C,w){if(!ye.isUndefined(C)){if(_.indexOf(C)!==-1)throw Error("Circular reference detected in "+w.join("."));_.push(C),ye.forEach(C,function(d,l){(!(ye.isUndefined(d)||d===null)&&o.call(t,d,ye.isString(l)?l.trim():l,w,O))===!0&&S(d,w?w.concat(l):[l])}),_.pop()}}if(!ye.isObject(e))throw new TypeError("data must be an object");return S(e),t}function Kv(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Xh(e,t){this._pairs=[],e&&Ld(e,this,t)}const t_=Xh.prototype;t_.append=function(t,r){this._pairs.push([t,r])};t_.toString=function(t){const r=t?function(n){return t.call(this,n,Kv)}:Kv;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function W2(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function r_(e,t,r){if(!t)return e;const n=r&&r.encode||W2,o=r&&r.serialize;let a;if(o?a=o(t,r):a=ye.isURLSearchParams(t)?t.toString():new Xh(t,r).toString(n),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class H2{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ye.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Yv=H2,n_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$2=typeof URLSearchParams<"u"?URLSearchParams:Xh,q2=typeof FormData<"u"?FormData:null,G2=typeof Blob<"u"?Blob:null,K2={isBrowser:!0,classes:{URLSearchParams:$2,FormData:q2,Blob:G2},protocols:["http","https","file","blob","url","data"]},Jh=typeof window<"u"&&typeof document<"u",p0=typeof navigator=="object"&&navigator||void 0,Y2=Jh&&(!p0||["ReactNative","NativeScript","NS"].indexOf(p0.product)<0),Q2=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),X2=Jh&&window.location.href||"http://localhost",J2=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Jh,hasStandardBrowserEnv:Y2,hasStandardBrowserWebWorkerEnv:Q2,navigator:p0,origin:X2},Symbol.toStringTag,{value:"Module"})),rn={...J2,...K2};function Z2(e,t){return Ld(e,new rn.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,a){return rn.isNode&&ye.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function eR(e){return ye.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tR(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n=r.length;return i=!i&&ye.isArray(o)?o.length:i,f?(ye.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!u):((!o[i]||!ye.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],a)&&ye.isArray(o[i])&&(o[i]=tR(o[i])),!u)}if(ye.isFormData(e)&&ye.isFunction(e.entries)){const r={};return ye.forEachEntry(e,(n,o)=>{t(eR(n),o,r,0)}),r}return null}function rR(e,t,r){if(ye.isString(e))try{return(t||JSON.parse)(e),ye.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Zh={transitional:n_,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,a=ye.isObject(t);if(a&&ye.isHTMLForm(t)&&(t=new FormData(t)),ye.isFormData(t))return o?JSON.stringify(o_(t)):t;if(ye.isArrayBuffer(t)||ye.isBuffer(t)||ye.isStream(t)||ye.isFile(t)||ye.isBlob(t)||ye.isReadableStream(t))return t;if(ye.isArrayBufferView(t))return t.buffer;if(ye.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Z2(t,this.formSerializer).toString();if((u=ye.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Ld(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return a||o?(r.setContentType("application/json",!1),rR(t)):t}],transformResponse:[function(t){const r=this.transitional||Zh.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(ye.isResponse(t)||ye.isReadableStream(t))return t;if(t&&ye.isString(t)&&(n&&!this.responseType||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?it.from(u,it.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rn.classes.FormData,Blob:rn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ye.forEach(["delete","get","head","post","put","patch"],e=>{Zh.headers[e]={}});const eg=Zh,nR=ye.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oR=e=>{const t={};let r,n,o;return e&&e.split(` `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&nR[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Qv=Symbol("internals");function Ul(e){return e&&String(e).trim().toLowerCase()}function uc(e){return e===!1||e==null?e:ye.isArray(e)?e.map(uc):String(e)}function aR(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const iR=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function gp(e,t,r,n,o){if(ye.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!ye.isString(t)){if(ye.isString(n))return t.indexOf(n)!==-1;if(ye.isRegExp(n))return n.test(t)}}function lR(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function sR(e,t){const r=ye.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,a,i){return this[n].call(this,t,o,a,i)},configurable:!0})})}class Fd{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function a(u,f,g){const b=Ul(f);if(!b)throw new Error("header name must be a non-empty string");const _=ye.findKey(o,b);(!_||o[_]===void 0||g===!0||g===void 0&&o[_]!==!1)&&(o[_||f]=uc(u))}const i=(u,f)=>ye.forEach(u,(g,b)=>a(g,b,f));if(ye.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(ye.isString(t)&&(t=t.trim())&&!iR(t))i(oR(t),r);else if(ye.isHeaders(t))for(const[u,f]of t.entries())a(f,u,n);else t!=null&&a(r,t,n);return this}get(t,r){if(t=Ul(t),t){const n=ye.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return aR(o);if(ye.isFunction(r))return r.call(this,o,n);if(ye.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Ul(t),t){const n=ye.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||gp(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function a(i){if(i=Ul(i),i){const u=ye.findKey(n,i);u&&(!r||gp(n,n[u],u,r))&&(delete n[u],o=!0)}}return ye.isArray(t)?t.forEach(a):a(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const a=r[n];(!t||gp(this,this[a],a,t,!0))&&(delete this[a],o=!0)}return o}normalize(t){const r=this,n={};return ye.forEach(this,(o,a)=>{const i=ye.findKey(n,a);if(i){r[i]=uc(o),delete r[a];return}const u=t?lR(a):String(a).trim();u!==a&&delete r[a],r[u]=uc(o),n[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return ye.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&ye.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Qv]=this[Qv]={accessors:{}}).accessors,o=this.prototype;function a(i){const u=Ul(i);n[u]||(sR(o,i),n[u]=!0)}return ye.isArray(t)?t.forEach(a):a(t),this}}Fd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ye.reduceDescriptors(Fd.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});ye.freezeMethods(Fd);const Ln=Fd;function mp(e,t){const r=this||eg,n=t||r,o=Ln.from(n.headers);let a=n.data;return ye.forEach(e,function(u){a=u.call(r,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function a_(e){return!!(e&&e.__CANCEL__)}function hl(e,t,r){it.call(this,e??"canceled",it.ERR_CANCELED,t,r),this.name="CanceledError"}ye.inherits(hl,it,{__CANCEL__:!0});function i_(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new it("Request failed with status code "+r.status,[it.ERR_BAD_REQUEST,it.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function uR(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function cR(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,a=0,i;return t=t!==void 0?t:1e3,function(f){const g=Date.now(),b=n[a];i||(i=g),r[o]=f,n[o]=g;let _=a,O=0;for(;_!==o;)O+=r[_++],_=_%e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),g-i{r=b,o=null,a&&(clearTimeout(a),a=null),e.apply(null,g)};return[(...g)=>{const b=Date.now(),_=b-r;_>=n?i(g,b):(o=g,a||(a=setTimeout(()=>{a=null,i(o)},n-_)))},()=>o&&i(o)]}const Lc=(e,t,r=3)=>{let n=0;const o=cR(50,250);return dR(a=>{const i=a.loaded,u=a.lengthComputable?a.total:void 0,f=i-n,g=o(f),b=i<=u;n=i;const _={loaded:i,total:u,progress:u?i/u:void 0,bytes:f,rate:g||void 0,estimated:g&&u&&b?(u-i)/g:void 0,event:a,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(_)},r)},Xv=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Jv=e=>(...t)=>ye.asap(()=>e(...t)),fR=rn.hasStandardBrowserEnv?function(){const t=rn.navigator&&/(msie|trident)/i.test(rn.navigator.userAgent),r=document.createElement("a");let n;function o(a){let i=a;return t&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(i){const u=ye.isString(i)?o(i):i;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}(),pR=rn.hasStandardBrowserEnv?{write(e,t,r,n,o,a){const i=[e+"="+encodeURIComponent(t)];ye.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),ye.isString(n)&&i.push("path="+n),ye.isString(o)&&i.push("domain="+o),a===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hR(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function gR(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function l_(e,t){return e&&!hR(t)?gR(e,t):t}const Zv=e=>e instanceof Ln?{...e}:e;function Ga(e,t){t=t||{};const r={};function n(g,b,_){return ye.isPlainObject(g)&&ye.isPlainObject(b)?ye.merge.call({caseless:_},g,b):ye.isPlainObject(b)?ye.merge({},b):ye.isArray(b)?b.slice():b}function o(g,b,_){if(ye.isUndefined(b)){if(!ye.isUndefined(g))return n(void 0,g,_)}else return n(g,b,_)}function a(g,b){if(!ye.isUndefined(b))return n(void 0,b)}function i(g,b){if(ye.isUndefined(b)){if(!ye.isUndefined(g))return n(void 0,g)}else return n(void 0,b)}function u(g,b,_){if(_ in t)return n(g,b);if(_ in e)return n(void 0,g)}const f={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(g,b)=>o(Zv(g),Zv(b),!0)};return ye.forEach(Object.keys(Object.assign({},e,t)),function(b){const _=f[b]||o,O=_(e[b],t[b],b);ye.isUndefined(O)&&_!==u||(r[b]=O)}),r}const s_=e=>{const t=Ga({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:u}=t;t.headers=i=Ln.from(i),t.url=r_(l_(t.baseURL,t.url),e.params,e.paramsSerializer),u&&i.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(ye.isFormData(r)){if(rn.hasStandardBrowserEnv||rn.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[g,...b]=f?f.split(";").map(_=>_.trim()).filter(Boolean):[];i.setContentType([g||"multipart/form-data",...b].join("; "))}}if(rn.hasStandardBrowserEnv&&(n&&ye.isFunction(n)&&(n=n(t)),n||n!==!1&&fR(t.url))){const g=o&&a&&pR.read(a);g&&i.set(o,g)}return t},mR=typeof XMLHttpRequest<"u",bR=mR&&function(e){return new Promise(function(r,n){const o=s_(e);let a=o.data;const i=Ln.from(o.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:g}=o,b,_,O,S,C;function w(){S&&S(),C&&C(),o.cancelToken&&o.cancelToken.unsubscribe(b),o.signal&&o.signal.removeEventListener("abort",b)}let m=new XMLHttpRequest;m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout;function d(){if(!m)return;const c=Ln.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),h={data:!u||u==="text"||u==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:c,config:e,request:m};i_(function(y){r(y),w()},function(y){n(y),w()},h),m=null}"onloadend"in m?m.onloadend=d:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(d)},m.onabort=function(){m&&(n(new it("Request aborted",it.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new it("Network Error",it.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let s=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const h=o.transitional||n_;o.timeoutErrorMessage&&(s=o.timeoutErrorMessage),n(new it(s,h.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,e,m)),m=null},a===void 0&&i.setContentType(null),"setRequestHeader"in m&&ye.forEach(i.toJSON(),function(s,h){m.setRequestHeader(h,s)}),ye.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),u&&u!=="json"&&(m.responseType=o.responseType),g&&([O,C]=Lc(g,!0),m.addEventListener("progress",O)),f&&m.upload&&([_,S]=Lc(f),m.upload.addEventListener("progress",_),m.upload.addEventListener("loadend",S)),(o.cancelToken||o.signal)&&(b=c=>{m&&(n(!c||c.type?new hl(null,e,m):c),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(b),o.signal&&(o.signal.aborted?b():o.signal.addEventListener("abort",b)));const l=uR(o.url);if(l&&rn.protocols.indexOf(l)===-1){n(new it("Unsupported protocol "+l+":",it.ERR_BAD_REQUEST,e));return}m.send(a||null)})},vR=(e,t)=>{let r=new AbortController,n;const o=function(f){if(!n){n=!0,i();const g=f instanceof Error?f:this.reason;r.abort(g instanceof it?g:new hl(g instanceof Error?g.message:g))}};let a=t&&setTimeout(()=>{o(new it(`timeout ${t} of ms exceeded`,it.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(f=>{f&&(f.removeEventListener?f.removeEventListener("abort",o):f.unsubscribe(o))}),e=null)};e.forEach(f=>f&&f.addEventListener&&f.addEventListener("abort",o));const{signal:u}=r;return u.unsubscribe=i,[u,()=>{a&&clearTimeout(a),a=null}]},yR=vR,wR=function*(e,t){let r=e.byteLength;if(!t||r{const a=xR(e,t,o);let i=0,u,f=g=>{u||(u=!0,n&&n(g))};return new ReadableStream({async pull(g){try{const{done:b,value:_}=await a.next();if(b){f(),g.close();return}let O=_.byteLength;if(r){let S=i+=O;r(S)}g.enqueue(new Uint8Array(_))}catch(b){throw f(b),b}},cancel(g){return f(g),a.return()}},{highWaterMark:2})},zd=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",u_=zd&&typeof ReadableStream=="function",h0=zd&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),c_=(e,...t)=>{try{return!!e(...t)}catch{return!1}},_R=u_&&c_(()=>{let e=!1;const t=new Request(rn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ty=64*1024,g0=u_&&c_(()=>ye.isReadableStream(new Response("").body)),Fc={stream:g0&&(e=>e.body)};zd&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Fc[t]&&(Fc[t]=ye.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new it(`Response type '${t}' is not supported`,it.ERR_NOT_SUPPORT,n)})})})(new Response);const CR=async e=>{if(e==null)return 0;if(ye.isBlob(e))return e.size;if(ye.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(ye.isArrayBufferView(e)||ye.isArrayBuffer(e))return e.byteLength;if(ye.isURLSearchParams(e)&&(e=e+""),ye.isString(e))return(await h0(e)).byteLength},SR=async(e,t)=>{const r=ye.toFiniteNumber(e.getContentLength());return r??CR(t)},TR=zd&&(async e=>{let{url:t,method:r,data:n,signal:o,cancelToken:a,timeout:i,onDownloadProgress:u,onUploadProgress:f,responseType:g,headers:b,withCredentials:_="same-origin",fetchOptions:O}=s_(e);g=g?(g+"").toLowerCase():"text";let[S,C]=o||a||i?yR([o,a],i):[],w,m;const d=()=>{!w&&setTimeout(()=>{S&&S.unsubscribe()}),w=!0};let l;try{if(f&&_R&&r!=="get"&&r!=="head"&&(l=await SR(b,n))!==0){let y=new Request(t,{method:"POST",body:n,duplex:"half"}),E;if(ye.isFormData(n)&&(E=y.headers.get("content-type"))&&b.setContentType(E),y.body){const[P,N]=Xv(l,Lc(Jv(f)));n=ey(y.body,ty,P,N,h0)}}ye.isString(_)||(_=_?"include":"omit");const c="credentials"in Request.prototype;m=new Request(t,{...O,signal:S,method:r.toUpperCase(),headers:b.normalize().toJSON(),body:n,duplex:"half",credentials:c?_:void 0});let s=await fetch(m);const h=g0&&(g==="stream"||g==="response");if(g0&&(u||h)){const y={};["status","statusText","headers"].forEach(R=>{y[R]=s[R]});const E=ye.toFiniteNumber(s.headers.get("content-length")),[P,N]=u&&Xv(E,Lc(Jv(u),!0))||[];s=new Response(ey(s.body,ty,P,()=>{N&&N(),h&&d()},h0),y)}g=g||"text";let v=await Fc[ye.findKey(Fc,g)||"text"](s,e);return!h&&d(),C&&C(),await new Promise((y,E)=>{i_(y,E,{data:v,headers:Ln.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:m})})}catch(c){throw d(),c&&c.name==="TypeError"&&/fetch/i.test(c.message)?Object.assign(new it("Network Error",it.ERR_NETWORK,e,m),{cause:c.cause||c}):it.from(c,c&&c.code,e,m)}}),m0={http:B2,xhr:bR,fetch:TR};ye.forEach(m0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ry=e=>`- ${e}`,OR=e=>ye.isFunction(e)||e===null||e===!1,d_={getAdapter:e=>{e=ye.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let a=0;a`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?a.length>1?`since : `+a.map(ry).join(` `):" "+ry(a[0]):"as no adapter specified";throw new it("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n},adapters:m0};function bp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hl(null,e)}function ny(e){return bp(e),e.headers=Ln.from(e.headers),e.data=mp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),d_.getAdapter(e.adapter||eg.adapter)(e).then(function(n){return bp(e),n.data=mp.call(e,e.transformResponse,n),n.headers=Ln.from(n.headers),n},function(n){return a_(n)||(bp(e),n&&n.response&&(n.response.data=mp.call(e,e.transformResponse,n.response),n.response.headers=Ln.from(n.response.headers))),Promise.reject(n)})}const f_="1.7.5",tg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tg[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const oy={};tg.transitional=function(t,r,n){function o(a,i){return"[Axios v"+f_+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,u)=>{if(t===!1)throw new it(o(i," has been removed"+(r?" in "+r:"")),it.ERR_DEPRECATED);return r&&!oy[i]&&(oy[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,i,u):!0}};function PR(e,t,r){if(typeof e!="object")throw new it("options must be an object",it.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const a=n[o],i=t[a];if(i){const u=e[a],f=u===void 0||i(u,a,e);if(f!==!0)throw new it("option "+a+" must be "+f,it.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new it("Unknown option "+a,it.ERR_BAD_OPTION)}}const b0={assertOptions:PR,validators:tg},$o=b0.validators;class zc{constructor(t){this.defaults=t,this.interceptors={request:new Yv,response:new Yv}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ga(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:a}=r;n!==void 0&&b0.assertOptions(n,{silentJSONParsing:$o.transitional($o.boolean),forcedJSONParsing:$o.transitional($o.boolean),clarifyTimeoutError:$o.transitional($o.boolean)},!1),o!=null&&(ye.isFunction(o)?r.paramsSerializer={serialize:o}:b0.assertOptions(o,{encode:$o.function,serialize:$o.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&ye.merge(a.common,a[r.method]);a&&ye.forEach(["delete","get","head","post","put","patch","common"],C=>{delete a[C]}),r.headers=Ln.concat(i,a);const u=[];let f=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(r)===!1||(f=f&&w.synchronous,u.unshift(w.fulfilled,w.rejected))});const g=[];this.interceptors.response.forEach(function(w){g.push(w.fulfilled,w.rejected)});let b,_=0,O;if(!f){const C=[ny.bind(this),void 0];for(C.unshift.apply(C,u),C.push.apply(C,g),O=C.length,b=Promise.resolve(r);_{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](o);n._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(u=>{n.subscribe(u),a=u}).then(o);return i.cancel=function(){n.unsubscribe(a)},i},t(function(a,i,u){n.reason||(n.reason=new hl(a,i,u),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new rg(function(o){t=o}),cancel:t}}}const kR=rg;function ER(e){return function(r){return e.apply(null,r)}}function NR(e){return ye.isObject(e)&&e.isAxiosError===!0}const v0={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(v0).forEach(([e,t])=>{v0[t]=e});const jR=v0;function p_(e){const t=new cc(e),r=Hx(cc.prototype.request,t);return ye.extend(r,cc.prototype,t,{allOwnKeys:!0}),ye.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return p_(Ga(e,o))},r}const or=p_(eg);or.Axios=cc;or.CanceledError=hl;or.CancelToken=kR;or.isCancel=a_;or.VERSION=f_;or.toFormData=Ld;or.AxiosError=it;or.Cancel=or.CanceledError;or.all=function(t){return Promise.all(t)};or.spread=ER;or.isAxiosError=NR;or.mergeConfig=Ga;or.AxiosHeaders=Ln;or.formToJSON=e=>o_(ye.isHTMLForm(e)?new FormData(e):e);or.getAdapter=d_.getAdapter;or.HttpStatusCode=jR;or.default=or;const at=or;var y0={},h_={exports:{}},sn={},g_={exports:{}},m_={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(e){function t($,z){var H=$.length;$.push(z);e:for(;0>>1,X=$[G];if(0>>1;Go(pe,H))oeo(se,pe)?($[G]=se,$[oe]=H,G=oe):($[G]=pe,$[fe]=H,G=fe);else if(oeo(se,H))$[G]=se,$[oe]=H,G=oe;else break e}}return z}function o($,z){var H=$.sortIndex-z.sortIndex;return H!==0?H:$.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var f=[],g=[],b=1,_=null,O=3,S=!1,C=!1,w=!1,m=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function c($){for(var z=r(g);z!==null;){if(z.callback===null)n(g);else if(z.startTime<=$)n(g),z.sortIndex=z.expirationTime,t(f,z);else break;z=r(g)}}function s($){if(w=!1,c($),!C)if(r(f)!==null)C=!0,U(h);else{var z=r(g);z!==null&&Y(s,z.startTime-$)}}function h($,z){C=!1,w&&(w=!1,d(E),E=-1),S=!0;var H=O;try{for(c(z),_=r(f);_!==null&&(!(_.expirationTime>z)||$&&!R());){var G=_.callback;if(typeof G=="function"){_.callback=null,O=_.priorityLevel;var X=G(_.expirationTime<=z);z=e.unstable_now(),typeof X=="function"?_.callback=X:_===r(f)&&n(f),c(z)}else n(f);_=r(f)}if(_!==null)var ie=!0;else{var fe=r(g);fe!==null&&Y(s,fe.startTime-z),ie=!1}return ie}finally{_=null,O=H,S=!1}}var v=!1,y=null,E=-1,P=5,N=-1;function R(){return!(e.unstable_now()-N$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return O},e.unstable_getFirstCallbackNode=function(){return r(f)},e.unstable_next=function($){switch(O){case 1:case 2:case 3:var z=3;break;default:z=O}var H=O;O=z;try{return $()}finally{O=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=O;O=$;try{return z()}finally{O=H}},e.unstable_scheduleCallback=function($,z,H){var G=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0G?($.sortIndex=H,t(g,$),r(f)===null&&$===r(g)&&(w?(d(E),E=-1):w=!0,Y(s,H-G))):($.sortIndex=X,t(f,$),C||S||(C=!0,U(h))),$},e.unstable_shouldYield=R,e.unstable_wrapCallback=function($){var z=O;return function(){var H=O;O=z;try{return $.apply(this,arguments)}finally{O=H}}}})(m_);g_.exports=m_;var RR=g_.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var b_=j,an=RR;function ke(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),w0=Object.prototype.hasOwnProperty,AR=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ay={},iy={};function MR(e){return w0.call(iy,e)?!0:w0.call(ay,e)?!1:AR.test(e)?iy[e]=!0:(ay[e]=!0,!1)}function IR(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function DR(e,t,r,n){if(t===null||typeof t>"u"||IR(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Lr(e,t,r,n,o,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var vr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){vr[e]=new Lr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];vr[t]=new Lr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){vr[e]=new Lr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){vr[e]=new Lr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){vr[e]=new Lr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){vr[e]=new Lr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){vr[e]=new Lr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){vr[e]=new Lr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){vr[e]=new Lr(e,5,!1,e.toLowerCase(),null,!1,!1)});var ng=/[\-:]([a-z])/g;function og(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ng,og);vr[t]=new Lr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ng,og);vr[t]=new Lr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ng,og);vr[t]=new Lr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){vr[e]=new Lr(e,1,!1,e.toLowerCase(),null,!1,!1)});vr.xlinkHref=new Lr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){vr[e]=new Lr(e,1,!1,e.toLowerCase(),null,!0,!0)});function ag(e,t,r,n){var o=vr.hasOwnProperty(t)?vr[t]:null;(o!==null?o.type!==0:n||!(2u||o[i]!==a[u]){var f=` `+o[i].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=i&&0<=u);break}}}finally{yp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ts(e):""}function LR(e){switch(e.tag){case 5:return ts(e.type);case 16:return ts("Lazy");case 13:return ts("Suspense");case 19:return ts("SuspenseList");case 0:case 2:case 15:return e=wp(e.type,!1),e;case 11:return e=wp(e.type.render,!1),e;case 1:return e=wp(e.type,!0),e;default:return""}}function S0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Oi:return"Fragment";case Ti:return"Portal";case x0:return"Profiler";case ig:return"StrictMode";case _0:return"Suspense";case C0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w_:return(e.displayName||"Context")+".Consumer";case y_:return(e._context.displayName||"Context")+".Provider";case lg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sg:return t=e.displayName||null,t!==null?t:S0(e.type)||"Memo";case Xo:t=e._payload,e=e._init;try{return S0(e(t))}catch{}}return null}function FR(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return S0(t);case 8:return t===ig?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ma(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function __(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zR(e){var t=__(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){n=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mu(e){e._valueTracker||(e._valueTracker=zR(e))}function C_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=__(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Bc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function T0(e,t){var r=t.checked;return $t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function sy(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ma(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function S_(e,t){t=t.checked,t!=null&&ag(e,"checked",t,!1)}function O0(e,t){S_(e,t);var r=ma(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?P0(e,t.type,r):t.hasOwnProperty("defaultValue")&&P0(e,t.type,ma(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uy(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function P0(e,t,r){(t!=="number"||Bc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var rs=Array.isArray;function zi(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Iu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ss(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ss={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},BR=["Webkit","ms","Moz","O"];Object.keys(ss).forEach(function(e){BR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ss[t]=ss[e]})});function k_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ss.hasOwnProperty(e)&&ss[e]?(""+t).trim():t+"px"}function E_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=k_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var VR=$t({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function N0(e,t){if(t){if(VR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ke(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ke(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ke(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ke(62))}}function j0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var R0=null;function ug(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var A0=null,Bi=null,Vi=null;function fy(e){if(e=tu(e)){if(typeof A0!="function")throw Error(ke(280));var t=e.stateNode;t&&(t=Hd(t),A0(e.stateNode,e.type,t))}}function N_(e){Bi?Vi?Vi.push(e):Vi=[e]:Bi=e}function j_(){if(Bi){var e=Bi,t=Vi;if(Vi=Bi=null,fy(e),t)for(e=0;e>>=0,e===0?32:31-(JR(e)/ZR|0)|0}var Du=64,Lu=4194304;function ns(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,a=e.pingedLanes,i=r&268435455;if(i!==0){var u=i&~o;u!==0?n=ns(u):(a&=i,a!==0&&(n=ns(a)))}else i=r&~o,i!==0?n=ns(i):a!==0&&(n=ns(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,a=t&-t,o>=a||o===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Zs(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fn(t),e[t]=r}function nA(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=cs),xy=String.fromCharCode(32),_y=!1;function X_(e,t){switch(e){case"keyup":return jA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pi=!1;function AA(e,t){switch(e){case"compositionend":return J_(t);case"keypress":return t.which!==32?null:(_y=!0,xy);case"textInput":return e=t.data,e===xy&&_y?null:e;default:return null}}function MA(e,t){if(Pi)return e==="compositionend"||!bg&&X_(e,t)?(e=Y_(),fc=hg=ra=null,Pi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Oy(r)}}function rC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nC(){for(var e=window,t=Bc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Bc(e.document)}return t}function vg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function WA(e){var t=nC(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&rC(r.ownerDocument.documentElement,r)){if(n!==null&&vg(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,a=Math.min(n.start,o);n=n.end===void 0?a:Math.min(n.end,o),!e.extend&&a>n&&(o=n,n=a,a=o),o=Py(r,a);var i=Py(r,n);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,ki=null,z0=null,fs=null,B0=!1;function ky(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;B0||ki==null||ki!==Bc(n)||(n=ki,"selectionStart"in n&&vg(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),fs&&Ns(fs,n)||(fs=n,n=Gc(z0,"onSelect"),0ji||(e.current=q0[ji],q0[ji]=null,ji--)}function kt(e,t){ji++,q0[ji]=e.current,e.current=t}var ba={},Er=wa(ba),$r=wa(!1),Ka=ba;function Xi(e,t){var r=e.type.contextTypes;if(!r)return ba;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},a;for(a in r)o[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function qr(e){return e=e.childContextTypes,e!=null}function Yc(){It($r),It(Er)}function Iy(e,t,r){if(Er.current!==ba)throw Error(ke(168));kt(Er,t),kt($r,r)}function fC(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(ke(108,FR(e)||"Unknown",o));return $t({},r,n)}function Qc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ba,Ka=Er.current,kt(Er,e),kt($r,$r.current),!0}function Dy(e,t,r){var n=e.stateNode;if(!n)throw Error(ke(169));r?(e=fC(e,t,Ka),n.__reactInternalMemoizedMergedChildContext=e,It($r),It(Er),kt(Er,e)):It($r),kt($r,r)}var yo=null,$d=!1,Mp=!1;function pC(e){yo===null?yo=[e]:yo.push(e)}function tM(e){$d=!0,pC(e)}function xa(){if(!Mp&&yo!==null){Mp=!0;var e=0,t=xt;try{var r=yo;for(xt=1;e>=i,o-=i,wo=1<<32-Fn(t)+o|r<E?(P=y,y=null):P=y.sibling;var N=O(d,y,c[E],s);if(N===null){y===null&&(y=P);break}e&&y&&N.alternate===null&&t(d,y),l=a(N,l,E),v===null?h=N:v.sibling=N,v=N,y=P}if(E===c.length)return r(d,y),Ft&&Da(d,E),h;if(y===null){for(;EE?(P=y,y=null):P=y.sibling;var R=O(d,y,N.value,s);if(R===null){y===null&&(y=P);break}e&&y&&R.alternate===null&&t(d,y),l=a(R,l,E),v===null?h=R:v.sibling=R,v=R,y=P}if(N.done)return r(d,y),Ft&&Da(d,E),h;if(y===null){for(;!N.done;E++,N=c.next())N=_(d,N.value,s),N!==null&&(l=a(N,l,E),v===null?h=N:v.sibling=N,v=N);return Ft&&Da(d,E),h}for(y=n(d,y);!N.done;E++,N=c.next())N=S(y,d,E,N.value,s),N!==null&&(e&&N.alternate!==null&&y.delete(N.key===null?E:N.key),l=a(N,l,E),v===null?h=N:v.sibling=N,v=N);return e&&y.forEach(function(M){return t(d,M)}),Ft&&Da(d,E),h}function m(d,l,c,s){if(typeof c=="object"&&c!==null&&c.type===Oi&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case Au:e:{for(var h=c.key,v=l;v!==null;){if(v.key===h){if(h=c.type,h===Oi){if(v.tag===7){r(d,v.sibling),l=o(v,c.props.children),l.return=d,d=l;break e}}else if(v.elementType===h||typeof h=="object"&&h!==null&&h.$$typeof===Xo&&Wy(h)===v.type){r(d,v.sibling),l=o(v,c.props),l.ref=Kl(d,v,c),l.return=d,d=l;break e}r(d,v);break}else t(d,v);v=v.sibling}c.type===Oi?(l=$a(c.props.children,d.mode,s,c.key),l.return=d,d=l):(s=wc(c.type,c.key,c.props,null,d.mode,s),s.ref=Kl(d,l,c),s.return=d,d=s)}return i(d);case Ti:e:{for(v=c.key;l!==null;){if(l.key===v)if(l.tag===4&&l.stateNode.containerInfo===c.containerInfo&&l.stateNode.implementation===c.implementation){r(d,l.sibling),l=o(l,c.children||[]),l.return=d,d=l;break e}else{r(d,l);break}else t(d,l);l=l.sibling}l=Up(c,d.mode,s),l.return=d,d=l}return i(d);case Xo:return v=c._init,m(d,l,v(c._payload),s)}if(rs(c))return C(d,l,c,s);if(Wl(c))return w(d,l,c,s);Hu(d,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,l!==null&&l.tag===6?(r(d,l.sibling),l=o(l,c),l.return=d,d=l):(r(d,l),l=Vp(c,d.mode,s),l.return=d,d=l),i(d)):r(d,l)}return m}var Zi=xC(!0),_C=xC(!1),ru={},ao=wa(ru),Ms=wa(ru),Is=wa(ru);function Ua(e){if(e===ru)throw Error(ke(174));return e}function Pg(e,t){switch(kt(Is,t),kt(Ms,e),kt(ao,ru),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:E0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=E0(t,e)}It(ao),kt(ao,t)}function el(){It(ao),It(Ms),It(Is)}function CC(e){Ua(Is.current);var t=Ua(ao.current),r=E0(t,e.type);t!==r&&(kt(Ms,e),kt(ao,r))}function kg(e){Ms.current===e&&(It(ao),It(Ms))}var Vt=wa(0);function rd(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ip=[];function Eg(){for(var e=0;er?r:4,e(!0);var n=Dp.transition;Dp.transition={};try{e(!1),t()}finally{xt=r,Dp.transition=n}}function zC(){return Tn().memoizedState}function aM(e,t,r){var n=da(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},BC(e))VC(t,r);else if(r=bC(e,t,r,n),r!==null){var o=Ir();zn(r,e,n,o),UC(r,t,n)}}function iM(e,t,r){var n=da(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(BC(e))VC(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,u=a(i,r);if(o.hasEagerState=!0,o.eagerState=u,Vn(u,i)){var f=t.interleaved;f===null?(o.next=o,Tg(t)):(o.next=f.next,f.next=o),t.interleaved=o;return}}catch{}finally{}r=bC(e,t,o,n),r!==null&&(o=Ir(),zn(r,e,n,o),UC(r,t,n))}}function BC(e){var t=e.alternate;return e===Wt||t!==null&&t===Wt}function VC(e,t){ps=nd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function UC(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,dg(e,r)}}var od={readContext:Sn,useCallback:Cr,useContext:Cr,useEffect:Cr,useImperativeHandle:Cr,useInsertionEffect:Cr,useLayoutEffect:Cr,useMemo:Cr,useReducer:Cr,useRef:Cr,useState:Cr,useDebugValue:Cr,useDeferredValue:Cr,useTransition:Cr,useMutableSource:Cr,useSyncExternalStore:Cr,useId:Cr,unstable_isNewReconciler:!1},lM={readContext:Sn,useCallback:function(e,t){return ro().memoizedState=[e,t===void 0?null:t],e},useContext:Sn,useEffect:$y,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mc(4194308,4,MC.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mc(4194308,4,e,t)},useInsertionEffect:function(e,t){return mc(4,2,e,t)},useMemo:function(e,t){var r=ro();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ro();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=aM.bind(null,Wt,e),[n.memoizedState,e]},useRef:function(e){var t=ro();return e={current:e},t.memoizedState=e},useState:Hy,useDebugValue:Mg,useDeferredValue:function(e){return ro().memoizedState=e},useTransition:function(){var e=Hy(!1),t=e[0];return e=oM.bind(null,e[1]),ro().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Wt,o=ro();if(Ft){if(r===void 0)throw Error(ke(407));r=r()}else{if(r=t(),hr===null)throw Error(ke(349));Qa&30||OC(n,t,r)}o.memoizedState=r;var a={value:r,getSnapshot:t};return o.queue=a,$y(kC.bind(null,n,a,e),[e]),n.flags|=2048,Fs(9,PC.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ro(),t=hr.identifierPrefix;if(Ft){var r=xo,n=wo;r=(n&~(1<<32-Fn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ds++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[no]=t,e[As]=n,XC(e,t,!1,!1),t.stateNode=e;e:{switch(i=j0(r,n),r){case"dialog":At("cancel",e),At("close",e),o=n;break;case"iframe":case"object":case"embed":At("load",e),o=n;break;case"video":case"audio":for(o=0;orl&&(t.flags|=128,n=!0,Yl(a,!1),t.lanes=4194304)}else{if(!n)if(e=rd(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Yl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!Ft)return Sr(t),null}else 2*er()-a.renderingStartTime>rl&&r!==1073741824&&(t.flags|=128,n=!0,Yl(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(r=a.last,r!==null?r.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=er(),t.sibling=null,r=Vt.current,kt(Vt,n?r&1|2:r&1),t):(Sr(t),null);case 22:case 23:return Bg(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Zr&1073741824&&(Sr(t),t.subtreeFlags&6&&(t.flags|=8192)):Sr(t),null;case 24:return null;case 25:return null}throw Error(ke(156,t.tag))}function gM(e,t){switch(wg(t),t.tag){case 1:return qr(t.type)&&Yc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return el(),It($r),It(Er),Eg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return kg(t),null;case 13:if(It(Vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ke(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return It(Vt),null;case 4:return el(),null;case 10:return Sg(t.type._context),null;case 22:case 23:return Bg(),null;case 24:return null;default:return null}}var qu=!1,Pr=!1,mM=typeof WeakSet=="function"?WeakSet:Set,Le=null;function Ii(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Qt(e,t,n)}else r.current=null}function oh(e,t,r){try{r()}catch(n){Qt(e,t,n)}}var ew=!1;function bM(e,t){if(V0=$c,e=nC(),vg(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var i=0,u=-1,f=-1,g=0,b=0,_=e,O=null;t:for(;;){for(var S;_!==r||o!==0&&_.nodeType!==3||(u=i+o),_!==a||n!==0&&_.nodeType!==3||(f=i+n),_.nodeType===3&&(i+=_.nodeValue.length),(S=_.firstChild)!==null;)O=_,_=S;for(;;){if(_===e)break t;if(O===r&&++g===o&&(u=i),O===a&&++b===n&&(f=i),(S=_.nextSibling)!==null)break;_=O,O=_.parentNode}_=S}r=u===-1||f===-1?null:{start:u,end:f}}else r=null}r=r||{start:0,end:0}}else r=null;for(U0={focusedElem:e,selectionRange:r},$c=!1,Le=t;Le!==null;)if(t=Le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Le=e;else for(;Le!==null;){t=Le;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var w=C.memoizedProps,m=C.memoizedState,d=t.stateNode,l=d.getSnapshotBeforeUpdate(t.elementType===t.type?w:jn(t.type,w),m);d.__reactInternalSnapshotBeforeUpdate=l}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(s){Qt(t,t.return,s)}if(e=t.sibling,e!==null){e.return=t.return,Le=e;break}Le=t.return}return C=ew,ew=!1,C}function hs(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,a!==void 0&&oh(t,r,a)}o=o.next}while(o!==n)}}function Kd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ah(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function e5(e){var t=e.alternate;t!==null&&(e.alternate=null,e5(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[no],delete t[As],delete t[$0],delete t[ZA],delete t[eM])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function t5(e){return e.tag===5||e.tag===3||e.tag===4}function tw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||t5(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ih(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Kc));else if(n!==4&&(e=e.child,e!==null))for(ih(e,t,r),e=e.sibling;e!==null;)ih(e,t,r),e=e.sibling}function lh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(lh(e,t,r),e=e.sibling;e!==null;)lh(e,t,r),e=e.sibling}var mr=null,Rn=!1;function qo(e,t,r){for(r=r.child;r!==null;)r5(e,t,r),r=r.sibling}function r5(e,t,r){if(oo&&typeof oo.onCommitFiberUnmount=="function")try{oo.onCommitFiberUnmount(Bd,r)}catch{}switch(r.tag){case 5:Pr||Ii(r,t);case 6:var n=mr,o=Rn;mr=null,qo(e,t,r),mr=n,Rn=o,mr!==null&&(Rn?(e=mr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):mr.removeChild(r.stateNode));break;case 18:mr!==null&&(Rn?(e=mr,r=r.stateNode,e.nodeType===8?Ap(e.parentNode,r):e.nodeType===1&&Ap(e,r),ks(e)):Ap(mr,r.stateNode));break;case 4:n=mr,o=Rn,mr=r.stateNode.containerInfo,Rn=!0,qo(e,t,r),mr=n,Rn=o;break;case 0:case 11:case 14:case 15:if(!Pr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var a=o,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&oh(r,t,i),o=o.next}while(o!==n)}qo(e,t,r);break;case 1:if(!Pr&&(Ii(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(u){Qt(r,t,u)}qo(e,t,r);break;case 21:qo(e,t,r);break;case 22:r.mode&1?(Pr=(n=Pr)||r.memoizedState!==null,qo(e,t,r),Pr=n):qo(e,t,r);break;default:qo(e,t,r)}}function rw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new mM),t.forEach(function(n){var o=OM.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function En(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=i),n&=~a}if(n=o,n=er()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*yM(n/1960))-n,10e?16:e,na===null)var n=!1;else{if(e=na,na=null,ld=0,mt&6)throw Error(ke(331));var o=mt;for(mt|=4,Le=e.current;Le!==null;){var a=Le,i=a.child;if(Le.flags&16){var u=a.deletions;if(u!==null){for(var f=0;fer()-Fg?Ha(e,0):Lg|=r),Gr(e,t)}function c5(e,t){t===0&&(e.mode&1?(t=Lu,Lu<<=1,!(Lu&130023424)&&(Lu=4194304)):t=1);var r=Ir();e=Eo(e,t),e!==null&&(Zs(e,t,r),Gr(e,r))}function TM(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),c5(e,r)}function OM(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ke(314))}n!==null&&n.delete(t),c5(e,r)}var d5;d5=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||$r.current)Wr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Wr=!1,pM(e,t,r);Wr=!!(e.flags&131072)}else Wr=!1,Ft&&t.flags&1048576&&hC(t,Jc,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;bc(e,t),e=t.pendingProps;var o=Xi(t,Er.current);Wi(t,r),o=jg(null,t,n,e,o,r);var a=Rg();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qr(n)?(a=!0,Qc(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Og(t),o.updater=qd,t.stateNode=o,o._reactInternals=t,X0(t,n,e,r),t=eh(null,t,n,!0,a,r)):(t.tag=0,Ft&&a&&yg(t),Mr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(bc(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=kM(n),e=jn(n,e),o){case 0:t=Z0(null,t,n,e,r);break e;case 1:t=Xy(null,t,n,e,r);break e;case 11:t=Yy(null,t,n,e,r);break e;case 14:t=Qy(null,t,n,jn(n.type,e),r);break e}throw Error(ke(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:jn(n,o),Z0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:jn(n,o),Xy(e,t,n,o,r);case 3:e:{if(KC(t),e===null)throw Error(ke(387));n=t.pendingProps,a=t.memoizedState,o=a.element,vC(e,t),td(t,n,null,r);var i=t.memoizedState;if(n=i.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){o=tl(Error(ke(423)),t),t=Jy(e,t,n,r,o);break e}else if(n!==o){o=tl(Error(ke(424)),t),t=Jy(e,t,n,r,o);break e}else for(en=sa(t.stateNode.containerInfo.firstChild),nn=t,Ft=!0,Mn=null,r=_C(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ji(),n===o){t=No(e,t,r);break e}Mr(e,t,n,r)}t=t.child}return t;case 5:return CC(t),e===null&&K0(t),n=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,i=o.children,W0(n,o)?i=null:a!==null&&W0(n,a)&&(t.flags|=32),GC(e,t),Mr(e,t,i,r),t.child;case 6:return e===null&&K0(t),null;case 13:return YC(e,t,r);case 4:return Pg(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Zi(t,null,n,r):Mr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:jn(n,o),Yy(e,t,n,o,r);case 7:return Mr(e,t,t.pendingProps,r),t.child;case 8:return Mr(e,t,t.pendingProps.children,r),t.child;case 12:return Mr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,a=t.memoizedProps,i=o.value,kt(Zc,n._currentValue),n._currentValue=i,a!==null)if(Vn(a.value,i)){if(a.children===o.children&&!$r.current){t=No(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var u=a.dependencies;if(u!==null){i=a.child;for(var f=u.firstContext;f!==null;){if(f.context===n){if(a.tag===1){f=So(-1,r&-r),f.tag=2;var g=a.updateQueue;if(g!==null){g=g.shared;var b=g.pending;b===null?f.next=f:(f.next=b.next,b.next=f),g.pending=f}}a.lanes|=r,f=a.alternate,f!==null&&(f.lanes|=r),Y0(a.return,r,t),u.lanes|=r;break}f=f.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(ke(341));i.lanes|=r,u=i.alternate,u!==null&&(u.lanes|=r),Y0(i,r,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}Mr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,Wi(t,r),o=Sn(o),n=n(o),t.flags|=1,Mr(e,t,n,r),t.child;case 14:return n=t.type,o=jn(n,t.pendingProps),o=jn(n.type,o),Qy(e,t,n,o,r);case 15:return $C(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:jn(n,o),bc(e,t),t.tag=1,qr(n)?(e=!0,Qc(t)):e=!1,Wi(t,r),wC(t,n,o),X0(t,n,o,r),eh(null,t,n,!0,e,r);case 19:return QC(e,t,r);case 22:return qC(e,t,r)}throw Error(ke(156,t.tag))};function f5(e,t){return F_(e,t)}function PM(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(e,t,r,n){return new PM(e,t,r,n)}function Ug(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kM(e){if(typeof e=="function")return Ug(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lg)return 11;if(e===sg)return 14}return 2}function fa(e,t){var r=e.alternate;return r===null?(r=wn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function wc(e,t,r,n,o,a){var i=2;if(n=e,typeof e=="function")Ug(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Oi:return $a(r.children,o,a,t);case ig:i=8,o|=8;break;case x0:return e=wn(12,r,t,o|2),e.elementType=x0,e.lanes=a,e;case _0:return e=wn(13,r,t,o),e.elementType=_0,e.lanes=a,e;case C0:return e=wn(19,r,t,o),e.elementType=C0,e.lanes=a,e;case x_:return Qd(r,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y_:i=10;break e;case w_:i=9;break e;case lg:i=11;break e;case sg:i=14;break e;case Xo:i=16,n=null;break e}throw Error(ke(130,e==null?e:typeof e,""))}return t=wn(i,r,t,o),t.elementType=e,t.type=n,t.lanes=a,t}function $a(e,t,r,n){return e=wn(7,e,n,t),e.lanes=r,e}function Qd(e,t,r,n){return e=wn(22,e,n,t),e.elementType=x_,e.lanes=r,e.stateNode={isHidden:!1},e}function Vp(e,t,r){return e=wn(6,e,null,t),e.lanes=r,e}function Up(e,t,r){return t=wn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function EM(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_p(0),this.expirationTimes=_p(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_p(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Wg(e,t,r,n,o,a,i,u,f){return e=new EM(e,t,r,u,f),t===1?(t=1,a===!0&&(t|=8)):t=0,a=wn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Og(a),e}function NM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m5)}catch(e){console.error(e)}}m5(),h_.exports=sn;var jo=h_.exports,cw=jo;y0.createRoot=cw.createRoot,y0.hydrateRoot=cw.hydrateRoot;/** * @remix-run/router v1.10.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Bs(){return Bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Gg(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DM(){return Math.random().toString(36).substr(2,8)}function fw(e,t){return{usr:e.state,key:e.key,idx:t}}function fh(e,t,r,n){return r===void 0&&(r=null),Bs({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bl(t):t,{state:r,key:t&&t.key||n||DM()})}function cd(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function bl(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function LM(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,u=oa.Pop,f=null,g=b();g==null&&(g=0,i.replaceState(Bs({},i.state,{idx:g}),""));function b(){return(i.state||{idx:null}).idx}function _(){u=oa.Pop;let m=b(),d=m==null?null:m-g;g=m,f&&f({action:u,location:w.location,delta:d})}function O(m,d){u=oa.Push;let l=fh(w.location,m,d);r&&r(l,m),g=b()+1;let c=fw(l,g),s=w.createHref(l);try{i.pushState(c,"",s)}catch(h){if(h instanceof DOMException&&h.name==="DataCloneError")throw h;o.location.assign(s)}a&&f&&f({action:u,location:w.location,delta:1})}function S(m,d){u=oa.Replace;let l=fh(w.location,m,d);r&&r(l,m),g=b();let c=fw(l,g),s=w.createHref(l);i.replaceState(c,"",s),a&&f&&f({action:u,location:w.location,delta:0})}function C(m){let d=o.location.origin!=="null"?o.location.origin:o.location.href,l=typeof m=="string"?m:cd(m);return Ht(d,"No window.location.(origin|href) available to create URL for href: "+l),new URL(l,d)}let w={get action(){return u},get location(){return e(o,i)},listen(m){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(dw,_),f=m,()=>{o.removeEventListener(dw,_),f=null}},createHref(m){return t(o,m)},createURL:C,encodeLocation(m){let d=C(m);return{pathname:d.pathname,search:d.search,hash:d.hash}},push:O,replace:S,go(m){return i.go(m)}};return w}var pw;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(pw||(pw={}));function FM(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?bl(t):t,o=Vs(n.pathname||"/",r);if(o==null)return null;let a=b5(e);zM(a);let i=null;for(let u=0;i==null&&u{let f={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};f.relativePath.startsWith("/")&&(Ht(f.relativePath.startsWith(n),'Absolute route path "'+f.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),f.relativePath=f.relativePath.slice(n.length));let g=pa([n,f.relativePath]),b=r.concat(f);a.children&&a.children.length>0&&(Ht(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),b5(a.children,t,b,g)),!(a.path==null&&!a.index)&&t.push({path:g,score:qM(g,a.index),routesMeta:b})};return e.forEach((a,i)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))o(a,i);else for(let f of v5(a.path))o(a,i,f)}),t}function v5(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return o?[a,""]:[a];let i=v5(n.join("/")),u=[];return u.push(...i.map(f=>f===""?a:[a,f].join("/"))),o&&u.push(...i),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function zM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:GM(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const BM=/^:\w+$/,VM=3,UM=2,WM=1,HM=10,$M=-2,hw=e=>e==="*";function qM(e,t){let r=e.split("/"),n=r.length;return r.some(hw)&&(n+=$M),t&&(n+=UM),r.filter(o=>!hw(o)).reduce((o,a)=>o+(BM.test(a)?VM:a===""?WM:HM),n)}function GM(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function KM(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let i=0;i{if(b==="*"){let O=u[_]||"";i=a.slice(0,a.length-O.length).replace(/(.)\/+$/,"$1")}return g[b]=XM(u[_]||"",b),g},{}),pathname:a,pathnameBase:i,pattern:e}}function YM(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Gg(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(i,u)=>(n.push(u),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function QM(e){try{return decodeURI(e)}catch(t){return Gg(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function XM(e,t){try{return decodeURIComponent(e)}catch(r){return Gg(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function Vs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function JM(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?bl(e):e;return{pathname:r?r.startsWith("/")?r:ZM(r,t):t,search:tI(n),hash:rI(o)}}function ZM(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Wp(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Kg(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Yg(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=bl(e):(o=Bs({},e),Ht(!o.pathname||!o.pathname.includes("?"),Wp("?","pathname","search",o)),Ht(!o.pathname||!o.pathname.includes("#"),Wp("#","pathname","hash",o)),Ht(!o.search||!o.search.includes("#"),Wp("#","search","hash",o)));let a=e===""||o.pathname==="",i=a?"/":o.pathname,u;if(n||i==null)u=r;else{let _=t.length-1;if(i.startsWith("..")){let O=i.split("/");for(;O[0]==="..";)O.shift(),_-=1;o.pathname=O.join("/")}u=_>=0?t[_]:"/"}let f=JM(o,u),g=i&&i!=="/"&&i.endsWith("/"),b=(a||i===".")&&r.endsWith("/");return!f.pathname.endsWith("/")&&(g||b)&&(f.pathname+="/"),f}const pa=e=>e.join("/").replace(/\/\/+/g,"/"),eI=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tI=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,rI=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function nI(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const y5=["post","put","patch","delete"];new Set(y5);const oI=["get",...y5];new Set(oI);/** * React Router v6.17.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function dd(){return dd=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.pathnameBase)),i=j.useRef(!1);return _5(()=>{i.current=!0}),j.useCallback(function(f,g){if(g===void 0&&(g={}),!i.current)return;if(typeof f=="number"){r.go(f);return}let b=Yg(f,JSON.parse(a),o,g.relative==="path");e==null&&t!=="/"&&(b.pathname=b.pathname==="/"?t:pa([t,b.pathname])),(g.replace?r.replace:r.push)(b,g.state,g)},[t,r,a,o,e])}function C5(){let{matches:e}=j.useContext(Mo),t=e[e.length-1];return t?t.params:{}}function nf(e,t){let{relative:r}=t===void 0?{}:t,{matches:n}=j.useContext(Mo),{pathname:o}=_a(),a=JSON.stringify(Kg(n).map(i=>i.pathnameBase));return j.useMemo(()=>Yg(e,JSON.parse(a),o,r==="path"),[e,a,o,r])}function lI(e,t){return sI(e,t)}function sI(e,t,r){vl()||Ht(!1);let{navigator:n}=j.useContext(ai),{matches:o}=j.useContext(Mo),a=o[o.length-1],i=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let f=_a(),g;if(t){var b;let w=typeof t=="string"?bl(t):t;u==="/"||(b=w.pathname)!=null&&b.startsWith(u)||Ht(!1),g=w}else g=f;let _=g.pathname||"/",O=u==="/"?_:_.slice(u.length)||"/",S=FM(e,{pathname:O}),C=pI(S&&S.map(w=>Object.assign({},w,{params:Object.assign({},i,w.params),pathname:pa([u,n.encodeLocation?n.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:pa([u,n.encodeLocation?n.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,r);return t&&C?j.createElement(rf.Provider,{value:{location:dd({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:oa.Pop}},C):C}function uI(){let e=bI(),t=nI(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},a=null;return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:o},r):null,a)}const cI=j.createElement(uI,null);class dI extends j.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error?j.createElement(Mo.Provider,{value:this.props.routeContext},j.createElement(x5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fI(e){let{routeContext:t,match:r,children:n}=e,o=j.useContext(tf);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(Mo.Provider,{value:t},n)}function pI(e,t,r){var n;if(t===void 0&&(t=[]),r===void 0&&(r=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let a=e,i=(n=r)==null?void 0:n.errors;if(i!=null){let u=a.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id]));u>=0||Ht(!1),a=a.slice(0,Math.min(a.length,u+1))}return a.reduceRight((u,f,g)=>{let b=f.route.id?i==null?void 0:i[f.route.id]:null,_=null;r&&(_=f.route.errorElement||cI);let O=t.concat(a.slice(0,g+1)),S=()=>{let C;return b?C=_:f.route.Component?C=j.createElement(f.route.Component,null):f.route.element?C=f.route.element:C=u,j.createElement(fI,{match:f,routeContext:{outlet:u,matches:O,isDataRoute:r!=null},children:C})};return r&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?j.createElement(dI,{location:r.location,revalidation:r.revalidation,component:_,error:b,children:S(),routeContext:{outlet:null,matches:O,isDataRoute:!0}}):S()},null)}var S5=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(S5||{}),fd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fd||{});function hI(e){let t=j.useContext(tf);return t||Ht(!1),t}function gI(e){let t=j.useContext(w5);return t||Ht(!1),t}function mI(e){let t=j.useContext(Mo);return t||Ht(!1),t}function T5(e){let t=mI(),r=t.matches[t.matches.length-1];return r.route.id||Ht(!1),r.route.id}function bI(){var e;let t=j.useContext(x5),r=gI(fd.UseRouteError),n=T5(fd.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function vI(){let{router:e}=hI(S5.UseNavigateStable),t=T5(fd.UseNavigateStable),r=j.useRef(!1);return _5(()=>{r.current=!0}),j.useCallback(function(o,a){a===void 0&&(a={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,dd({fromRouteId:t},a)))},[e,t])}function yI(e){let{to:t,replace:r,state:n,relative:o}=e;vl()||Ht(!1);let{matches:a}=j.useContext(Mo),{pathname:i}=_a(),u=ii(),f=Yg(t,Kg(a).map(b=>b.pathnameBase),i,o==="path"),g=JSON.stringify(f);return j.useEffect(()=>u(JSON.parse(g),{replace:r,state:n,relative:o}),[u,g,o,r,n]),null}function _o(e){Ht(!1)}function wI(e){let{basename:t="/",children:r=null,location:n,navigationType:o=oa.Pop,navigator:a,static:i=!1}=e;vl()&&Ht(!1);let u=t.replace(/^\/*/,"/"),f=j.useMemo(()=>({basename:u,navigator:a,static:i}),[u,a,i]);typeof n=="string"&&(n=bl(n));let{pathname:g="/",search:b="",hash:_="",state:O=null,key:S="default"}=n,C=j.useMemo(()=>{let w=Vs(g,u);return w==null?null:{location:{pathname:w,search:b,hash:_,state:O,key:S},navigationType:o}},[u,g,b,_,O,S,o]);return C==null?null:j.createElement(ai.Provider,{value:f},j.createElement(rf.Provider,{children:r,value:C}))}function Qg(e){let{children:t,location:r}=e;return lI(hh(t),r)}new Promise(()=>{});function hh(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,o)=>{if(!j.isValidElement(n))return;let a=[...t,o];if(n.type===j.Fragment){r.push.apply(r,hh(n.props.children,a));return}n.type!==_o&&Ht(!1),!n.props.index||!n.props.children||Ht(!1);let i={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=hh(n.props.children,a)),r.push(i)}),r}/** * React Router DOM v6.17.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function pd(){return pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[o]=e[o]);return r}function xI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _I(e,t){return e.button===0&&(!t||t==="_self")&&!xI(e)}const CI=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],SI=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],TI=j.createContext({isTransitioning:!1}),OI="startTransition",gw=Yh[OI];function PI(e){let{basename:t,children:r,future:n,window:o}=e,a=j.useRef();a.current==null&&(a.current=IM({window:o,v5Compat:!0}));let i=a.current,[u,f]=j.useState({action:i.action,location:i.location}),{v7_startTransition:g}=n||{},b=j.useCallback(_=>{g&&gw?gw(()=>f(_)):f(_)},[f,g]);return j.useLayoutEffect(()=>i.listen(b),[i,b]),j.createElement(wI,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:i})}const kI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",EI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,P5=j.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:a,replace:i,state:u,target:f,to:g,preventScrollReset:b,unstable_viewTransition:_}=t,O=O5(t,CI),{basename:S}=j.useContext(ai),C,w=!1;if(typeof g=="string"&&EI.test(g)&&(C=g,kI))try{let c=new URL(window.location.href),s=g.startsWith("//")?new URL(c.protocol+g):new URL(g),h=Vs(s.pathname,S);s.origin===c.origin&&h!=null?g=h+s.search+s.hash:w=!0}catch{}let m=aI(g,{relative:o}),d=RI(g,{replace:i,state:u,target:f,preventScrollReset:b,relative:o,unstable_viewTransition:_});function l(c){n&&n(c),c.defaultPrevented||d(c)}return j.createElement("a",pd({},O,{href:C||m,onClick:w||a?n:l,ref:r,target:f}))}),NI=j.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:u,to:f,unstable_viewTransition:g,children:b}=t,_=O5(t,SI),O=nf(f,{relative:_.relative}),S=_a(),C=j.useContext(w5),{navigator:w}=j.useContext(ai),m=C!=null&&AI(O)&&g===!0,d=w.encodeLocation?w.encodeLocation(O).pathname:O.pathname,l=S.pathname,c=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;o||(l=l.toLowerCase(),c=c?c.toLowerCase():null,d=d.toLowerCase());let s=l===d||!i&&l.startsWith(d)&&l.charAt(d.length)==="/",h=c!=null&&(c===d||!i&&c.startsWith(d)&&c.charAt(d.length)==="/"),v={isActive:s,isPending:h,isTransitioning:m},y=s?n:void 0,E;typeof a=="function"?E=a(v):E=[a,s?"active":null,h?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let P=typeof u=="function"?u(v):u;return j.createElement(P5,pd({},_,{"aria-current":y,className:E,ref:r,style:P,to:f,unstable_viewTransition:g}),typeof b=="function"?b(v):b)});var gh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gh||(gh={}));var mw;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mw||(mw={}));function jI(e){let t=j.useContext(tf);return t||Ht(!1),t}function RI(e,t){let{target:r,replace:n,state:o,preventScrollReset:a,relative:i,unstable_viewTransition:u}=t===void 0?{}:t,f=ii(),g=_a(),b=nf(e,{relative:i});return j.useCallback(_=>{if(_I(_,r)){_.preventDefault();let O=n!==void 0?n:cd(g)===cd(b);f(e,{replace:O,state:o,preventScrollReset:a,relative:i,unstable_viewTransition:u})}},[g,f,b,n,o,r,e,a,i,u])}function AI(e,t){t===void 0&&(t={});let r=j.useContext(TI);r==null&&Ht(!1);let{basename:n}=jI(gh.useViewTransitionState),o=nf(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=Vs(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Vs(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ph(o.pathname,i)!=null||ph(o.pathname,a)!=null}function MI({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M3 6.75A.75.75 0 013.75 6h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 6.75zM3 12a.75.75 0 01.75-.75h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 12zm0 5.25a.75.75 0 01.75-.75h16.5a.75.75 0 010 1.5H3.75a.75.75 0 01-.75-.75z",clipRule:"evenodd"}))}const II=j.forwardRef(MI),DI=II;function LI({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 00-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 00-2.282.819l-.922 1.597a1.875 1.875 0 00.432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 000 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 00-.432 2.385l.922 1.597a1.875 1.875 0 002.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 002.28-.819l.923-1.597a1.875 1.875 0 00-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 000-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 00-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 00-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 00-1.85-1.567h-1.843zM12 15.75a3.75 3.75 0 100-7.5 3.75 3.75 0 000 7.5z",clipRule:"evenodd"}))}const FI=j.forwardRef(LI),k5=FI;function zI({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M2.625 6.75a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875 0A.75.75 0 018.25 6h12a.75.75 0 010 1.5h-12a.75.75 0 01-.75-.75zM2.625 12a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zM7.5 12a.75.75 0 01.75-.75h12a.75.75 0 010 1.5h-12A.75.75 0 017.5 12zm-4.875 5.25a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875 0a.75.75 0 01.75-.75h12a.75.75 0 010 1.5h-12a.75.75 0 01-.75-.75z",clipRule:"evenodd"}))}const BI=j.forwardRef(zI),VI=BI;function UI({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{d:"M5.566 4.657A4.505 4.505 0 016.75 4.5h10.5c.41 0 .806.055 1.183.157A3 3 0 0015.75 3h-7.5a3 3 0 00-2.684 1.657zM2.25 12a3 3 0 013-3h13.5a3 3 0 013 3v6a3 3 0 01-3 3H5.25a3 3 0 01-3-3v-6zM5.25 7.5c-.41 0-.806.055-1.184.157A3 3 0 016.75 6h10.5a3 3 0 012.683 1.657A4.505 4.505 0 0018.75 7.5H5.25z"}))}const WI=j.forwardRef(UI),HI=WI;function $I({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{d:"M5.507 4.048A3 3 0 017.785 3h8.43a3 3 0 012.278 1.048l1.722 2.008A4.533 4.533 0 0019.5 6h-15c-.243 0-.482.02-.715.056l1.722-2.008z"}),j.createElement("path",{fillRule:"evenodd",d:"M1.5 10.5a3 3 0 013-3h15a3 3 0 110 6h-15a3 3 0 01-3-3zm15 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm2.25.75a.75.75 0 100-1.5.75.75 0 000 1.5zM4.5 15a3 3 0 100 6h15a3 3 0 100-6h-15zm11.25 3.75a.75.75 0 100-1.5.75.75 0 000 1.5zM19.5 18a.75.75 0 11-1.5 0 .75.75 0 011.5 0z",clipRule:"evenodd"}))}const qI=j.forwardRef($I),GI=qI;function KI({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{d:"M11.644 1.59a.75.75 0 01.712 0l9.75 5.25a.75.75 0 010 1.32l-9.75 5.25a.75.75 0 01-.712 0l-9.75-5.25a.75.75 0 010-1.32l9.75-5.25z"}),j.createElement("path",{d:"M3.265 10.602l7.668 4.129a2.25 2.25 0 002.134 0l7.668-4.13 1.37.739a.75.75 0 010 1.32l-9.75 5.25a.75.75 0 01-.71 0l-9.75-5.25a.75.75 0 010-1.32l1.37-.738z"}),j.createElement("path",{d:"M10.933 19.231l-7.668-4.13-1.37.739a.75.75 0 000 1.32l9.75 5.25c.221.12.489.12.71 0l9.75-5.25a.75.75 0 000-1.32l-1.37-.738-7.668 4.13a2.25 2.25 0 01-2.134-.001z"}))}const YI=j.forwardRef(KI),QI=YI;function XI({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M8.25 6.75a3.75 3.75 0 117.5 0 3.75 3.75 0 01-7.5 0zM15.75 9.75a3 3 0 116 0 3 3 0 01-6 0zM2.25 9.75a3 3 0 116 0 3 3 0 01-6 0zM6.31 15.117A6.745 6.745 0 0112 12a6.745 6.745 0 016.709 7.498.75.75 0 01-.372.568A12.696 12.696 0 0112 21.75c-2.305 0-4.47-.612-6.337-1.684a.75.75 0 01-.372-.568 6.787 6.787 0 011.019-4.38z",clipRule:"evenodd"}),j.createElement("path",{d:"M5.082 14.254a8.287 8.287 0 00-1.308 5.135 9.687 9.687 0 01-1.764-.44l-.115-.04a.563.563 0 01-.373-.487l-.01-.121a3.75 3.75 0 013.57-4.047zM20.226 19.389a8.287 8.287 0 00-1.308-5.135 3.75 3.75 0 013.57 4.047l-.01.121a.563.563 0 01-.373.486l-.115.04c-.567.2-1.156.349-1.764.441z"}))}const JI=j.forwardRef(XI),ZI=JI;function e4({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z",clipRule:"evenodd"}))}const t4=j.forwardRef(e4),r4=t4;function n4({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M12 6.75a5.25 5.25 0 016.775-5.025.75.75 0 01.313 1.248l-3.32 3.319c.063.475.276.934.641 1.299.365.365.824.578 1.3.64l3.318-3.319a.75.75 0 011.248.313 5.25 5.25 0 01-5.472 6.756c-1.018-.086-1.87.1-2.309.634L7.344 21.3A3.298 3.298 0 112.7 16.657l8.684-7.151c.533-.44.72-1.291.634-2.309A5.342 5.342 0 0112 6.75zM4.117 19.125a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75h-.008a.75.75 0 01-.75-.75v-.008z",clipRule:"evenodd"}),j.createElement("path",{d:"M10.076 8.64l-2.201-2.2V4.874a.75.75 0 00-.364-.643l-3.75-2.25a.75.75 0 00-.916.113l-.75.75a.75.75 0 00-.113.916l2.25 3.75a.75.75 0 00.643.364h1.564l2.062 2.062 1.575-1.297z"}),j.createElement("path",{fillRule:"evenodd",d:"M12.556 17.329l4.183 4.182a3.375 3.375 0 004.773-4.773l-3.306-3.305a6.803 6.803 0 01-1.53.043c-.394-.034-.682-.006-.867.042a.589.589 0 00-.167.063l-3.086 3.748zm3.414-1.36a.75.75 0 011.06 0l1.875 1.876a.75.75 0 11-1.06 1.06L15.97 17.03a.75.75 0 010-1.06z",clipRule:"evenodd"}))}const o4=j.forwardRef(n4),a4=o4;var Q={},E5={},N5={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n=[],o=0;oe&&(t=0,n=r,r=new Map)}return{get:function(a){var i=r.get(a);return i!==void 0?i:(i=n.get(a))!==void 0?(o(a,i),i):void 0},set:function(a,i){r.has(a)?r.set(a,i):o(a,i)}}}function s4(e){var t=e.separator||":";return function(r){for(var n=0,o=[],a=0,i=0;i1?t-1:0),n=1;nf.length)&&(g=f.length);for(var b=0,_=new Array(g);bm.length)&&(d=m.length);for(var l=0,c=new Array(d);ll.length)&&(c=l.length);for(var s=0,h=new Array(c);sl.length)&&(c=l.length);for(var s=0,h=new Array(c);sy.length)&&(E=y.length);for(var P=0,N=new Array(E);Ps.length)&&(h=s.length);for(var v=0,y=new Array(h);vd.length)&&(l=d.length);for(var c=0,s=new Array(l);ch.length)&&(v=h.length);for(var y=0,E=new Array(v);yc.length)&&(s=c.length);for(var h=0,v=new Array(s);hS.length)&&(C=S.length);for(var w=0,m=new Array(C);ww.length)&&(m=w.length);for(var d=0,l=new Array(m);d"u"?u[g]=i.cloneUnlessOtherwiseSpecified(f,i):i.isMergeableObject(f)?u[g]=(0,t.default)(o[g],f,i):o.indexOf(f)===-1&&u.push(f)}),u}})(ZS);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(S,C){for(var w in C)Object.defineProperty(S,w,{enumerable:!0,get:C[w]})}t(e,{MaterialTailwindTheme:function(){return b},ThemeProvider:function(){return _},useTheme:function(){return O}});var r=g(j),n=u($e),o=u(yr),a=u(Jg),i=u(ZS);function u(S){return S&&S.__esModule?S:{default:S}}function f(S){if(typeof WeakMap!="function")return null;var C=new WeakMap,w=new WeakMap;return(f=function(m){return m?w:C})(S)}function g(S,C){if(!C&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var w=f(C);if(w&&w.has(S))return w.get(S);var m={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in S)if(l!=="default"&&Object.prototype.hasOwnProperty.call(S,l)){var c=d?Object.getOwnPropertyDescriptor(S,l):null;c&&(c.get||c.set)?Object.defineProperty(m,l,c):m[l]=S[l]}return m.default=S,w&&w.set(S,m),m}var b=(0,r.createContext)(a.default);b.displayName="MaterialTailwindThemeProvider";function _(S){var C=S.value,w=C===void 0?a.default:C,m=S.children,d=(0,o.default)(a.default,w,{arrayMerge:i.default});return r.default.createElement(b.Provider,{value:d},m)}var O=function(){return(0,r.useContext)(b)};_.propTypes={value:n.default.instanceOf(Object),children:n.default.node.isRequired}})(ze);var af={},au={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(O,S){for(var C in S)Object.defineProperty(O,C,{enumerable:!0,get:S[C]})}t(e,{propTypesOpen:function(){return a},propTypesIcon:function(){return i},propTypesAnimate:function(){return u},propTypesDisabled:function(){return f},propTypesClassName:function(){return g},propTypesValue:function(){return b},propTypesChildren:function(){return _}});var r=o($e),n=Dt;function o(O){return O&&O.__esModule?O:{default:O}}var a=r.default.bool.isRequired,i=r.default.node,u=n.propTypesAnimation,f=r.default.bool,g=r.default.string,b=r.default.instanceOf(Object).isRequired,_=r.default.node.isRequired})(au);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(f,g){for(var b in g)Object.defineProperty(f,b,{enumerable:!0,get:g[b]})}t(e,{AccordionContext:function(){return a},useAccordion:function(){return i},AccordionContextProvider:function(){return u}});var r=o(j),n=au;function o(f){return f&&f.__esModule?f:{default:f}}var a=r.default.createContext(null);a.displayName="MaterialTailwind.AccordionContext";function i(){var f=r.default.useContext(a);if(!f)throw new Error("useAccordion() must be used within an Accordion. It happens when you use AccordionHeader or AccordionBody components outside the Accordion component.");return f}var u=function(f){var g=f.value,b=f.children;return r.default.createElement(a.Provider,{value:g},b)};u.propTypes={value:n.propTypesValue,children:n.propTypesChildren},u.displayName="MaterialTailwind.AccordionContextProvider"})(af);var eT={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{AccordionHeader:function(){return C},default:function(){return w}});var r=_(j),n=_(Xe),o=He,a=_(Be),i=af,u=ze,f=au;function g(m,d,l){return d in m?Object.defineProperty(m,d,{value:l,enumerable:!0,configurable:!0,writable:!0}):m[d]=l,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,c)&&(l[c]=m[c])}return l}function S(m,d){if(m==null)return{};var l={},c=Object.keys(m),s,h;for(h=0;h=0)&&(l[s]=m[s]);return l}var C=r.default.forwardRef(function(m,d){var l=m.className,c=m.children,s=O(m,["className","children"]),h=(0,i.useAccordion)(),v=h.open,y=h.icon,E=h.disabled,P=(0,u.useTheme)().accordion,N=P.styles.base;l=l??"";var R=(0,o.twMerge)((0,n.default)((0,a.default)(N.header.initial),g({},(0,a.default)(N.header.active),v)),l),M=(0,n.default)((0,a.default)(N.header.icon));return r.default.createElement("button",b({},s,{ref:d,type:"button",disabled:E,className:R}),c,r.default.createElement("span",{className:M},y??(v?r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},r.default.createElement("path",{fillRule:"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z",clipRule:"evenodd"})):r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},r.default.createElement("path",{fillRule:"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z",clipRule:"evenodd"})))))});C.propTypes={className:f.propTypesClassName,children:f.propTypesChildren},C.displayName="MaterialTailwind.AccordionHeader";var w=C})(eT);var tT={},gr={},yh=function(e,t){return yh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},yh(e,t)};function rT(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var gd=function(){return gd=Object.assign||function(t){for(var r,n=1,o=arguments.length;n=0;u--)(i=e[u])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function oT(e,t){return function(r,n){t(r,n,e)}}function aT(e,t,r,n,o,a){function i(d){if(d!==void 0&&typeof d!="function")throw new TypeError("Function expected");return d}for(var u=n.kind,f=u==="getter"?"get":u==="setter"?"set":"value",g=!t&&e?n.static?e:e.prototype:null,b=t||(g?Object.getOwnPropertyDescriptor(g,n.name):{}),_,O=!1,S=r.length-1;S>=0;S--){var C={};for(var w in n)C[w]=w==="access"?{}:n[w];for(var w in n.access)C.access[w]=n.access[w];C.addInitializer=function(d){if(O)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(d||null))};var m=(0,r[S])(u==="accessor"?{get:b.get,set:b.set}:b[f],C);if(u==="accessor"){if(m===void 0)continue;if(m===null||typeof m!="object")throw new TypeError("Object expected");(_=i(m.get))&&(b.get=_),(_=i(m.set))&&(b.set=_),(_=i(m.init))&&o.unshift(_)}else(_=i(m))&&(u==="field"?o.unshift(_):b[f]=_)}g&&Object.defineProperty(g,n.name,b),O=!0}function iT(e,t,r){for(var n=arguments.length>2,o=0;o0&&a[a.length-1])&&(g[0]===6||g[0]===2)){r=0;continue}if(g[0]===3&&(!a||g[1]>a[0]&&g[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hm(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function pT(){for(var e=[],t=0;t1||f(S,w)})},C&&(o[S]=C(o[S])))}function f(S,C){try{g(n[S](C))}catch(w){O(a[0][3],w)}}function g(S){S.value instanceof ol?Promise.resolve(S.value.v).then(b,_):O(a[0][2],S)}function b(S){f("next",S)}function _(S){f("throw",S)}function O(S,C){S(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function bT(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,a){t[o]=e[o]?function(i){return(r=!r)?{value:ol(e[o](i)),done:!1}:a?a(i):i}:a}}function vT(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof md=="function"?md(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(u,f){i=e[a](i),o(u,f,i.done,i.value)})}}function o(a,i,u,f){Promise.resolve(f).then(function(g){a({value:g,done:u})},i)}}function yT(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var z4=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},wh=function(e){return wh=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},wh(e)};function wT(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=wh(e),n=0;nr=>Math.max(Math.min(r,t),e),bs=e=>e%1?Number(e.toFixed(5)):e,Ws=/(-)?([\d]*\.?[\d])+/g,xh=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,$4=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function iu(e){return typeof e=="string"}const lu={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gm=Object.assign(Object.assign({},lu),{transform:jT(0,1)}),q4=Object.assign(Object.assign({},lu),{default:1}),su=e=>({test:t=>iu(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),G4=su("deg"),$i=su("%"),K4=su("px"),Y4=su("vh"),Q4=su("vw"),X4=Object.assign(Object.assign({},$i),{parse:e=>$i.parse(e)/100,transform:e=>$i.transform(e*100)}),mm=(e,t)=>r=>!!(iu(r)&&$4.test(r)&&r.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(r,t)),RT=(e,t,r)=>n=>{if(!iu(n))return n;const[o,a,i,u]=n.match(Ws);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},as={test:mm("hsl","hue"),parse:RT("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+$i.transform(bs(t))+", "+$i.transform(bs(r))+", "+bs(gm.transform(n))+")"},J4=jT(0,255),_c=Object.assign(Object.assign({},lu),{transform:e=>Math.round(J4(e))}),Li={test:mm("rgb","red"),parse:RT("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+_c.transform(e)+", "+_c.transform(t)+", "+_c.transform(r)+", "+bs(gm.transform(n))+")"};function Z4(e){let t="",r="",n="",o="";return e.length>5?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),o=e.substr(4,1),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}const _h={test:mm("#"),parse:Z4,transform:Li.transform},bm={test:e=>Li.test(e)||_h.test(e)||as.test(e),parse:e=>Li.test(e)?Li.parse(e):as.test(e)?as.parse(e):_h.parse(e),transform:e=>iu(e)?e:e.hasOwnProperty("red")?Li.transform(e):as.transform(e)},AT="${c}",MT="${n}";function eD(e){var t,r,n,o;return isNaN(e)&&iu(e)&&((r=(t=e.match(Ws))===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0)+((o=(n=e.match(xh))===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)>0}function IT(e){typeof e=="number"&&(e=`${e}`);const t=[];let r=0;const n=e.match(xh);n&&(r=n.length,e=e.replace(xh,AT),t.push(...n.map(bm.parse)));const o=e.match(Ws);return o&&(e=e.replace(Ws,MT),t.push(...o.map(lu.parse))),{values:t,numColors:r,tokenised:e}}function DT(e){return IT(e).values}function LT(e){const{values:t,numColors:r,tokenised:n}=IT(e),o=t.length;return a=>{let i=n;for(let u=0;utypeof e=="number"?0:e;function rD(e){const t=DT(e);return LT(e)(t.map(tD))}const FT={test:eD,parse:DT,createTransformer:LT,getAnimatableNone:rD},nD=new Set(["brightness","contrast","saturate","opacity"]);function oD(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(Ws)||[];if(!n)return e;const o=r.replace(n,"");let a=nD.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}const aD=/([a-z-]*)\(.*?\)/g,iD=Object.assign(Object.assign({},FT),{getAnimatableNone:e=>{const t=e.match(aD);return t?t.map(oD).join(" "):e}});sr.alpha=gm;sr.color=bm;sr.complex=FT;sr.degrees=G4;sr.filter=iD;sr.hex=_h;sr.hsla=as;sr.number=lu;sr.percent=$i;sr.progressPercentage=X4;sr.px=K4;sr.rgbUnit=_c;sr.rgba=Li;sr.scale=q4;sr.vh=Y4;sr.vw=Q4;var Ge={},ci={};Object.defineProperty(ci,"__esModule",{value:!0});const zT=1/60*1e3,lD=typeof performance<"u"?()=>performance.now():()=>Date.now(),BT=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(lD()),zT);function sD(e){let t=[],r=[],n=0,o=!1,a=!1;const i=new WeakSet,u={schedule:(f,g=!1,b=!1)=>{const _=b&&o,O=_?t:r;return g&&i.add(f),O.indexOf(f)===-1&&(O.push(f),_&&o&&(n=t.length)),f},cancel:f=>{const g=r.indexOf(f);g!==-1&&r.splice(g,1),i.delete(f)},process:f=>{if(o){a=!0;return}if(o=!0,[t,r]=[r,t],r.length=0,n=t.length,n)for(let g=0;g(e[t]=sD(()=>Hs=!0),e),{}),cD=uu.reduce((e,t)=>{const r=sf[t];return e[t]=(n,o=!1,a=!1)=>(Hs||hD(),r.schedule(n,o,a)),e},{}),dD=uu.reduce((e,t)=>(e[t]=sf[t].cancel,e),{}),fD=uu.reduce((e,t)=>(e[t]=()=>sf[t].process(qi),e),{}),pD=e=>sf[e].process(qi),VT=e=>{Hs=!1,qi.delta=Ch?zT:Math.max(Math.min(e-qi.timestamp,uD),1),qi.timestamp=e,Sh=!0,uu.forEach(pD),Sh=!1,Hs&&(Ch=!1,BT(VT))},hD=()=>{Hs=!0,Ch=!0,Sh||BT(VT)},gD=()=>qi;ci.cancelSync=dD;ci.default=cD;ci.flushSync=fD;ci.getFrameData=gD;Object.defineProperty(Ge,"__esModule",{value:!0});var UT=kT,al=NT,In=sr,uf=ci;function mD(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var bD=mD(uf);const $s=(e,t,r)=>Math.min(Math.max(r,e),t),Hp=.001,vD=.01,xw=10,yD=.05,wD=1;function xD({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let o,a;al.warning(e<=xw*1e3,"Spring duration must be 10 seconds or less");let i=1-t;i=$s(yD,wD,i),e=$s(vD,xw,e/1e3),i<1?(o=g=>{const b=g*i,_=b*e,O=b-r,S=Th(g,i),C=Math.exp(-_);return Hp-O/S*C},a=g=>{const _=g*i*e,O=_*r+r,S=Math.pow(i,2)*Math.pow(g,2)*e,C=Math.exp(-_),w=Th(Math.pow(g,2),i);return(-o(g)+Hp>0?-1:1)*((O-S)*C)/w}):(o=g=>{const b=Math.exp(-g*e),_=(g-r)*e+1;return-Hp+b*_},a=g=>{const b=Math.exp(-g*e),_=(r-g)*(e*e);return b*_});const u=5/e,f=CD(o,a,u);if(e=e*1e3,isNaN(f))return{stiffness:100,damping:10,duration:e};{const g=Math.pow(f,2)*n;return{stiffness:g,damping:i*2*Math.sqrt(n*g),duration:e}}}const _D=12;function CD(e,t,r){let n=r;for(let o=1;o<_D;o++)n=n-e(n)/t(n);return n}function Th(e,t){return e*Math.sqrt(1-t*t)}const SD=["duration","bounce"],TD=["stiffness","damping","mass"];function _w(e,t){return t.some(r=>e[r]!==void 0)}function OD(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!_w(e,TD)&&_w(e,SD)){const r=xD(e);t=Object.assign(Object.assign(Object.assign({},t),r),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function cf(e){var{from:t=0,to:r=1,restSpeed:n=2,restDelta:o}=e,a=UT.__rest(e,["from","to","restSpeed","restDelta"]);const i={done:!1,value:t};let{stiffness:u,damping:f,mass:g,velocity:b,duration:_,isResolvedFromDuration:O}=OD(a),S=Cw,C=Cw;function w(){const m=b?-(b/1e3):0,d=r-t,l=f/(2*Math.sqrt(u*g)),c=Math.sqrt(u/g)/1e3;if(o===void 0&&(o=Math.min(Math.abs(r-t)/100,.4)),l<1){const s=Th(c,l);S=h=>{const v=Math.exp(-l*c*h);return r-v*((m+l*c*d)/s*Math.sin(s*h)+d*Math.cos(s*h))},C=h=>{const v=Math.exp(-l*c*h);return l*c*v*(Math.sin(s*h)*(m+l*c*d)/s+d*Math.cos(s*h))-v*(Math.cos(s*h)*(m+l*c*d)-s*d*Math.sin(s*h))}}else if(l===1)S=s=>r-Math.exp(-c*s)*(d+(m+c*d)*s);else{const s=c*Math.sqrt(l*l-1);S=h=>{const v=Math.exp(-l*c*h),y=Math.min(s*h,300);return r-v*((m+l*c*d)*Math.sinh(y)+s*d*Math.cosh(y))/s}}}return w(),{next:m=>{const d=S(m);if(O)i.done=m>=_;else{const l=C(m)*1e3,c=Math.abs(l)<=n,s=Math.abs(r-d)<=o;i.done=c&&s}return i.value=i.done?r:d,i},flipTarget:()=>{b=-b,[t,r]=[r,t],w()}}}cf.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const Cw=e=>0,vm=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},df=(e,t,r)=>-r*e+r*t+e;function $p(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Sw({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let o=0,a=0,i=0;if(!t)o=a=i=r;else{const u=r<.5?r*(1+t):r+t-r*t,f=2*r-u;o=$p(f,u,e+1/3),a=$p(f,u,e),i=$p(f,u,e-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(i*255),alpha:n}}const PD=(e,t,r)=>{const n=e*e,o=t*t;return Math.sqrt(Math.max(0,r*(o-n)+n))},kD=[In.hex,In.rgba,In.hsla],Tw=e=>kD.find(t=>t.test(e)),Ow=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,ym=(e,t)=>{let r=Tw(e),n=Tw(t);al.invariant(!!r,Ow(e)),al.invariant(!!n,Ow(t));let o=r.parse(e),a=n.parse(t);r===In.hsla&&(o=Sw(o),r=In.rgba),n===In.hsla&&(a=Sw(a),n=In.rgba);const i=Object.assign({},o);return u=>{for(const f in i)f!=="alpha"&&(i[f]=PD(o[f],a[f],u));return i.alpha=df(o.alpha,a.alpha,u),r.transform(i)}},ED={x:0,y:0,z:0},Oh=e=>typeof e=="number",ND=(e,t)=>r=>t(e(r)),wm=(...e)=>e.reduce(ND);function WT(e,t){return Oh(e)?r=>df(e,t,r):In.color.test(e)?ym(e,t):xm(e,t)}const HT=(e,t)=>{const r=[...e],n=r.length,o=e.map((a,i)=>WT(a,t[i]));return a=>{for(let i=0;i{const r=Object.assign(Object.assign({},e),t),n={};for(const o in r)e[o]!==void 0&&t[o]!==void 0&&(n[o]=WT(e[o],t[o]));return o=>{for(const a in n)r[a]=n[a](o);return r}};function Pw(e){const t=In.complex.parse(e),r=t.length;let n=0,o=0,a=0;for(let i=0;i{const r=In.complex.createTransformer(t),n=Pw(e),o=Pw(t);return n.numHSL===o.numHSL&&n.numRGB===o.numRGB&&n.numNumbers>=o.numNumbers?wm(HT(n.parsed,o.parsed),r):(al.warning(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),i=>`${i>0?t:e}`)},RD=(e,t)=>r=>df(e,t,r);function AD(e){if(typeof e=="number")return RD;if(typeof e=="string")return In.color.test(e)?ym:xm;if(Array.isArray(e))return HT;if(typeof e=="object")return jD}function MD(e,t,r){const n=[],o=r||AD(e[0]),a=e.length-1;for(let i=0;ir(vm(e,t,n))}function DD(e,t){const r=e.length,n=r-1;return o=>{let a=0,i=!1;if(o<=e[0]?i=!0:o>=e[n]&&(a=n-1,i=!0),!i){let f=1;for(;fo||f===n);f++);a=f-1}const u=vm(e[a],e[a+1],o);return t[a](u)}}function _m(e,t,{clamp:r=!0,ease:n,mixer:o}={}){const a=e.length;al.invariant(a===t.length,"Both input and output ranges must be the same length"),al.invariant(!n||!Array.isArray(n)||n.length===a-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),e[0]>e[a-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const i=MD(t,n,o),u=a===2?ID(e,i):DD(e,i);return r?f=>u($s(e[0],e[a-1],f)):u}const cu=e=>t=>1-e(1-t),ff=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,$T=e=>t=>Math.pow(t,e),Cm=e=>t=>t*t*((e+1)*t-e),qT=e=>{const t=Cm(e);return r=>(r*=2)<1?.5*t(r):.5*(2-Math.pow(2,-10*(r-1)))},GT=1.525,LD=4/11,FD=8/11,zD=9/10,KT=e=>e,Sm=$T(2),BD=cu(Sm),YT=ff(Sm),QT=e=>1-Math.sin(Math.acos(e)),XT=cu(QT),VD=ff(XT),Tm=Cm(GT),UD=cu(Tm),WD=ff(Tm),HD=qT(GT),$D=4356/361,qD=35442/1805,GD=16061/1805,bd=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-bd(1-e*2)):.5*bd(e*2-1)+.5;function QD(e,t){return e.map(()=>t||YT).splice(0,e.length-1)}function XD(e){const t=e.length;return e.map((r,n)=>n!==0?n/(t-1):0)}function JD(e,t){return e.map(r=>r*t)}function vs({from:e=0,to:t=1,ease:r,offset:n,duration:o=300}){const a={done:!1,value:e},i=Array.isArray(t)?t:[e,t],u=JD(n&&n.length===i.length?n:XD(i),o);function f(){return _m(u,i,{ease:Array.isArray(r)?r:QD(i,r)})}let g=f();return{next:b=>(a.value=g(b),a.done=b>=o,a),flipTarget:()=>{i.reverse(),g=f()}}}function JT({velocity:e=0,from:t=0,power:r=.8,timeConstant:n=350,restDelta:o=.5,modifyTarget:a}){const i={done:!1,value:t};let u=r*e;const f=t+u,g=a===void 0?f:a(f);return g!==f&&(u=g-t),{next:b=>{const _=-u*Math.exp(-b/n);return i.done=!(_>o||_<-o),i.value=i.done?g:g+_,i},flipTarget:()=>{}}}const kw={keyframes:vs,spring:cf,decay:JT};function ZD(e){if(Array.isArray(e.to))return vs;if(kw[e.type])return kw[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?vs:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?cf:vs}function ZT(e,t,r=0){return e-t-r}function eL(e,t,r=0,n=!0){return n?ZT(t+-e,t,r):t-(e-t)+r}function tL(e,t,r,n){return n?e>=t+r:e<=-r}const rL=e=>{const t=({delta:r})=>e(r);return{start:()=>bD.default.update(t,!0),stop:()=>uf.cancelSync.update(t)}};function eO(e){var t,r,{from:n,autoplay:o=!0,driver:a=rL,elapsed:i=0,repeat:u=0,repeatType:f="loop",repeatDelay:g=0,onPlay:b,onStop:_,onComplete:O,onRepeat:S,onUpdate:C}=e,w=UT.__rest(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:m}=w,d,l=0,c=w.duration,s,h=!1,v=!0,y;const E=ZD(w);!((r=(t=E).needsInterpolation)===null||r===void 0)&&r.call(t,n,m)&&(y=_m([0,100],[n,m],{clamp:!1}),n=0,m=100);const P=E(Object.assign(Object.assign({},w),{from:n,to:m}));function N(){l++,f==="reverse"?(v=l%2===0,i=eL(i,c,g,v)):(i=ZT(i,c,g),f==="mirror"&&P.flipTarget()),h=!1,S&&S()}function R(){d.stop(),O&&O()}function M(L){if(v||(L=-L),i+=L,!h){const W=P.next(Math.max(0,i));s=W.value,y&&(s=y(s)),h=v?W.done:i<=0}C==null||C(s),h&&(l===0&&(c??(c=i)),l{_==null||_(),d.stop()}}}function tO(e,t){return t?e*(1e3/t):0}function nL({from:e=0,velocity:t=0,min:r,max:n,power:o=.8,timeConstant:a=750,bounceStiffness:i=500,bounceDamping:u=10,restDelta:f=1,modifyTarget:g,driver:b,onUpdate:_,onComplete:O,onStop:S}){let C;function w(c){return r!==void 0&&cn}function m(c){return r===void 0?n:n===void 0||Math.abs(r-c){var h;_==null||_(s),(h=c.onUpdate)===null||h===void 0||h.call(c,s)},onComplete:O,onStop:S}))}function l(c){d(Object.assign({type:"spring",stiffness:i,damping:u,restDelta:f},c))}if(w(e))l({from:e,velocity:t,to:m(e)});else{let c=o*t+e;typeof g<"u"&&(c=g(c));const s=m(c),h=s===r?-1:1;let v,y;const E=P=>{v=y,y=P,t=tO(P-v,uf.getFrameData().delta),(h===1&&P>s||h===-1&&PC==null?void 0:C.stop()}}const rO=e=>e*180/Math.PI,oL=(e,t=ED)=>rO(Math.atan2(t.y-e.y,t.x-e.x)),aL=(e,t)=>{let r=!0;return t===void 0&&(t=e,r=!1),n=>r?n-e+t:(e=n,r=!0,t)},iL=e=>e,Om=(e=iL)=>(t,r,n)=>{const o=r-n,a=-(0-t+1)*(0-e(Math.abs(o)));return o<=0?r+a:r-a},lL=Om(),sL=Om(Math.sqrt),nO=e=>e*Math.PI/180,vd=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),Ph=e=>vd(e)&&e.hasOwnProperty("z"),Yu=(e,t)=>Math.abs(e-t);function uL(e,t){if(Oh(e)&&Oh(t))return Yu(e,t);if(vd(e)&&vd(t)){const r=Yu(e.x,t.x),n=Yu(e.y,t.y),o=Ph(e)&&Ph(t)?Yu(e.z,t.z):0;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2)+Math.pow(o,2))}}const cL=(e,t,r)=>(t=nO(t),{x:r*Math.cos(t)+e.x,y:r*Math.sin(t)+e.y}),oO=(e,t=2)=>(t=Math.pow(10,t),Math.round(e*t)/t),aO=(e,t,r,n=0)=>oO(e+r*(t-e)/Math.max(n,r)),dL=(e=50)=>{let t=0,r=0;return n=>{const o=uf.getFrameData().timestamp,a=o!==r?o-r:0,i=a?aO(t,n,a,e):t;return r=o,t=i,i}},fL=e=>{if(typeof e=="number")return t=>Math.round(t/e)*e;{let t=0;const r=e.length;return n=>{let o=Math.abs(e[0]-n);for(t=1;to)return e[t-1];if(t===r-1)return a;o=i}}}};function pL(e,t){return e/(1e3/t)}const hL=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e},iO=(e,t)=>1-3*t+3*e,lO=(e,t)=>3*t-6*e,sO=e=>3*e,yd=(e,t,r)=>((iO(t,r)*e+lO(t,r))*e+sO(t))*e,uO=(e,t,r)=>3*iO(t,r)*e*e+2*lO(t,r)*e+sO(t),gL=1e-7,mL=10;function bL(e,t,r,n,o){let a,i,u=0;do i=t+(r-t)/2,a=yd(i,n,o)-e,a>0?r=i:t=i;while(Math.abs(a)>gL&&++u=yL?wL(i,_,e,r):O===0?_:bL(i,u,u+Qu,e,r)}return i=>i===0||i===1?i:yd(a(i),t,n)}const _L=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return $s(0,1,o/e)};Ge.angle=oL;Ge.animate=eO;Ge.anticipate=HD;Ge.applyOffset=aL;Ge.attract=lL;Ge.attractExpo=sL;Ge.backIn=Tm;Ge.backInOut=WD;Ge.backOut=UD;Ge.bounceIn=KD;Ge.bounceInOut=YD;Ge.bounceOut=bd;Ge.circIn=QT;Ge.circInOut=VD;Ge.circOut=XT;Ge.clamp=$s;Ge.createAnticipate=qT;Ge.createAttractor=Om;Ge.createBackIn=Cm;Ge.createExpoIn=$T;Ge.cubicBezier=xL;Ge.decay=JT;Ge.degreesToRadians=nO;Ge.distance=uL;Ge.easeIn=Sm;Ge.easeInOut=YT;Ge.easeOut=BD;Ge.inertia=nL;Ge.interpolate=_m;Ge.isPoint=vd;Ge.isPoint3D=Ph;Ge.keyframes=vs;Ge.linear=KT;Ge.mirrorEasing=ff;Ge.mix=df;Ge.mixColor=ym;Ge.mixComplex=xm;Ge.pipe=wm;Ge.pointFromVector=cL;Ge.progress=vm;Ge.radiansToDegrees=rO;Ge.reverseEasing=cu;Ge.smooth=dL;Ge.smoothFrame=aO;Ge.snap=fL;Ge.spring=cf;Ge.steps=_L;Ge.toDecimal=oO;Ge.velocityPerFrame=pL;Ge.velocityPerSecond=tO;Ge.wrap=hL;class CL{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const qp=new WeakMap;function Pm(e){return qp.has(e)||qp.set(e,{transforms:[],values:new Map}),qp.get(e)}function SL(e,t){return e.has(t)||e.set(t,new CL),e.get(t)}function cO(e,t){e.indexOf(t)===-1&&e.push(t)}function dO(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const fO=(e,t,r)=>Math.min(Math.max(r,e),t),Ur={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ro=e=>typeof e=="number",qs=e=>Array.isArray(e)&&!Ro(e[0]),TL=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function pO(e,t){return qs(e)?e[TL(0,e.length,t)]:e}const km=(e,t,r)=>-r*e+r*t+e,Em=()=>{},To=e=>e,pf=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function Nm(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=pf(0,t,n);e.push(km(r,1,o))}}function jm(e){const t=[0];return Nm(t,e-1),t}function hO(e,t=jm(e.length),r=To){const n=e.length,o=n-t.length;return o>0&&Nm(t,o),a=>{let i=0;for(;iArray.isArray(e)&&Ro(e[0]),wd=e=>typeof e=="object"&&!!e.createAnimation,OL=e=>typeof e=="function",Rm=e=>typeof e=="string",qa={ms:e=>e*1e3,s:e=>e/1e3};function mO(e,t){return t?e*(1e3/t):0}const PL=["","X","Y","Z"],kL=["translate","scale","rotate","skew"],il={x:"translateX",y:"translateY",z:"translateZ"},Ew={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},EL={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:Ew,scale:{syntax:"",initialValue:1,toDefaultUnit:To},skew:Ew},ll=new Map,hf=e=>`--motion-${e}`,xd=["x","y","z"];kL.forEach(e=>{PL.forEach(t=>{xd.push(e+t),ll.set(hf(e+t),EL[e])})});const NL=(e,t)=>xd.indexOf(e)-xd.indexOf(t),jL=new Set(xd),gf=e=>jL.has(e),RL=(e,t)=>{il[t]&&(t=il[t]);const{transforms:r}=Pm(e);cO(r,t),e.style.transform=bO(r)},bO=e=>e.sort(NL).reduce(AL,"").trim(),AL=(e,t)=>`${e} ${t}(var(${hf(t)}))`,kh=e=>e.startsWith("--"),Nw=new Set;function ML(e){if(!Nw.has(e)){Nw.add(e);try{const{syntax:t,initialValue:r}=ll.has(e)?ll.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const vO=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,IL=1e-7,DL=12;function LL(e,t,r,n,o){let a,i,u=0;do i=t+(r-t)/2,a=vO(i,n,o)-e,a>0?r=i:t=i;while(Math.abs(a)>IL&&++uLL(a,0,1,e,r);return a=>a===0||a===1?a:vO(o(a),t,n)}const FL=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return fO(0,1,o/e)},zL={ease:is(.25,.1,.25,1),"ease-in":is(.42,0,1,1),"ease-in-out":is(.42,0,.58,1),"ease-out":is(0,0,.58,1)},BL=/\((.*?)\)/;function Eh(e){if(OL(e))return e;if(gO(e))return is(...e);const t=zL[e];if(t)return t;if(e.startsWith("steps")){const r=BL.exec(e);if(r){const n=r[1].split(",");return FL(parseFloat(n[0]),n[1].trim())}}return To}class VL{constructor(t,r=[0,1],{easing:n,duration:o=Ur.duration,delay:a=Ur.delay,endDelay:i=Ur.endDelay,repeat:u=Ur.repeat,offset:f,direction:g="normal",autoplay:b=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=To,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((O,S)=>{this.resolve=O,this.reject=S}),n=n||Ur.easing,wd(n)){const O=n.createAnimation(r);n=O.easing,r=O.keyframes||r,o=O.duration||o}this.repeat=u,this.easing=qs(n)?To:Eh(n),this.updateDuration(o);const _=hO(r,f,qs(n)?n.map(Eh):To);this.tick=O=>{var S;a=a;let C=0;this.pauseTime!==void 0?C=this.pauseTime:C=(O-this.startTime)*this.rate,this.t=C,C/=1e3,C=Math.max(C-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(C=this.totalDuration);const w=C/this.duration;let m=Math.floor(w),d=w%1;!d&&w>=1&&(d=1),d===1&&m--;const l=m%2;(g==="reverse"||g==="alternate"&&l||g==="alternate-reverse"&&!l)&&(d=1-d);const c=C>=this.totalDuration?1:Math.min(d,1),s=_(this.easing(c));t(s),this.pauseTime===void 0&&(this.playState==="finished"||C>=this.totalDuration+i)?(this.playState="finished",(S=this.resolve)===null||S===void 0||S.call(this,s)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},b&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const jw=e=>gO(e)?UL(e):e,UL=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Rw=e=>document.createElement("div").animate(e,{duration:.001}),Aw={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Rw({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Rw({opacity:[0,1]}).finished},Gp={},Sc={};for(const e in Aw)Sc[e]=()=>(Gp[e]===void 0&&(Gp[e]=Aw[e]()),Gp[e]);function WL(e,t){for(let r=0;rArray.isArray(e)?e:[e];function _d(e){return il[e]&&(e=il[e]),gf(e)?hf(e):e}const Fi={get:(e,t)=>{t=_d(t);let r=kh(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=ll.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=_d(t),kh(t)?e.style.setProperty(t,r):e.style[t]=r}};function wO(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function HL(){return window.__MOTION_DEV_TOOLS_RECORD}function mf(e,t,r,n={}){const o=HL(),a=n.record!==!1&&o;let i,{duration:u=Ur.duration,delay:f=Ur.delay,endDelay:g=Ur.endDelay,repeat:b=Ur.repeat,easing:_=Ur.easing,direction:O,offset:S,allowWebkitAcceleration:C=!1}=n;const w=Pm(e);let m=Sc.waapi();const d=gf(t);d&&RL(e,t);const l=_d(t),c=SL(w.values,l),s=ll.get(l);return wO(c.animation,!(wd(_)&&c.generator)&&n.record!==!1),()=>{const h=()=>{var y,E;return(E=(y=Fi.get(e,l))!==null&&y!==void 0?y:s==null?void 0:s.initialValue)!==null&&E!==void 0?E:0};let v=WL(yO(r),h);if(wd(_)){const y=_.createAnimation(v,h,d,l,c);_=y.easing,y.keyframes!==void 0&&(v=y.keyframes),y.duration!==void 0&&(u=y.duration)}if(kh(l)&&(Sc.cssRegisterProperty()?ML(l):m=!1),m){s&&(v=v.map(P=>Ro(P)?s.toDefaultUnit(P):P)),v.length===1&&(!Sc.partialKeyframes()||a)&&v.unshift(h());const y={delay:qa.ms(f),duration:qa.ms(u),endDelay:qa.ms(g),easing:qs(_)?void 0:jw(_),direction:O,iterations:b+1,fill:"both"};i=e.animate({[l]:v,offset:S,easing:qs(_)?_.map(jw):void 0},y),i.finished||(i.finished=new Promise((P,N)=>{i.onfinish=P,i.oncancel=N}));const E=v[v.length-1];i.finished.then(()=>{Fi.set(e,l,E),i.cancel()}).catch(Em),C||(i.playbackRate=1.000001)}else if(d){v=v.map(E=>typeof E=="string"?parseFloat(E):E),v.length===1&&v.unshift(parseFloat(h()));const y=E=>{s&&(E=s.toDefaultUnit(E)),Fi.set(e,l,E)};i=new VL(y,v,Object.assign(Object.assign({},n),{duration:u,easing:_}))}else{const y=v[v.length-1];Fi.set(e,l,s&&Ro(y)?s.toDefaultUnit(y):y)}return a&&o(e,t,v,{duration:u,delay:f,easing:_,repeat:b,offset:S},"motion-one"),c.setAnimation(i),i}}const Am=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function bf(e,t){var r;return typeof e=="string"?t?((r=t[e])!==null&&r!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const $L=e=>e(),Mm=(e,t,r=Ur.duration)=>new Proxy({animations:e.map($L).filter(Boolean),duration:r,options:t},GL),qL=e=>e.animations[0],GL={get:(e,t)=>{const r=qL(e);switch(t){case"duration":return e.duration;case"currentTime":return qa.s((r==null?void 0:r[t])||0);case"playbackRate":case"playState":return r==null?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(KL)).catch(Em)),e.finished;case"stop":return()=>{e.animations.forEach(n=>wO(n))};case"forEachNative":return n=>{e.animations.forEach(o=>n(o,e))};default:return typeof(r==null?void 0:r[t])>"u"?void 0:()=>e.animations.forEach(n=>n[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=qa.ms(r);case"currentTime":case"playbackRate":for(let n=0;ne.finished;function YL(e=.1,{start:t=0,from:r=0,easing:n}={}){return(o,a)=>{const i=Ro(r)?r:QL(r,a),u=Math.abs(i-o);let f=e*u;if(n){const g=a*e;f=Eh(n)(f/g)*g}return t+f}}function QL(e,t){if(e==="first")return 0;{const r=t-1;return e==="last"?r:r/2}}function xO(e,t,r){return typeof e=="function"?e(t,r):e}function XL(e,t,r={}){e=bf(e);const n=e.length,o=[];for(let a=0;at&&o.atmf(...a)).filter(Boolean);return Mm(o,t,(r=n[0])===null||r===void 0?void 0:r[3].duration)}function r3(e,t={}){var{defaultOptions:r={}}=t,n=wl(t,["defaultOptions"]);const o=[],a=new Map,i={},u=new Map;let f=0,g=0,b=0;for(let _=0;_"0",Y);R=$.easing,$.keyframes!==void 0&&(E=$.keyframes),$.duration!==void 0&&(N=$.duration)}const M=xO(w.delay,c,l)||0,D=g+M,L=D+N;let{offset:W=jm(E.length)}=P;W.length===1&&W[0]===0&&(W[1]=1);const U=length-E.length;U>0&&Nm(W,U),E.length===1&&E.unshift(null),ZL(y,E,R,W,D,L),m=Math.max(M+N,m),b=Math.max(L,b)}}f=g,g+=m}return a.forEach((_,O)=>{for(const S in _){const C=_[S];C.sort(e3);const w=[],m=[],d=[];for(let l=0;lt/(2*Math.sqrt(e*r));function l3(e,t,r){return e=t||e>t&&r<=t}const _O=({stiffness:e=Gi.stiffness,damping:t=Gi.damping,mass:r=Gi.mass,from:n=0,to:o=1,velocity:a=0,restSpeed:i,restDistance:u}={})=>{a=a?qa.s(a):0;const f={done:!1,hasReachedTarget:!1,current:n,target:o},g=o-n,b=Math.sqrt(e/r)/1e3,_=i3(e,t,r),O=Math.abs(g)<5;i||(i=O?.01:2),u||(u=O?.005:.5);let S;if(_<1){const C=b*Math.sqrt(1-_*_);S=w=>o-Math.exp(-_*b*w)*((-a+_*b*g)/C*Math.sin(C*w)+g*Math.cos(C*w))}else S=C=>o-Math.exp(-b*C)*(g+(-a+b*g)*C);return C=>{f.current=S(C);const w=C===0?a:Im(S,C,f.current),m=Math.abs(w)<=i,d=Math.abs(o-f.current)<=u;return f.done=m&&d,f.hasReachedTarget=l3(n,o,f.current),f}},s3=({from:e=0,velocity:t=0,power:r=.8,decay:n=.325,bounceDamping:o,bounceStiffness:a,changeTarget:i,min:u,max:f,restDistance:g=.5,restSpeed:b})=>{n=qa.ms(n);const _={hasReachedTarget:!1,done:!1,current:e,target:e},O=y=>u!==void 0&&yf,S=y=>u===void 0?f:f===void 0||Math.abs(u-y)-C*Math.exp(-y/n),l=y=>m+d(y),c=y=>{const E=d(y),P=l(y);_.done=Math.abs(E)<=g,_.current=_.done?m:P};let s,h;const v=y=>{O(_.current)&&(s=y,h=_O({from:_.current,to:S(_.current),velocity:Im(l,y,_.current),damping:o,stiffness:a,restDistance:g,restSpeed:b}))};return v(0),y=>{let E=!1;return!h&&s===void 0&&(E=!0,c(y),v(y)),s!==void 0&&y>s?(_.hasReachedTarget=!0,h(y-s)):(_.hasReachedTarget=!1,!E&&c(y),_)}},Kp=10,u3=1e4;function c3(e,t=To){let r,n=Kp,o=e(0);const a=[t(o.current)];for(;!o.done&&n{const n=new Map,o=(i=0,u=100,f=0,g=!1)=>{const b=`${i}-${u}-${f}-${g}`;return n.has(b)||n.set(b,e(Object.assign({from:i,to:u,velocity:f,restSpeed:g?.05:2,restDistance:g?.01:.5},r))),n.get(b)},a=i=>(t.has(i)||t.set(i,c3(i)),t.get(i));return{createAnimation:(i,u,f,g,b)=>{var _,O;let S;const C=i.length;if(f&&C<=2&&i.every(d3)){const m=i[C-1],d=C===1?null:i[0];let l=0,c=0;const s=b==null?void 0:b.generator;if(s){const{animation:y,generatorStartTime:E}=b,P=(y==null?void 0:y.startTime)||E||0,N=(y==null?void 0:y.currentTime)||performance.now()-P,R=s(N).current;c=(_=d)!==null&&_!==void 0?_:R,(C===1||C===2&&i[0]===null)&&(l=Im(M=>s(M).current,N,R))}else c=(O=d)!==null&&O!==void 0?O:parseFloat(u());const h=o(c,m,l,g==null?void 0:g.includes("scale")),v=a(h);S=Object.assign(Object.assign({},v),{easing:"linear"}),b&&(b.generator=h,b.generatorStartTime=performance.now())}else S={easing:"ease",duration:a(o(0,100)).overshootDuration};return S}}}}const d3=e=>typeof e!="string",f3=CO(_O),p3=CO(s3),h3={any:0,all:1};function SO(e,t,{root:r,margin:n,amount:o="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=bf(e),i=new WeakMap,u=g=>{g.forEach(b=>{const _=i.get(b.target);if(b.isIntersecting!==!!_)if(b.isIntersecting){const O=t(b);typeof O=="function"?i.set(b.target,O):f.unobserve(b.target)}else _&&(_(b),i.delete(b.target))})},f=new IntersectionObserver(u,{root:r,rootMargin:n,threshold:typeof o=="number"?o:h3[o]});return a.forEach(g=>f.observe(g)),()=>f.disconnect()}const Tc=new WeakMap;let Yo;function g3(e,t){if(t){const{inlineSize:r,blockSize:n}=t[0];return{width:r,height:n}}else return e instanceof SVGElement&&"getBBox"in e?e.getBBox():{width:e.offsetWidth,height:e.offsetHeight}}function m3({target:e,contentRect:t,borderBoxSize:r}){var n;(n=Tc.get(e))===null||n===void 0||n.forEach(o=>{o({target:e,contentSize:t,get size(){return g3(e,r)}})})}function b3(e){e.forEach(m3)}function v3(){typeof ResizeObserver>"u"||(Yo=new ResizeObserver(b3))}function y3(e,t){Yo||v3();const r=bf(e);return r.forEach(n=>{let o=Tc.get(n);o||(o=new Set,Tc.set(n,o)),o.add(t),Yo==null||Yo.observe(n)}),()=>{r.forEach(n=>{const o=Tc.get(n);o==null||o.delete(t),o!=null&&o.size||Yo==null||Yo.unobserve(n)})}}const Oc=new Set;let ys;function w3(){ys=()=>{const e={width:window.innerWidth,height:window.innerHeight},t={target:window,size:e,contentSize:e};Oc.forEach(r=>r(t))},window.addEventListener("resize",ys)}function x3(e){return Oc.add(e),ys||w3(),()=>{Oc.delete(e),!Oc.size&&ys&&(ys=void 0)}}function TO(e,t){return typeof e=="function"?x3(e):y3(e,t)}const _3=50,Iw=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),C3=()=>({time:0,x:Iw(),y:Iw()}),S3={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Dw(e,t,r,n){const o=r[t],{length:a,position:i}=S3[t],u=o.current,f=r.time;o.current=e["scroll"+i],o.scrollLength=e["scroll"+a]-e["client"+a],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=pf(0,o.scrollLength,o.current);const g=n-f;o.velocity=g>_3?0:mO(o.current-u,g)}function T3(e,t,r){Dw(e,"x",t,r),Dw(e,"y",t,r),t.time=r}function O3(e,t){let r={x:0,y:0},n=e;for(;n&&n!==t;)if(n instanceof HTMLElement)r.x+=n.offsetLeft,r.y+=n.offsetTop,n=n.offsetParent;else if(n instanceof SVGGraphicsElement&&"getBBox"in n){const{top:o,left:a}=n.getBBox();for(r.x+=a,r.y+=o;n&&n.tagName!=="svg";)n=n.parentNode}return r}const OO={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Nh={start:0,center:.5,end:1};function Lw(e,t,r=0){let n=0;if(Nh[e]!==void 0&&(e=Nh[e]),Rm(e)){const o=parseFloat(e);e.endsWith("px")?n=o:e.endsWith("%")?e=o/100:e.endsWith("vw")?n=o/100*document.documentElement.clientWidth:e.endsWith("vh")?n=o/100*document.documentElement.clientHeight:e=o}return Ro(e)&&(n=t*e),r+n}const P3=[0,0];function k3(e,t,r,n){let o=Array.isArray(e)?e:P3,a=0,i=0;return Ro(e)?o=[e,e]:Rm(e)&&(e=e.trim(),e.includes(" ")?o=e.split(" "):o=[e,Nh[e]?e:"0"]),a=Lw(o[0],r,n),i=Lw(o[1],t),a-i}const E3={x:0,y:0};function N3(e,t,r){let{offset:n=OO.All}=r;const{target:o=e,axis:a="y"}=r,i=a==="y"?"height":"width",u=o!==e?O3(o,e):E3,f=o===e?{width:e.scrollWidth,height:e.scrollHeight}:{width:o.clientWidth,height:o.clientHeight},g={width:e.clientWidth,height:e.clientHeight};t[a].offset.length=0;let b=!t[a].interpolate;const _=n.length;for(let O=0;O<_;O++){const S=k3(n[O],g[i],f[i],u[a]);!b&&S!==t[a].interpolatorOffsets[O]&&(b=!0),t[a].offset[O]=S}b&&(t[a].interpolate=hO(jm(_),t[a].offset),t[a].interpolatorOffsets=[...t[a].offset]),t[a].progress=t[a].interpolate(t[a].current)}function j3(e,t=e,r){if(r.x.targetOffset=0,r.y.targetOffset=0,t!==e){let n=t;for(;n&&n!=e;)r.x.targetOffset+=n.offsetLeft,r.y.targetOffset+=n.offsetTop,n=n.offsetParent}r.x.targetLength=t===e?t.scrollWidth:t.clientWidth,r.y.targetLength=t===e?t.scrollHeight:t.clientHeight,r.x.containerLength=e.clientWidth,r.y.containerLength=e.clientHeight}function R3(e,t,r,n={}){const o=n.axis||"y";return{measure:()=>j3(e,n.target,r),update:a=>{T3(e,r,a),(n.offset||n.target)&&N3(e,r,n)},notify:typeof t=="function"?()=>t(r):A3(t,r[o])}}function A3(e,t){return e.pause(),e.forEachNative((r,{easing:n})=>{var o,a;if(r.updateDuration)n||(r.easing=To),r.updateDuration(1);else{const i={duration:1e3};n||(i.easing="linear"),(a=(o=r.effect)===null||o===void 0?void 0:o.updateTiming)===null||a===void 0||a.call(o,i)}}),()=>{e.currentTime=t.progress}}const Xl=new WeakMap,Fw=new WeakMap,Yp=new WeakMap,zw=e=>e===document.documentElement?window:e;function M3(e,t={}){var{container:r=document.documentElement}=t,n=wl(t,["container"]);let o=Yp.get(r);o||(o=new Set,Yp.set(r,o));const a=C3(),i=R3(r,e,a,n);if(o.add(i),!Xl.has(r)){const g=()=>{const _=performance.now();for(const O of o)O.measure();for(const O of o)O.update(_);for(const O of o)O.notify()};Xl.set(r,g);const b=zw(r);window.addEventListener("resize",g,{passive:!0}),r!==document.documentElement&&Fw.set(r,TO(r,g)),b.addEventListener("scroll",g,{passive:!0})}const u=Xl.get(r),f=requestAnimationFrame(u);return()=>{var g;typeof e!="function"&&e.stop(),cancelAnimationFrame(f);const b=Yp.get(r);if(!b||(b.delete(i),b.size))return;const _=Xl.get(r);Xl.delete(r),_&&(zw(r).removeEventListener("scroll",_),(g=Fw.get(r))===null||g===void 0||g(),window.removeEventListener("resize",_))}}function I3(e,t){return typeof e!=typeof t?!0:Array.isArray(e)&&Array.isArray(t)?!D3(e,t):e!==t}function D3(e,t){const r=t.length;if(r!==e.length)return!1;for(let n=0;ne.getDepth()-t.getDepth(),V3=e=>e.animateUpdates(),Vw=e=>e.next(),Uw=(e,t)=>new CustomEvent(e,{detail:{target:t}});function jh(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:r}}))}function Ww(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:{originalEntry:r}}))}const U3={isActive:e=>!!e.inView,subscribe:(e,{enable:t,disable:r},{inViewOptions:n={}})=>{const{once:o}=n,a=wl(n,["once"]);return SO(e,i=>{if(t(),Ww(e,"viewenter",i),!o)return u=>{r(),Ww(e,"viewleave",u)}},a)}},Hw=(e,t,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),jh(e,t,n))},W3={isActive:e=>!!e.hover,subscribe:(e,{enable:t,disable:r})=>{const n=Hw(e,"hoverstart",t),o=Hw(e,"hoverend",r);return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",o),()=>{e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",o)}}},H3={isActive:e=>!!e.press,subscribe:(e,{enable:t,disable:r})=>{const n=a=>{r(),jh(e,"pressend",a),window.removeEventListener("pointerup",n)},o=a=>{t(),jh(e,"pressstart",a),window.addEventListener("pointerup",n)};return e.addEventListener("pointerdown",o),()=>{e.removeEventListener("pointerdown",o),window.removeEventListener("pointerup",n)}}},Pc={inView:U3,hover:W3,press:H3},$w=["initial","animate",...Object.keys(Pc),"exit"],Rh=new WeakMap;function $3(e={},t){let r,n=t?t.getDepth()+1:0;const o={initial:!0,animate:!0},a={},i={};for(const w of $w)i[w]=typeof e[w]=="string"?e[w]:t==null?void 0:t.getContext()[w];const u=e.initial===!1?"animate":"initial";let f=Bw(e[u]||i[u],e.variants)||{},g=wl(f,["transition"]);const b=Object.assign({},g);function*_(){var w,m;const d=g;g={};const l={};for(const y of $w){if(!o[y])continue;const E=Bw(e[y]);if(E)for(const P in E)P!=="transition"&&(g[P]=E[P],l[P]=Am((m=(w=E.transition)!==null&&w!==void 0?w:e.transition)!==null&&m!==void 0?m:{},P))}const c=new Set([...Object.keys(g),...Object.keys(d)]),s=[];c.forEach(y=>{var E;g[y]===void 0&&(g[y]=b[y]),I3(d[y],g[y])&&((E=b[y])!==null&&E!==void 0||(b[y]=Fi.get(r,y)),s.push(mf(r,y,g[y],l[y])))}),yield;const h=s.map(y=>y()).filter(Boolean);if(!h.length)return;const v=g;r.dispatchEvent(Uw("motionstart",v)),Promise.all(h.map(y=>y.finished)).then(()=>{r.dispatchEvent(Uw("motioncomplete",v))}).catch(Em)}const O=(w,m)=>()=>{o[w]=m,Qp(C)},S=()=>{for(const w in Pc){const m=Pc[w].isActive(e),d=a[w];m&&!d?a[w]=Pc[w].subscribe(r,{enable:O(w,!0),disable:O(w,!1)},e):!m&&d&&(d(),delete a[w])}},C={update:w=>{r&&(e=w,S(),Qp(C))},setActive:(w,m)=>{r&&(o[w]=m,Qp(C))},animateUpdates:_,getDepth:()=>n,getTarget:()=>g,getOptions:()=>e,getContext:()=>i,mount:w=>(r=w,Rh.set(r,C),S(),()=>{Rh.delete(r),z3(C);for(const m in a)a[m]()}),isMounted:()=>!!r};return C}function PO(e){const t={},r=[];for(let n in e){const o=e[n];gf(n)&&(il[n]&&(n=il[n]),r.push(n),n=hf(n));let a=Array.isArray(o)?o[0]:o;const i=ll.get(n);i&&(a=Ro(o)?i.toDefaultUnit(o):o),t[n]=a}return r.length&&(t.transform=bO(r)),t}const q3=e=>`-${e.toLowerCase()}`,G3=e=>e.replace(/[A-Z]/g,q3);function K3(e={}){const t=PO(e);let r="";for(const n in t)r+=n.startsWith("--")?n:G3(n),r+=`: ${t[n]}; `;return r}const Y3=Object.freeze(Object.defineProperty({__proto__:null,ScrollOffset:OO,animate:XL,animateStyle:mf,createMotionState:$3,createStyleString:K3,createStyles:PO,getAnimationData:Pm,getStyleName:_d,glide:p3,inView:SO,mountedStates:Rh,resize:TO,scroll:M3,spring:f3,stagger:YL,style:Fi,timeline:t3,withControls:Mm},Symbol.toStringTag,{value:"Module"})),Q3=Qs(Y3);function X3(e){var t={};return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var J3=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Z3=X3(function(e){return J3.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});const eF=Object.freeze(Object.defineProperty({__proto__:null,default:Z3},Symbol.toStringTag,{value:"Module"})),tF=Qs(eF);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=kT,r=j,n=NT,o=sr,a=Ge,i=ci,u=Q3;function f(p){return p&&typeof p=="object"&&"default"in p?p:{default:p}}function g(p){if(p&&p.__esModule)return p;var x=Object.create(null);return p&&Object.keys(p).forEach(function(k){if(k!=="default"){var A=Object.getOwnPropertyDescriptor(p,k);Object.defineProperty(x,k,A.get?A:{enumerable:!0,get:function(){return p[k]}})}}),x.default=p,Object.freeze(x)}var b=g(r),_=f(r),O=f(i),S="production",C=typeof process>"u"||process.env===void 0?S:"production",w=function(p){return{isEnabled:function(x){return p.some(function(k){return!!x[k]})}}},m={measureLayout:w(["layout","layoutId","drag"]),animation:w(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:w(["exit"]),drag:w(["drag","dragControls"]),focus:w(["whileFocus"]),hover:w(["whileHover","onHoverStart","onHoverEnd"]),tap:w(["whileTap","onTap","onTapStart","onTapCancel"]),pan:w(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:w(["whileInView","onViewportEnter","onViewportLeave"])};function d(p){for(var x in p)p[x]!==null&&(x==="projectionNodeConstructor"?m.projectionNodeConstructor=p[x]:m[x].Component=p[x])}var l=r.createContext({strict:!1}),c=Object.keys(m),s=c.length;function h(p,x,k){var A=[],I=r.useContext(l);if(!x)return null;C!=="production"&&k&&I.strict&&n.invariant(!1,"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.");for(var B=0;B"u")return x;var k=new Map;return new Proxy(x,{get:function(A,I){return k.has(I)||k.set(I,x(I)),k.get(I)}})}var Je=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function Ve(p){return typeof p!="string"||p.includes("-")?!1:!!(Je.indexOf(p)>-1||/[A-Z]/.test(p))}var me={};function te(p){Object.assign(me,p)}var ge=["","X","Y","Z"],_e=["translate","scale","rotate","skew"],Pe=["transformPerspective","x","y","z"];_e.forEach(function(p){return ge.forEach(function(x){return Pe.push(p+x)})});function Ce(p,x){return Pe.indexOf(p)-Pe.indexOf(x)}var we=new Set(Pe);function Ie(p){return we.has(p)}var Ue=new Set(["originX","originY","originZ"]);function Ze(p){return Ue.has(p)}function Bt(p,x){var k=x.layout,A=x.layoutId;return Ie(p)||Ze(p)||(k||A!==void 0)&&(!!me[p]||p==="opacity")}var et=function(p){return!!(p!==null&&typeof p=="object"&&p.getVelocity)},Xt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function qt(p,x,k,A){var I=p.transform,B=p.transformKeys,V=x.enableHardwareAcceleration,F=V===void 0?!0:V,q=x.allowTransformNone,K=q===void 0?!0:q,J="";B.sort(Ce);for(var re=!1,ne=B.length,le=0;le"u"?Kk:Gk;K(q,F.current,x,V)}var qk={some:0,all:1};function Gk(p,x,k,A){var I=A.root,B=A.margin,V=A.amount,F=V===void 0?"some":V,q=A.once;r.useEffect(function(){if(p){var K={root:I==null?void 0:I.current,rootMargin:B,threshold:typeof F=="number"?F:qk[F]},J=function(re){var ne,le=re.isIntersecting;if(x.isInView!==le&&(x.isInView=le,!(q&&!le&&x.hasEnteredView))){le&&(x.hasEnteredView=!0),(ne=k.animationState)===null||ne===void 0||ne.setActive(e.AnimationType.InView,le);var ce=k.getProps(),ve=le?ce.onViewportEnter:ce.onViewportLeave;ve==null||ve(re)}};return Hk(k.getInstance(),K,J)}},[p,I,B,F])}function Kk(p,x,k,A){var I=A.fallback,B=I===void 0?!0:I;r.useEffect(function(){!p||!B||(C!=="production"&&Al(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(function(){var V;x.hasEnteredView=!0;var F=k.getProps().onViewportEnter;F==null||F(null),(V=k.animationState)===null||V===void 0||V.setActive(e.AnimationType.InView,!0)}))},[p])}var Fo=function(p){return function(x){return p(x),null}},lb={inView:Fo($k),tap:Fo(_r),focus:Fo(Kt),hover:Fo(Tt)},Yk=0,Qk=function(){return Yk++},sb=function(){return de(Qk)};function Lf(){var p=r.useContext(P);if(p===null)return[!0,null];var x=p.isPresent,k=p.onExitComplete,A=p.register,I=sb();r.useEffect(function(){return A(I)},[]);var B=function(){return k==null?void 0:k(I)};return!x&&k?[!1,B]:[!0]}function Xk(){return Jk(r.useContext(P))}function Jk(p){return p===null?!0:p.isPresent}function ub(p,x){if(!Array.isArray(x))return!1;var k=x.length;if(k!==p.length)return!1;for(var A=0;A-1&&p.splice(k,1)}function dE(p,x,k){var A=t.__read(p),I=A.slice(0),B=x<0?I.length+x:x;if(B>=0&&BWe&&pn,Ho=Array.isArray(Lt)?Lt:[Lt],hn=Ho.reduce(B,{});Rr===!1&&(hn={});var Bl=gt.prevResolvedValues,wi=Bl===void 0?{}:Bl,Nu=t.__assign(t.__assign({},wi),hn),xi=function(Qe){Wo=!0,Ee.delete(Qe),gt.needsAnimating[Qe]=!0};for(var zr in Nu){var yt=hn[zr],Fe=wi[zr];De.hasOwnProperty(zr)||(yt!==Fe?Xr(yt)&&Xr(Fe)?!ub(yt,Fe)||Uo?xi(zr):gt.protectedKeys[zr]=!0:yt!==void 0?xi(zr):Ee.add(zr):yt!==void 0&&Ee.has(zr)?xi(zr):gt.protectedKeys[zr]=!0)}gt.prevProp=Lt,gt.prevResolvedValues=hn,gt.isActive&&(De=t.__assign(t.__assign({},De),hn)),I&&p.blockInitialAnimation&&(Wo=!1),Wo&&!Jr&&ve.push.apply(ve,t.__spreadArray([],t.__read(Ho.map(function(Qe){return{animation:Qe,options:t.__assign({type:ct},J)}})),!1))},ot=0;ot=3;if(!(!le&&!ce)){var ve=ne.point,Ee=i.getFrameData().timestamp;I.history.push(t.__assign(t.__assign({},ve),{timestamp:Ee}));var De=I.handlers,We=De.onStart,tt=De.onMove;le||(We&&We(I.lastMoveEvent,ne),I.startEvent=I.lastMoveEvent),tt&&tt(I.lastMoveEvent,ne)}}},this.handlePointerMove=function(ne,le){if(I.lastMoveEvent=ne,I.lastMoveEventInfo=Jf(le,I.transformPagePoint),Rt(ne)&&ne.buttons===0){I.handlePointerUp(ne,le);return}O.default.update(I.updatePoint,!0)},this.handlePointerUp=function(ne,le){I.end();var ce=I.handlers,ve=ce.onEnd,Ee=ce.onSessionEnd,De=Zf(Jf(le,I.transformPagePoint),I.history);I.startEvent&&ve&&ve(ne,De),Ee&&Ee(ne,De)},!(cn(x)&&x.touches.length>1)){this.handlers=k,this.transformPagePoint=V;var F=mi(x),q=Jf(F,this.transformPagePoint),K=q.point,J=i.getFrameData().timestamp;this.history=[t.__assign(t.__assign({},K),{timestamp:J})];var re=k.onSessionStart;re&&re(x,Zf(q,this.history)),this.removeListeners=a.pipe(Xn(window,"pointermove",this.handlePointerMove),Xn(window,"pointerup",this.handlePointerUp),Xn(window,"pointercancel",this.handlePointerUp))}}return p.prototype.updateHandlers=function(x){this.handlers=x},p.prototype.end=function(){this.removeListeners&&this.removeListeners(),i.cancelSync.update(this.updatePoint)},p}();function Jf(p,x){return x?{point:x(p.point)}:p}function Cb(p,x){return{x:p.x-x.x,y:p.y-x.y}}function Zf(p,x){var k=p.point;return{point:k,delta:Cb(k,Sb(x)),offset:Cb(k,EE(x)),velocity:NE(x,.1)}}function EE(p){return p[0]}function Sb(p){return p[p.length-1]}function NE(p,x){if(p.length<2)return{x:0,y:0};for(var k=p.length-1,A=null,I=Sb(p);k>=0&&(A=p[k],!(I.timestamp-A.timestamp>wu(x)));)k--;if(!A)return{x:0,y:0};var B=(I.timestamp-A.timestamp)/1e3;if(B===0)return{x:0,y:0};var V={x:(I.x-A.x)/B,y:(I.y-A.y)/B};return V.x===1/0&&(V.x=0),V.y===1/0&&(V.y=0),V}function Jn(p){return p.max-p.min}function Tb(p,x,k){return x===void 0&&(x=0),k===void 0&&(k=.01),a.distance(p,x)I&&(p=k?a.mix(I,p,k.max):Math.min(p,I)),p}function Eb(p,x,k){return{min:x!==void 0?p.min+x:void 0,max:k!==void 0?p.max+k-(p.max-p.min):void 0}}function AE(p,x){var k=x.top,A=x.left,I=x.bottom,B=x.right;return{x:Eb(p.x,A,B),y:Eb(p.y,k,I)}}function Nb(p,x){var k,A=x.min-p.min,I=x.max-p.max;return x.max-x.minA?k=a.progress(x.min,x.max-A,p.min):A>I&&(k=a.progress(p.min,p.max-I,x.min)),a.clamp(0,1,k)}function DE(p,x){var k={};return x.min!==void 0&&(k.min=x.min-p.min),x.max!==void 0&&(k.max=x.max-p.min),k}var ep=.35;function LE(p){return p===void 0&&(p=ep),p===!1?p=0:p===!0&&(p=ep),{x:jb(p,"left","right"),y:jb(p,"top","bottom")}}function jb(p,x,k){return{min:Rb(p,x),max:Rb(p,k)}}function Rb(p,x){var k;return typeof p=="number"?p:(k=p[x])!==null&&k!==void 0?k:0}var Ab=function(){return{translate:0,scale:1,origin:0,originPoint:0}},Fl=function(){return{x:Ab(),y:Ab()}},Mb=function(){return{min:0,max:0}},dr=function(){return{x:Mb(),y:Mb()}};function Zn(p){return[p("x"),p("y")]}function Ib(p){var x=p.top,k=p.left,A=p.right,I=p.bottom;return{x:{min:k,max:A},y:{min:x,max:I}}}function FE(p){var x=p.x,k=p.y;return{top:k.min,right:x.max,bottom:k.max,left:x.min}}function zE(p,x){if(!x)return p;var k=x({x:p.left,y:p.top}),A=x({x:p.right,y:p.bottom});return{top:k.y,left:k.x,bottom:A.y,right:A.x}}function tp(p){return p===void 0||p===1}function Db(p){var x=p.scale,k=p.scaleX,A=p.scaleY;return!tp(x)||!tp(k)||!tp(A)}function zo(p){return Db(p)||Lb(p.x)||Lb(p.y)||p.z||p.rotate||p.rotateX||p.rotateY}function Lb(p){return p&&p!=="0%"}function Cu(p,x,k){var A=p-k,I=x*A;return k+I}function Fb(p,x,k,A,I){return I!==void 0&&(p=Cu(p,I,A)),Cu(p,k,A)+x}function rp(p,x,k,A,I){x===void 0&&(x=0),k===void 0&&(k=1),p.min=Fb(p.min,x,k,A,I),p.max=Fb(p.max,x,k,A,I)}function zb(p,x){var k=x.x,A=x.y;rp(p.x,k.translate,k.scale,k.originPoint),rp(p.y,A.translate,A.scale,A.originPoint)}function BE(p,x,k,A){var I,B;A===void 0&&(A=!1);var V=k.length;if(V){x.x=x.y=1;for(var F,q,K=0;Kx?k="y":Math.abs(p.x)>x&&(k="x"),k}function GE(p){var x=p.dragControls,k=p.visualElement,A=de(function(){return new $E(k)});r.useEffect(function(){return x&&x.subscribe(A)},[A,x]),r.useEffect(function(){return A.addListeners()},[A])}function KE(p){var x=p.onPan,k=p.onPanStart,A=p.onPanEnd,I=p.onPanSessionStart,B=p.visualElement,V=x||k||A||I,F=r.useRef(null),q=r.useContext(v).transformPagePoint,K={onSessionStart:I,onStart:k,onMove:x,onEnd:function(re,ne){F.current=null,A&&A(re,ne)}};r.useEffect(function(){F.current!==null&&F.current.updateHandlers(K)});function J(re){F.current=new _b(re,K,{transformPagePoint:q})}Ea(B,"pointerdown",V&&J),Yt(function(){return F.current&&F.current.end()})}var Ub={pan:Fo(KE),drag:Fo(GE)},Tu=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function YE(){var p=Tu.map(function(){return new Ml}),x={},k={clearAllListeners:function(){return p.forEach(function(A){return A.clear()})},updatePropListeners:function(A){Tu.forEach(function(I){var B,V="on"+I,F=A[V];(B=x[I])===null||B===void 0||B.call(x),F&&(x[I]=k[V](F))})}};return p.forEach(function(A,I){k["on"+Tu[I]]=function(B){return A.add(B)},k["notify"+Tu[I]]=function(){for(var B=[],V=0;V=0?window.pageYOffset:null,K=iN(x,p,F);return B.length&&B.forEach(function(J){var re=t.__read(J,2),ne=re[0],le=re[1];p.getValue(ne).set(le)}),p.syncRender(),q!==null&&window.scrollTo({top:q}),{target:K,transitionEnd:A}}else return{target:x,transitionEnd:A}};function sN(p,x,k,A){return rN(x)?lN(p,x,k,A):{target:x,transitionEnd:A}}var uN=function(p,x,k,A){var I=eN(p,x,A);return x=I.target,A=I.transitionEnd,sN(p,x,k,A)};function cN(p){return window.getComputedStyle(p)}var Xb={treeType:"dom",readValueFromInstance:function(p,x){if(Ie(x)){var k=zf(x);return k&&k.default||0}else{var A=cN(p);return(tr(x)?A.getPropertyValue(x):A[x])||0}},sortNodePosition:function(p,x){return p.compareDocumentPosition(x)&2?1:-1},getBaseTarget:function(p,x){var k;return(k=p.style)===null||k===void 0?void 0:k[x]},measureViewportBox:function(p,x){var k=x.transformPagePoint;return Vb(p,k)},resetTransform:function(p,x,k){var A=k.transformTemplate;x.style.transform=A?A({},""):"none",p.scheduleRender()},restoreTransform:function(p,x){p.style.transform=x.style.transform},removeValueFromRenderState:function(p,x){var k=x.vars,A=x.style;delete k[p],delete A[p]},makeTargetAnimatable:function(p,x,k,A){var I=k.transformValues;A===void 0&&(A=!0);var B=x.transition,V=x.transitionEnd,F=t.__rest(x,["transition","transitionEnd"]),q=wb(F,B||{},p);if(I&&(V&&(V=I(V)),F&&(F=I(F)),q&&(q=I(q))),A){Kf(p,F,q);var K=uN(p,F,q,V);V=K.transitionEnd,F=K.target}return t.__assign({transition:B,transitionEnd:V},F)},scrapeMotionValuesFromProps:Sa,build:function(p,x,k,A,I){p.isVisible!==void 0&&(x.style.visibility=p.isVisible?"visible":"hidden"),bt(x,k,A,I.transformTemplate)},render:Fr},dN=Ou(Xb),fN=Ou(t.__assign(t.__assign({},Xb),{getBaseTarget:function(p,x){return p[x]},readValueFromInstance:function(p,x){var k;return Ie(x)?((k=zf(x))===null||k===void 0?void 0:k.default)||0:(x=Pn.has(x)?x:ar(x),p.getAttribute(x))},scrapeMotionValuesFromProps:Ta,build:function(p,x,k,A,I){vt(x,k,A,I.transformTemplate)},render:Qr})),ap=function(p,x){return Ve(p)?fN(x,{enableHardwareAcceleration:!1}):dN(x,{enableHardwareAcceleration:!0})};function Jb(p,x){return x.max===x.min?0:p/(x.max-x.min)*100}var zl={correct:function(p,x){if(!x.target)return p;if(typeof p=="string")if(o.px.test(p))p=parseFloat(p);else return p;var k=Jb(p,x.target.x),A=Jb(p,x.target.y);return"".concat(k,"% ").concat(A,"%")}},Zb="_$css",pN={correct:function(p,x){var k=x.treeScale,A=x.projectionDelta,I=p,B=p.includes("var("),V=[];B&&(p=p.replace(Hb,function(ve){return V.push(ve),Zb}));var F=o.complex.parse(p);if(F.length>5)return I;var q=o.complex.createTransformer(p),K=typeof F[0]!="number"?1:0,J=A.x.scale*k.x,re=A.y.scale*k.y;F[0+K]/=J,F[1+K]/=re;var ne=a.mix(J,re,.5);typeof F[2+K]=="number"&&(F[2+K]/=ne),typeof F[3+K]=="number"&&(F[3+K]/=ne);var le=q(F);if(B){var ce=0;le=le.replace(Zb,function(){var ve=V[ce];return ce++,ve})}return le}},hN=function(p){t.__extends(x,p);function x(){return p!==null&&p.apply(this,arguments)||this}return x.prototype.componentDidMount=function(){var k=this,A=this.props,I=A.visualElement,B=A.layoutGroup,V=A.switchLayoutGroup,F=A.layoutId,q=I.projection;te(mN),q&&(B!=null&&B.group&&B.group.add(q),V!=null&&V.register&&F&&V.register(q),q.root.didUpdate(),q.addEventListener("animationComplete",function(){k.safeToRemove()}),q.setOptions(t.__assign(t.__assign({},q.options),{onExitComplete:function(){return k.safeToRemove()}}))),Te.hasEverUpdated=!0},x.prototype.getSnapshotBeforeUpdate=function(k){var A=this,I=this.props,B=I.layoutDependency,V=I.visualElement,F=I.drag,q=I.isPresent,K=V.projection;return K&&(K.isPresent=q,F||k.layoutDependency!==B||B===void 0?K.willUpdate():this.safeToRemove(),k.isPresent!==q&&(q?K.promote():K.relegate()||O.default.postRender(function(){var J;!((J=K.getStack())===null||J===void 0)&&J.members.length||A.safeToRemove()}))),null},x.prototype.componentDidUpdate=function(){var k=this.props.visualElement.projection;k&&(k.root.didUpdate(),!k.currentAnimation&&k.isLead()&&this.safeToRemove())},x.prototype.componentWillUnmount=function(){var k=this.props,A=k.visualElement,I=k.layoutGroup,B=k.switchLayoutGroup,V=A.projection;V&&(V.scheduleCheckAfterUnmount(),I!=null&&I.group&&I.group.remove(V),B!=null&&B.deregister&&B.deregister(V))},x.prototype.safeToRemove=function(){var k=this.props.safeToRemove;k==null||k()},x.prototype.render=function(){return null},x}(_.default.Component);function gN(p){var x=t.__read(Lf(),2),k=x[0],A=x[1],I=r.useContext(Se);return _.default.createElement(hN,t.__assign({},p,{layoutGroup:I,switchLayoutGroup:r.useContext(je),isPresent:k,safeToRemove:A}))}var mN={borderRadius:t.__assign(t.__assign({},zl),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:zl,borderTopRightRadius:zl,borderBottomLeftRadius:zl,borderBottomRightRadius:zl,boxShadow:pN},ev={measureLayout:gN};function tv(p,x,k){k===void 0&&(k={});var A=et(p)?p:fn(p);return Wf("",A,x,k),{stop:function(){return A.stop()},isAnimating:function(){return A.isAnimating()}}}var rv=["TopLeft","TopRight","BottomLeft","BottomRight"],bN=rv.length,nv=function(p){return typeof p=="string"?parseFloat(p):p},ov=function(p){return typeof p=="number"||o.px.test(p)};function vN(p,x,k,A,I,B){var V,F,q,K;I?(p.opacity=a.mix(0,(V=k.opacity)!==null&&V!==void 0?V:1,yN(A)),p.opacityExit=a.mix((F=x.opacity)!==null&&F!==void 0?F:1,0,wN(A))):B&&(p.opacity=a.mix((q=x.opacity)!==null&&q!==void 0?q:1,(K=k.opacity)!==null&&K!==void 0?K:1,A));for(var J=0;Jx?1:k(a.progress(p,x,A))}}function lv(p,x){p.min=x.min,p.max=x.max}function kn(p,x){lv(p.x,x.x),lv(p.y,x.y)}function sv(p,x,k,A,I){return p-=x,p=Cu(p,1/k,A),I!==void 0&&(p=Cu(p,1/I,A)),p}function xN(p,x,k,A,I,B,V){if(x===void 0&&(x=0),k===void 0&&(k=1),A===void 0&&(A=.5),B===void 0&&(B=p),V===void 0&&(V=p),o.percent.test(x)){x=parseFloat(x);var F=a.mix(V.min,V.max,x/100);x=F-V.min}if(typeof x=="number"){var q=a.mix(B.min,B.max,A);p===B&&(q-=x),p.min=sv(p.min,x,k,q,I),p.max=sv(p.max,x,k,q,I)}}function uv(p,x,k,A,I){var B=t.__read(k,3),V=B[0],F=B[1],q=B[2];xN(p,x[V],x[F],x[q],x.scale,A,I)}var _N=["x","scaleX","originX"],CN=["y","scaleY","originY"];function cv(p,x,k,A){uv(p.x,x,_N,k==null?void 0:k.x,A==null?void 0:A.x),uv(p.y,x,CN,k==null?void 0:k.y,A==null?void 0:A.y)}function dv(p){return p.translate===0&&p.scale===1}function fv(p){return dv(p.x)&&dv(p.y)}function pv(p,x){return p.x.min===x.x.min&&p.x.max===x.x.max&&p.y.min===x.y.min&&p.y.max===x.y.max}var SN=function(){function p(){this.members=[]}return p.prototype.add=function(x){Hf(this.members,x),x.scheduleRender()},p.prototype.remove=function(x){if($f(this.members,x),x===this.prevLead&&(this.prevLead=void 0),x===this.lead){var k=this.members[this.members.length-1];k&&this.promote(k)}},p.prototype.relegate=function(x){var k=this.members.findIndex(function(V){return x===V});if(k===0)return!1;for(var A,I=k;I>=0;I--){var B=this.members[I];if(B.isPresent!==!1){A=B;break}}return A?(this.promote(A),!0):!1},p.prototype.promote=function(x,k){var A,I=this.lead;if(x!==I&&(this.prevLead=I,this.lead=x,x.show(),I)){I.instance&&I.scheduleRender(),x.scheduleRender(),x.resumeFrom=I,k&&(x.resumeFrom.preserveOpacity=!0),I.snapshot&&(x.snapshot=I.snapshot,x.snapshot.latestValues=I.animationValues||I.latestValues,x.snapshot.isShared=!0),!((A=x.root)===null||A===void 0)&&A.isUpdating&&(x.isLayoutDirty=!0);var B=x.options.crossfade;B===!1&&I.hide()}},p.prototype.exitAnimationComplete=function(){this.members.forEach(function(x){var k,A,I,B,V;(A=(k=x.options).onExitComplete)===null||A===void 0||A.call(k),(V=(I=x.resumingFrom)===null||I===void 0?void 0:(B=I.options).onExitComplete)===null||V===void 0||V.call(B)})},p.prototype.scheduleRender=function(){this.members.forEach(function(x){x.instance&&x.scheduleRender(!1)})},p.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},p}(),TN="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function hv(p,x,k){var A=p.x.translate/x.x,I=p.y.translate/x.y,B="translate3d(".concat(A,"px, ").concat(I,"px, 0) ");if(B+="scale(".concat(1/x.x,", ").concat(1/x.y,") "),k){var V=k.rotate,F=k.rotateX,q=k.rotateY;V&&(B+="rotate(".concat(V,"deg) ")),F&&(B+="rotateX(".concat(F,"deg) ")),q&&(B+="rotateY(".concat(q,"deg) "))}var K=p.x.scale*x.x,J=p.y.scale*x.y;return B+="scale(".concat(K,", ").concat(J,")"),B===TN?"none":B}var ON=function(p,x){return p.depth-x.depth},gv=function(){function p(){this.children=[],this.isDirty=!1}return p.prototype.add=function(x){Hf(this.children,x),this.isDirty=!0},p.prototype.remove=function(x){$f(this.children,x),this.isDirty=!0},p.prototype.forEach=function(x){this.isDirty&&this.children.sort(ON),this.isDirty=!1,this.children.forEach(x)},p}(),mv=1e3;function bv(p){var x=p.attachResizeListener,k=p.defaultParent,A=p.measureScroll,I=p.checkIsScrollRoot,B=p.resetTransform;return function(){function V(F,q,K){var J=this;q===void 0&&(q={}),K===void 0&&(K=k==null?void 0:k()),this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){J.isUpdating&&(J.isUpdating=!1,J.clearAllSnapshots())},this.updateProjection=function(){J.nodes.forEach(RN),J.nodes.forEach(AN)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=F,this.latestValues=q,this.root=K?K.root||K:this,this.path=K?t.__spreadArray(t.__spreadArray([],t.__read(K.path),!1),[K],!1):[],this.parent=K,this.depth=K?K.depth+1:0,F&&this.root.registerPotentialNode(F,this);for(var re=0;re=0;A--)if(p.path[A].instance){k=p.path[A];break}var I=k&&k!==p.root?k.instance:document,B=I.querySelector('[data-projection-id="'.concat(x,'"]'));B&&p.mount(B,!0)}function xv(p){p.min=Math.round(p.min),p.max=Math.round(p.max)}function _v(p){xv(p.x),xv(p.y)}var BN=bv({attachResizeListener:function(p,x){return go(p,"resize",x)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),Aa={current:void 0},ip=bv({measureScroll:function(p){return{x:p.scrollLeft,y:p.scrollTop}},defaultParent:function(){if(!Aa.current){var p=new BN(0,{});p.mount(window),p.setOptions({layoutScroll:!0}),Aa.current=p}return Aa.current},resetTransform:function(p,x){p.style.transform=x??"none"},checkIsScrollRoot:function(p){return window.getComputedStyle(p).position==="fixed"}}),Cv=t.__assign(t.__assign(t.__assign(t.__assign({},Xf),lb),Ub),ev),lp=rt(function(p,x){return Pa(p,x,Cv,ap,ip)});function VN(p){return ut(Pa(p,{forwardMotionProps:!1},Cv,ap,ip))}var UN=rt(Pa);function Sv(){var p=r.useRef(!1);return R(function(){return p.current=!0,function(){p.current=!1}},[]),p}function ku(){var p=Sv(),x=t.__read(r.useState(0),2),k=x[0],A=x[1],I=r.useCallback(function(){p.current&&A(k+1)},[k]),B=r.useCallback(function(){return O.default.postRender(I)},[I]);return[B,k]}var sp=function(p){var x=p.children,k=p.initial,A=p.isPresent,I=p.onExitComplete,B=p.custom,V=p.presenceAffectsLayout,F=de(WN),q=sb(),K=r.useMemo(function(){return{id:q,initial:k,isPresent:A,custom:B,onExitComplete:function(J){var re,ne;F.set(J,!0);try{for(var le=t.__values(F.values()),ce=le.next();!ce.done;ce=le.next()){var ve=ce.value;if(!ve)return}}catch(Ee){re={error:Ee}}finally{try{ce&&!ce.done&&(ne=le.return)&&ne.call(le)}finally{if(re)throw re.error}}I==null||I()},register:function(J){return F.set(J,!1),function(){return F.delete(J)}}}},V?void 0:[A]);return r.useMemo(function(){F.forEach(function(J,re){return F.set(re,!1)})},[A]),b.useEffect(function(){!A&&!F.size&&(I==null||I())},[A]),b.createElement(P.Provider,{value:K},x)};function WN(){return new Map}var yi=function(p){return p.key||""};function HN(p,x){p.forEach(function(k){var A=yi(k);x.set(A,k)})}function $N(p){var x=[];return r.Children.forEach(p,function(k){r.isValidElement(k)&&x.push(k)}),x}var qN=function(p){var x=p.children,k=p.custom,A=p.initial,I=A===void 0?!0:A,B=p.onExitComplete,V=p.exitBeforeEnter,F=p.presenceAffectsLayout,q=F===void 0?!0:F,K=t.__read(ku(),1),J=K[0],re=r.useContext(Se).forceRender;re&&(J=re);var ne=Sv(),le=$N(x),ce=le,ve=new Set,Ee=r.useRef(ce),De=r.useRef(new Map).current,We=r.useRef(!0);if(R(function(){We.current=!1,HN(le,De),Ee.current=ce}),Yt(function(){We.current=!0,De.clear(),ve.clear()}),We.current)return b.createElement(b.Fragment,null,ce.map(function(ct){return b.createElement(sp,{key:yi(ct),isPresent:!0,initial:I?void 0:!1,presenceAffectsLayout:q},ct)}));ce=t.__spreadArray([],t.__read(ce),!1);for(var tt=Ee.current.map(yi),ot=le.map(yi),st=tt.length,St=0;St1&&console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."),b.createElement(b.Fragment,null,ve.size?ce:ce.map(function(ct){return r.cloneElement(ct)}))},Tv=r.createContext(null),GN=function(p){return!p.isLayoutDirty&&p.willUpdate(!1)};function Ov(){var p=new Set,x=new WeakMap,k=function(){return p.forEach(GN)};return{add:function(A){p.add(A),x.set(A,A.addEventListener("willUpdate",k))},remove:function(A){var I;p.delete(A),(I=x.get(A))===null||I===void 0||I(),x.delete(A),k()},dirty:k}}var Pv=function(p){return p===!0},KN=function(p){return Pv(p===!0)||p==="id"},kv=function(p){var x,k,A=p.children,I=p.id,B=p.inheritId,V=p.inherit,F=V===void 0?!0:V;B!==void 0&&(F=B);var q=r.useContext(Se),K=r.useContext(Tv),J=t.__read(ku(),2),re=J[0],ne=J[1],le=r.useRef(null),ce=(x=q.id)!==null&&x!==void 0?x:K;le.current===null&&(KN(F)&&ce&&(I=I?ce+"-"+I:ce),le.current={id:I,group:Pv(F)&&(k=q==null?void 0:q.group)!==null&&k!==void 0?k:Ov()});var ve=r.useMemo(function(){return t.__assign(t.__assign({},le.current),{forceRender:re})},[ne]);return b.createElement(Se.Provider,{value:ve},A)},YN=0,QN=function(p){var x=p.children;return b.useEffect(function(){n.warning(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),b.createElement(kv,{id:de(function(){return"asl-".concat(YN++)})},x)};function XN(p){var x=p.children,k=p.isValidProp,A=t.__rest(p,["children","isValidProp"]);k&&pt(k),A=t.__assign(t.__assign({},r.useContext(v)),A),A.isStatic=de(function(){return A.isStatic});var I=r.useMemo(function(){return A},[JSON.stringify(A.transition),A.transformPagePoint,A.reducedMotion]);return b.createElement(v.Provider,{value:I},x)}function JN(p){var x=p.children,k=p.features,A=p.strict,I=A===void 0?!1:A,B=t.__read(r.useState(!up(k)),2),V=B[1],F=r.useRef(void 0);if(!up(k)){var q=k.renderer,K=t.__rest(k,["renderer"]);F.current=q,d(K)}return r.useEffect(function(){up(k)&&k().then(function(J){var re=J.renderer,ne=t.__rest(J,["renderer"]);d(ne),F.current=re,V(!0)})},[]),b.createElement(l.Provider,{value:{renderer:F.current,strict:I}},x)}function up(p){return typeof p=="function"}var Ev=r.createContext(null);function ZN(p,x,k,A){if(!A)return p;var I=p.findIndex(function(J){return J.value===x});if(I===-1)return p;var B=A>0?1:-1,V=p[I+B];if(!V)return p;var F=p[I],q=V.layout,K=a.mix(q.min,q.max,.5);return B===1&&F.layout.max+k>K||B===-1&&F.layout.min+k.001?1/p:jj},Vv=!1;function Rj(p){var x=Vo(1),k=Vo(1),A=E();n.invariant(!!(p||A),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),n.warning(Vv,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),Vv=!0,p?(x=p.scaleX||x,k=p.scaleY||k):A&&(x=A.getValue("scaleX",1),k=A.getValue("scaleY",1));var I=Eu(x,Bv),B=Eu(k,Bv);return{scaleX:I,scaleY:B}}e.AnimatePresence=qN,e.AnimateSharedLayout=QN,e.DeprecatedLayoutGroupContext=Tv,e.DragControls=Fv,e.FlatTree=gv,e.LayoutGroup=kv,e.LayoutGroupContext=Se,e.LazyMotion=JN,e.MotionConfig=XN,e.MotionConfigContext=v,e.MotionContext=y,e.MotionValue=bb,e.PresenceContext=P,e.Reorder=cj,e.SwitchLayoutGroupContext=je,e.addPointerEvent=Xn,e.addScaleCorrector=te,e.animate=tv,e.animateVisualElement=_u,e.animationControls=Dv,e.animations=Xf,e.calcLength=Jn,e.checkTargetForNewValues=Kf,e.createBox=dr,e.createDomMotionComponent=VN,e.createMotionComponent=ut,e.domAnimation=Mv,e.domMax=dj,e.filterProps=po,e.isBrowser=N,e.isDragActive=Me,e.isMotionValue=et,e.isValidMotionProp=wr,e.m=UN,e.makeUseVisualState=Lo,e.motion=lp,e.motionValue=fn,e.resolveMotionValue=ho,e.transform=Nv,e.useAnimation=wj,e.useAnimationControls=Lv,e.useAnimationFrame=Iv,e.useCycle=xj,e.useDeprecatedAnimatedState=Nj,e.useDeprecatedInvertedScale=Rj,e.useDomEvent=Pt,e.useDragControls=Sj,e.useElementScroll=mj,e.useForceUpdate=ku,e.useInView=_j,e.useInstantLayoutTransition=zv,e.useInstantTransition=Oj,e.useIsPresent=Xk,e.useIsomorphicLayoutEffect=R,e.useMotionTemplate=fj,e.useMotionValue=Vo,e.usePresence=Lf,e.useReducedMotion=W,e.useReducedMotionConfig=U,e.useResetProjection=Pj,e.useScroll=cp,e.useSpring=pj,e.useTime=yj,e.useTransform=Eu,e.useUnmountEffect=Yt,e.useVelocity=hj,e.useViewportScroll=bj,e.useVisualElementContext=E,e.visualElement=Ou,e.wrapHandler=bi})(gr);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{AccordionBody:function(){return w},default:function(){return m}});var r=O(j),n=gr,o=O(Xe),a=O(yr),i=O(Be),u=He,f=af,g=ze,b=au;function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.className,s=d.children,h=S(d,["className","children"]),v=(0,f.useAccordion)(),y=v.open,E=v.animate,P=(0,g.useTheme)().accordion,N=P.styles.base;c=c??"";var R=(0,u.twMerge)((0,o.default)((0,i.default)(N.body)),c),M={unmount:{height:"0px",transition:{duration:.2,times:[.4,0,.2,1]}},mount:{height:"auto",transition:{duration:.2,times:[.4,0,.2,1]}}},D={unmount:{transition:{duration:.3,ease:"linear"}},mount:{transition:{duration:.3,ease:"linear"}}},L=(0,a.default)(D,E);return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(n.m.div,{className:"overflow-hidden",initial:"unmount",exit:"unmount",animate:y?"mount":"unmount",variants:M},r.default.createElement(n.m.div,_({},h,{ref:l,className:R,initial:"unmount",exit:"unmount",animate:y?"mount":"unmount",variants:L}),s)))});w.propTypes={className:b.propTypesClassName,children:b.propTypesChildren},w.displayName="MaterialTailwind.AccordionBody";var m=w})(tT);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Accordion:function(){return m},AccordionHeader:function(){return g.AccordionHeader},AccordionBody:function(){return b.AccordionBody},useAccordion:function(){return u.useAccordion},default:function(){return d}});var r=S(j),n=S(Xe),o=He,a=S(Be),i=ze,u=af,f=au,g=eT,b=tT;function _(l,c,s){return c in l?Object.defineProperty(l,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[c]=s,l}function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.open,h=l.icon,v=l.animate,y=l.className,E=l.disabled,P=l.children,N=C(l,["open","icon","animate","className","disabled","children"]),R=(0,i.useTheme)().accordion,M=R.defaultProps,D=R.styles.base;h=h??M.icon,v=v??M.animate,y=y??M.className,E=E??M.disabled;var L=(0,o.twMerge)((0,n.default)((0,a.default)(D.container),_({},(0,a.default)(D.disabled),E)),y),W=r.default.useMemo(function(){return{open:s,icon:h,animate:v,disabled:E}},[s,h,v,E]);return r.default.createElement(u.AccordionContextProvider,{value:W},r.default.createElement("div",O({},N,{ref:c,className:L}),P))});m.propTypes={open:f.propTypesOpen,icon:f.propTypesIcon,animate:f.propTypesAnimate,disabled:f.propTypesDisabled,className:f.propTypesClassName,children:f.propTypesChildren},m.displayName="MaterialTailwind.Accordion";var d=Object.assign(m,{Header:g.AccordionHeader,Body:b.AccordionBody})})(E5);var kO={},zt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});function t(n,o,a){var i=n.findIndex(function(u){return u===o});return i>=0?o:a}var r=t})(zt);var vf={},xl=class{constructor(){this.x=0,this.y=0,this.z=0}findFurthestPoint(t,r,n,o,a,i){return this.x=t-n>r/2?0:r,this.y=o-i>a/2?0:a,this.z=Math.hypot(this.x-(t-n),this.y-(o-i)),this.z}appyStyles(t,r,n,o,a){t.classList.add("ripple"),t.style.backgroundColor=r==="dark"?"rgba(0,0,0, 0.2)":"rgba(255,255,255, 0.3)",t.style.borderRadius="50%",t.style.pointerEvents="none",t.style.position="absolute",t.style.left=a.clientX-n.left-o+"px",t.style.top=a.clientY-n.top-o+"px",t.style.width=t.style.height=o*2+"px"}applyAnimation(t){t.animate([{transform:"scale(0)",opacity:1},{transform:"scale(1.5)",opacity:0}],{duration:500,easing:"linear"})}create(t,r){const n=t.currentTarget;n.style.position="relative",n.style.overflow="hidden";const o=n.getBoundingClientRect(),a=this.findFurthestPoint(t.clientX,n.offsetWidth,o.left,t.clientY,n.offsetHeight,o.top),i=document.createElement("span");this.appyStyles(i,r,o,a,t),this.applyAnimation(i),n.appendChild(i),setTimeout(()=>i.remove(),500)}};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{IconButton:function(){return w},default:function(){return m}});var r=O(j),n=O($e),o=O(xl),a=O(Xe),i=He,u=O(zt),f=O(Be),g=ze,b=li;function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.variant,s=d.size,h=d.color,v=d.ripple,y=d.className,E=d.children;d.fullWidth;var P=S(d,["variant","size","color","ripple","className","children","fullWidth"]),N=(0,g.useTheme)().iconButton,R=N.valid,M=N.defaultProps,D=N.styles,L=D.base,W=D.variants,U=D.sizes;c=c??M.variant,s=s??M.size,h=h??M.color,v=v??M.ripple,y=y??M.className;var Y=v!==void 0&&new o.default,$=(0,f.default)(L),z=(0,f.default)(W[(0,u.default)(R.variants,c,"filled")][(0,u.default)(R.colors,h,"gray")]),H=(0,f.default)(U[(0,u.default)(R.sizes,s,"md")]),G=(0,i.twMerge)((0,a.default)($,H,z),y);return r.default.createElement("button",_({},P,{ref:l,className:G,type:P.type||"button",onMouseDown:function(X){var ie=P==null?void 0:P.onMouseDown;return v&&Y.create(X,(c==="filled"||c==="gradient")&&h!=="white"?"light":"dark"),typeof ie=="function"&&ie(X)}}),r.default.createElement("span",{className:"absolute top-1/2 left-1/2 transform -translate-y-1/2 -translate-x-1/2"},E))});w.propTypes={variant:n.default.oneOf(b.propTypesVariant),size:n.default.oneOf(b.propTypesSize),color:n.default.oneOf(b.propTypesColor),ripple:b.propTypesRipple,className:b.propTypesClassName,children:b.propTypesChildren},w.displayName="MaterialTailwind.IconButton";var m=w})(vf);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,s){for(var h in s)Object.defineProperty(c,h,{enumerable:!0,get:s[h]})}t(e,{Alert:function(){return d},default:function(){return l}});var r=C(j),n=C($e),o=gr,a=C(Xe),i=C(yr),u=He,f=C(zt),g=C(Be),b=ze,_=Zg,O=C(vf);function S(){return S=Object.assign||function(c){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(c,v)&&(h[v]=c[v])}return h}function m(c,s){if(c==null)return{};var h={},v=Object.keys(c),y,E;for(E=0;E=0)&&(h[y]=c[y]);return h}var d=r.default.forwardRef(function(c,s){var h=c.variant,v=c.color,y=c.icon,E=c.open,P=c.action,N=c.onClose,R=c.animate,M=c.className,D=c.children,L=w(c,["variant","color","icon","open","action","onClose","animate","className","children"]),W=(0,b.useTheme)().alert,U=W.defaultProps,Y=W.valid,$=W.styles,z=$.base,H=$.variants;h=h??U.variant,v=v??U.color,M=M??U.className,R=R??U.animate,E=E??U.open,P=P??U.action,N=N??U.onClose;var G=(0,g.default)(z.alert),X=(0,g.default)(z.action),ie=(0,g.default)(H[(0,f.default)(Y.variants,h,"filled")][(0,f.default)(Y.colors,v,"gray")]),fe=(0,u.twMerge)((0,a.default)(G,ie),M),pe=(0,a.default)(X),oe={unmount:{opacity:0},mount:{opacity:1}},se=(0,i.default)(oe,R),ee=r.default.createElement("div",{className:"shrink-0"},y),ae=o.AnimatePresence;return r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(ae,null,E&&r.default.createElement(o.m.div,S({},L,{ref:s,role:"alert",className:"".concat(fe," flex"),initial:"unmount",exit:"unmount",animate:E?"mount":"unmount",variants:se}),y&&ee,r.default.createElement("div",{className:"".concat(y?"ml-3":""," mr-12")},D),N&&!P&&r.default.createElement(O.default,{onClick:N,size:"sm",variant:"text",color:h==="outlined"||h==="ghost"?v:"white",className:pe},r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"h-6 w-6",strokeWidth:2},r.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))),P||null)))});d.propTypes={variant:n.default.oneOf(_.propTypesVariant),color:n.default.oneOf(_.propTypesColor),icon:_.propTypesIcon,open:_.propTypesOpen,action:_.propTypesAction,onClose:_.propTypesOnClose,animate:_.propTypesAnimate,className:_.propTypesClassName,children:_.propTypesChildren},d.displayName="MaterialTailwind.Alert";var l=d})(kO);var EO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{Avatar:function(){return w},default:function(){return m}});var r=O(j),n=O($e),o=O(Xe),a=He,i=O(zt),u=O(Be),f=ze,g=em;function b(d,l,c){return l in d?Object.defineProperty(d,l,{value:c,enumerable:!0,configurable:!0,writable:!0}):d[l]=c,d}function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.variant,s=d.size,h=d.className,v=d.color,y=d.withBorder,E=S(d,["variant","size","className","color","withBorder"]),P=(0,f.useTheme)().avatar,N=P.valid,R=P.defaultProps,M=P.styles,D=M.base,L=M.variants,W=M.sizes,U=M.borderColor;c=c??R.variant,s=s??R.size,h=h??R.className,y=y??R.withBorder,v=v??R.color;var Y=(0,u.default)(L[(0,i.default)(N.variants,c,"rounded")]),$=(0,u.default)(W[(0,i.default)(N.sizes,s,"md")]),z=(0,u.default)(U[(0,i.default)(N.colors,v,"gray")]),H,G=(0,a.twMerge)((0,o.default)((0,u.default)(D.initial),Y,$,(H={},b(H,(0,u.default)(D.withBorder),y),b(H,z,y),H)),h);return r.default.createElement("img",_({},E,{ref:l,className:G}))});w.propTypes={variant:n.default.oneOf(g.propTypesVariant),size:n.default.oneOf(g.propTypesSize),className:g.propTypesClassName,withBorder:g.propTypesWithBorder,color:n.default.oneOf(g.propTypesColor)},w.displayName="MaterialTailwind.Avatar";var m=w})(EO);var NO={},jO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(f,g){for(var b in g)Object.defineProperty(f,b,{enumerable:!0,get:g[b]})}t(e,{propTypesSeparator:function(){return o},propTypesFullWidth:function(){return a},propTypesClassName:function(){return i},propTypesChildren:function(){return u}});var r=n($e);function n(f){return f&&f.__esModule?f:{default:f}}var o=r.default.node,a=r.default.bool,i=r.default.string,u=r.default.node.isRequired})(jO);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{Breadcrumbs:function(){return w},default:function(){return m}});var r=O(j),n=b(Xe),o=He,a=b(Be),i=ze,u=jO;function f(d,l,c){return l in d?Object.defineProperty(d,l,{value:c,enumerable:!0,configurable:!0,writable:!0}):d[l]=c,d}function g(){return g=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=(0,r.forwardRef)(function(d,l){var c=d.separator,s=d.fullWidth,h=d.className,v=d.children,y=S(d,["separator","fullWidth","className","children"]),E=(0,i.useTheme)().breadcrumbs,P=E.defaultProps,N=E.styles.base;c=c??P.separator,s=s??P.fullWidth,h=h??P.className;var R=(0,n.default)((0,a.default)(N.root.initial),f({},(0,a.default)(N.root.fullWidth),s)),M=(0,o.twMerge)((0,n.default)((0,a.default)(N.list)),h),D=(0,n.default)((0,a.default)(N.item.initial)),L=(0,n.default)((0,a.default)(N.separator));return r.default.createElement("nav",{"aria-label":"breadcrumb",className:R},r.default.createElement("ol",g({},y,{ref:l,className:M}),r.Children.map(v,function(W,U){if((0,r.isValidElement)(W)){var Y;return r.default.createElement("li",{className:(0,n.default)(D,f({},(0,a.default)(N.item.disabled),W==null||(Y=W.props)===null||Y===void 0?void 0:Y.disabled))},W,U!==r.Children.count(v)-1&&r.default.createElement("span",{className:L},c))}return null})))});w.propTypes={separator:u.propTypesSeparator,fullWidth:u.propTypesFullWidth,className:u.propTypesClassName,children:u.propTypesChildren},w.displayName="MaterialTailwind.Breadcrumbs";var m=w})(NO);var RO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Button:function(){return m},default:function(){return d}});var r=S(j),n=S($e),o=S(xl),a=S(Xe),i=He,u=S(zt),f=S(Be),g=ze,b=li;function _(l,c,s){return c in l?Object.defineProperty(l,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[c]=s,l}function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.variant,h=l.size,v=l.color,y=l.fullWidth,E=l.ripple,P=l.className,N=l.children,R=C(l,["variant","size","color","fullWidth","ripple","className","children"]),M=(0,g.useTheme)().button,D=M.valid,L=M.defaultProps,W=M.styles,U=W.base,Y=W.variants,$=W.sizes;s=s??L.variant,h=h??L.size,v=v??L.color,y=y??L.fullWidth,E=E??L.ripple,P=P??L.className;var z=E!==void 0&&new o.default,H=(0,f.default)(U.initial),G=(0,f.default)(Y[(0,u.default)(D.variants,s,"filled")][(0,u.default)(D.colors,v,"gray")]),X=(0,f.default)($[(0,u.default)(D.sizes,h,"md")]),ie=(0,i.twMerge)((0,a.default)(H,X,G,_({},(0,f.default)(U.fullWidth),y)),P);return r.default.createElement("button",O({},R,{ref:c,className:ie,type:R.type||"button",onMouseDown:function(fe){var pe=R==null?void 0:R.onMouseDown;return E&&z.create(fe,(s==="filled"||s==="gradient")&&v!=="white"?"light":"dark"),typeof pe=="function"&&pe(fe)}}),N)});m.propTypes={variant:n.default.oneOf(b.propTypesVariant),size:n.default.oneOf(b.propTypesSize),color:n.default.oneOf(b.propTypesColor),fullWidth:b.propTypesFullWidth,ripple:b.propTypesRipple,className:b.propTypesClassName,children:b.propTypesChildren},m.displayName="MaterialTailwind.Button";var d=m})(RO);var AO={},MO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{CardHeader:function(){return w},default:function(){return m}});var r=O(j),n=O($e),o=O(Xe),a=He,i=O(zt),u=O(Be),f=ze,g=si;function b(d,l,c){return l in d?Object.defineProperty(d,l,{value:c,enumerable:!0,configurable:!0,writable:!0}):d[l]=c,d}function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.variant,s=d.color,h=d.shadow,v=d.floated,y=d.className,E=d.children,P=S(d,["variant","color","shadow","floated","className","children"]),N=(0,f.useTheme)().cardHeader,R=N.defaultProps,M=N.styles,D=N.valid,L=M.base,W=M.variants;c=c??R.variant,s=s??R.color,h=h??R.shadow,v=v??R.floated,y=y??R.className;var U=(0,u.default)(L.initial),Y=(0,u.default)(W[(0,i.default)(D.variants,c,"filled")][(0,i.default)(D.colors,s,"white")]),$=(0,a.twMerge)((0,o.default)(U,Y,b({},(0,u.default)(L.shadow),h),b({},(0,u.default)(L.floated),v)),y);return r.default.createElement("div",_({},P,{ref:l,className:$}),E)});w.propTypes={variant:n.default.oneOf(g.propTypesVariant),color:n.default.oneOf(g.propTypesColor),shadow:g.propTypesShadow,floated:g.propTypesFloated,className:g.propTypesClassName,children:g.propTypesChildren},w.displayName="MaterialTailwind.CardHeader";var m=w})(MO);var IO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,w){for(var m in w)Object.defineProperty(C,m,{enumerable:!0,get:w[m]})}t(e,{CardBody:function(){return O},default:function(){return S}});var r=g(j),n=g(Xe),o=He,a=g(Be),i=ze,u=si;function f(){return f=Object.assign||function(C){for(var w=1;w=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function _(C,w){if(C==null)return{};var m={},d=Object.keys(C),l,c;for(c=0;c=0)&&(m[l]=C[l]);return m}var O=r.default.forwardRef(function(C,w){var m=C.className,d=C.children,l=b(C,["className","children"]),c=(0,i.useTheme)().cardBody,s=c.defaultProps,h=c.styles.base;m=m??s.className;var v=(0,o.twMerge)((0,n.default)((0,a.default)(h)),m);return r.default.createElement("div",f({},l,{ref:w,className:v}),d)});O.propTypes={className:u.propTypesClassName,children:u.propTypesChildren},O.displayName="MaterialTailwind.CardBody";var S=O})(IO);var DO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(w,m){for(var d in m)Object.defineProperty(w,d,{enumerable:!0,get:m[d]})}t(e,{CardFooter:function(){return S},default:function(){return C}});var r=b(j),n=b(Xe),o=He,a=b(Be),i=ze,u=si;function f(w,m,d){return m in w?Object.defineProperty(w,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):w[m]=d,w}function g(){return g=Object.assign||function(w){for(var m=1;m=0)&&Object.prototype.propertyIsEnumerable.call(w,l)&&(d[l]=w[l])}return d}function O(w,m){if(w==null)return{};var d={},l=Object.keys(w),c,s;for(s=0;s=0)&&(d[c]=w[c]);return d}var S=r.default.forwardRef(function(w,m){var d=w.divider,l=w.className,c=w.children,s=_(w,["divider","className","children"]),h=(0,i.useTheme)().cardFooter,v=h.defaultProps,y=h.styles.base;l=l??v.className,d=d??v.divider;var E=(0,o.twMerge)((0,n.default)((0,a.default)(y.initial),f({},(0,a.default)(y.divider),d)),l);return r.default.createElement("div",g({},s,{ref:m,className:E}),c)});S.propTypes={divider:u.propTypesDivider,className:u.propTypesClassName,children:u.propTypesChildren},S.displayName="MaterialTailwind.CardFooter";var C=S})(DO);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,h){for(var v in h)Object.defineProperty(s,v,{enumerable:!0,get:h[v]})}t(e,{Card:function(){return l},CardHeader:function(){return g.CardHeader},CardBody:function(){return b.CardBody},CardFooter:function(){return _.CardFooter},default:function(){return c}});var r=w(j),n=w($e),o=w(Xe),a=He,i=w(zt),u=w(Be),f=ze,g=MO,b=IO,_=DO,O=si;function S(s,h,v){return h in s?Object.defineProperty(s,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):s[h]=v,s}function C(){return C=Object.assign||function(s){for(var h=1;h=0)&&Object.prototype.propertyIsEnumerable.call(s,y)&&(v[y]=s[y])}return v}function d(s,h){if(s==null)return{};var v={},y=Object.keys(s),E,P;for(P=0;P=0)&&(v[E]=s[E]);return v}var l=r.default.forwardRef(function(s,h){var v=s.variant,y=s.color,E=s.shadow,P=s.className,N=s.children,R=m(s,["variant","color","shadow","className","children"]),M=(0,f.useTheme)().card,D=M.defaultProps,L=M.styles,W=M.valid,U=L.base,Y=L.variants;v=v??D.variant,y=y??D.color,E=E??D.shadow,P=P??D.className;var $=(0,u.default)(U.initial),z=(0,u.default)(Y[(0,i.default)(W.variants,v,"filled")][(0,i.default)(W.colors,y,"white")]),H=(0,a.twMerge)((0,o.default)($,z,S({},(0,u.default)(U.shadow),E)),P);return r.default.createElement("div",C({},R,{ref:h,className:H}),N)});l.propTypes={variant:n.default.oneOf(O.propTypesVariant),color:n.default.oneOf(O.propTypesColor),shadow:O.propTypesShadow,className:O.propTypesClassName,children:O.propTypesChildren},l.displayName="MaterialTailwind.Card";var c=Object.assign(l,{Header:g.CardHeader,Body:b.CardBody,Footer:_.CardFooter})})(AO);var LO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Checkbox:function(){return m},default:function(){return d}});var r=S(j),n=S($e),o=S(xl),a=S(Xe),i=He,u=S(zt),f=S(Be),g=ze,b=ui;function _(l,c,s){return c in l?Object.defineProperty(l,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[c]=s,l}function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.color,h=l.label,v=l.icon,y=l.ripple,E=l.className,P=l.disabled,N=l.containerProps,R=l.labelProps,M=l.iconProps,D=l.inputRef,L=C(l,["color","label","icon","ripple","className","disabled","containerProps","labelProps","iconProps","inputRef"]),W=(0,g.useTheme)().checkbox,U=W.defaultProps,Y=W.valid,$=W.styles,z=$.base,H=$.colors,G=r.default.useId();s=s??U.color,h=h??U.label,v=v??U.icon,y=y??U.ripple,E=E??U.className,P=P??U.disabled,N=N??U.containerProps,R=R??U.labelProps,M=M??U.iconProps;var X=y!==void 0&&new o.default,ie=(0,a.default)((0,f.default)(z.root),_({},(0,f.default)(z.disabled),P)),fe=(0,i.twMerge)((0,a.default)((0,f.default)(z.container)),N==null?void 0:N.className),pe=(0,i.twMerge)((0,a.default)((0,f.default)(z.input),(0,f.default)(H[(0,u.default)(Y.colors,s,"gray")])),E),oe=(0,i.twMerge)((0,a.default)((0,f.default)(z.label)),R==null?void 0:R.className),se=(0,i.twMerge)((0,a.default)((0,f.default)(z.icon)),M==null?void 0:M.className);return r.default.createElement("div",{ref:c,className:ie},r.default.createElement("label",O({},N,{className:fe,htmlFor:L.id||G,onMouseDown:function(ee){var ae=N==null?void 0:N.onMouseDown;return y&&X.create(ee,"dark"),typeof ae=="function"&&ae(ee)}}),r.default.createElement("input",O({},L,{ref:D,type:"checkbox",disabled:P,className:pe,id:L.id||G})),r.default.createElement("span",{className:se},v||r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3.5 w-3.5",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",strokeWidth:1},r.default.createElement("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})))),h&&r.default.createElement("label",O({},R,{className:oe,htmlFor:L.id||G}),h))});m.propTypes={color:n.default.oneOf(b.propTypesColor),label:b.propTypesLabel,icon:b.propTypesIcon,ripple:b.propTypesRipple,className:b.propTypesClassName,disabled:b.propTypesDisabled,containerProps:b.propTypesObject,labelProps:b.propTypesObject},m.displayName="MaterialTailwind.Checkbox";var d=m})(LO);var FO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,s){for(var h in s)Object.defineProperty(c,h,{enumerable:!0,get:s[h]})}t(e,{Chip:function(){return d},default:function(){return l}});var r=C(j),n=C($e),o=gr,a=C(Xe),i=C(yr),u=He,f=C(zt),g=C(Be),b=ze,_=lm,O=C(vf);function S(){return S=Object.assign||function(c){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(c,v)&&(h[v]=c[v])}return h}function m(c,s){if(c==null)return{};var h={},v=Object.keys(c),y,E;for(E=0;E=0)&&(h[y]=c[y]);return h}var d=r.default.forwardRef(function(c,s){var h=c.variant,v=c.size,y=c.color,E=c.icon,P=c.open,N=c.onClose,R=c.action,M=c.animate,D=c.className,L=c.value,W=w(c,["variant","size","color","icon","open","onClose","action","animate","className","value"]),U=(0,b.useTheme)().chip,Y=U.defaultProps,$=U.valid,z=U.styles,H=z.base,G=z.variants,X=z.sizes;h=h??Y.variant,v=v??Y.size,y=y??Y.color,D=D??Y.className,M=M??Y.animate,P=P??Y.open,R=R??Y.action,N=N??Y.onClose;var ie=(0,g.default)(H.chip),fe=(0,g.default)(H.action),pe=(0,g.default)(H.icon),oe=(0,g.default)(G[(0,f.default)($.variants,h,"filled")][(0,f.default)($.colors,y,"gray")]),se=(0,g.default)(X[(0,f.default)($.sizes,v,"md")].chip),ee=(0,g.default)(X[(0,f.default)($.sizes,v,"md")].action),ae=(0,g.default)(X[(0,f.default)($.sizes,v,"md")].icon),ue=(0,u.twMerge)((0,a.default)(ie,oe,se),D),de=(0,a.default)(fe,ee),Te=(0,a.default)(pe,ae),xe=(0,a.default)({"ml-4":E&&v==="sm","ml-[18px]":E&&v==="md","ml-5":E&&v==="lg","mr-5":N}),be={unmount:{opacity:0},mount:{opacity:1}},Se=(0,i.default)(be,M),je=r.default.createElement("div",{className:Te},E),qe=o.AnimatePresence;return r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(qe,null,P&&r.default.createElement(o.m.div,S({},W,{ref:s,className:ue,initial:"unmount",exit:"unmount",animate:P?"mount":"unmount",variants:Se}),E&&je,r.default.createElement("span",{className:xe},L),N&&!R&&r.default.createElement(O.default,{onClick:N,size:"sm",variant:"text",color:h==="outlined"||h==="ghost"?y:"white",className:de},r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:(0,a.default)({"h-3.5 w-3.5":v==="sm","h-4 w-4":v==="md","h-5 w-5":v==="lg"}),strokeWidth:2},r.default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))),R||null)))});d.propTypes={variant:n.default.oneOf(_.propTypesVariant),size:n.default.oneOf(_.propTypesSize),color:n.default.oneOf(_.propTypesColor),icon:_.propTypesIcon,open:_.propTypesOpen,onClose:_.propTypesOnClose,action:_.propTypesAction,animate:_.propTypesAnimate,className:_.propTypesClassName,value:_.propTypesValue},d.displayName="MaterialTailwind.Chip";var l=d})(FO);var zO={},rF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ci=new WeakMap,Xu=new WeakMap,Ju={},Xp=0,BO=function(e){return e&&(e.host||BO(e.parentNode))},nF=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=BO(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},oF=function(e,t,r,n){var o=nF(t,Array.isArray(e)?e:[e]);Ju[r]||(Ju[r]=new WeakMap);var a=Ju[r],i=[],u=new Set,f=new Set(o),g=function(_){!_||u.has(_)||(u.add(_),g(_.parentNode))};o.forEach(g);var b=function(_){!_||f.has(_)||Array.prototype.forEach.call(_.children,function(O){if(u.has(O))b(O);else try{var S=O.getAttribute(n),C=S!==null&&S!=="false",w=(Ci.get(O)||0)+1,m=(a.get(O)||0)+1;Ci.set(O,w),a.set(O,m),i.push(O),w===1&&C&&Xu.set(O,!0),m===1&&O.setAttribute(r,"true"),C||O.setAttribute(n,"true")}catch(d){console.error("aria-hidden: cannot operate on ",O,d)}})};return b(t),u.clear(),Xp++,function(){i.forEach(function(_){var O=Ci.get(_)-1,S=a.get(_)-1;Ci.set(_,O),a.set(_,S),O||(Xu.has(_)||_.removeAttribute(n),Xu.delete(_)),S||_.removeAttribute(r)}),Xp--,Xp||(Ci=new WeakMap,Ci=new WeakMap,Xu=new WeakMap,Ju={})}},aF=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||rF(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),oF(n,o,r,"aria-hidden")):function(){return null}};/*! * tabbable 6.2.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var iF=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ah=iF.join(","),VO=typeof Element>"u",Gs=VO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Cd=!VO&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Sd=function e(t,r){var n;r===void 0&&(r=!0);var o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),a=o===""||o==="true",i=a||r&&t&&e(t.parentNode);return i},lF=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},sF=function(t,r,n){if(Sd(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Ah));return r&&Gs.call(t,Ah)&&o.unshift(t),o=o.filter(n),o},uF=function e(t,r,n){for(var o=[],a=Array.from(t);a.length;){var i=a.shift();if(!Sd(i,!1))if(i.tagName==="SLOT"){var u=i.assignedElements(),f=u.length?u:i.children,g=e(f,!0,n);n.flatten?o.push.apply(o,g):o.push({scopeParent:i,candidates:g})}else{var b=Gs.call(i,Ah);b&&n.filter(i)&&(r||!t.includes(i))&&o.push(i);var _=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),O=!Sd(_,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(_&&O){var S=e(_===!0?i.children:_.children,!0,n);n.flatten?o.push.apply(o,S):o.push({scopeParent:i,candidates:S})}else a.unshift.apply(a,i.children)}}return o},UO=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},WO=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lF(t))&&!UO(t)?0:t.tabIndex},cF=function(t,r){var n=WO(t);return n<0&&r&&!UO(t)?0:n},dF=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},HO=function(t){return t.tagName==="INPUT"},fF=function(t){return HO(t)&&t.type==="hidden"},pF=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},hF=function(t,r){for(var n=0;nsummary:first-of-type"),i=a?t.parentElement:t;if(Gs.call(i,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var f=t.parentElement,g=Cd(t);if(f&&!f.shadowRoot&&o(f)===!0)return qw(t);t.assignedSlot?t=t.assignedSlot:!f&&g!==t.ownerDocument?t=g.host:t=f}t=u}if(vF(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return qw(t);return!1},wF=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n=0)},CF=function e(t){var r=[],n=[];return t.forEach(function(o,a){var i=!!o.scopeParent,u=i?o.scopeParent:o,f=cF(u,i),g=i?e(o.candidates):u;f===0?i?r.push.apply(r,g):r.push(u):n.push({documentOrder:a,tabIndex:f,item:o,isScope:i,content:g})}),n.sort(dF).reduce(function(o,a){return a.isScope?o.push.apply(o,a.content):o.push(a.content),o},[]).concat(r)},Td=function(t,r){r=r||{};var n;return r.getShadowRoot?n=uF([t],r.includeContainer,{filter:Gw.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:_F}):n=sF(t,r.includeContainer,Gw.bind(null,r)),CF(n)};const $O=["top","right","bottom","left"],Kw=["start","end"],Yw=$O.reduce((e,t)=>e.concat(t,t+"-"+Kw[0],t+"-"+Kw[1]),[]),Un=Math.min,kr=Math.max,Od=Math.round,Zu=Math.floor,io=e=>({x:e,y:e}),SF={left:"right",right:"left",bottom:"top",top:"bottom"},TF={start:"end",end:"start"};function Mh(e,t,r){return kr(e,Un(t,r))}function Wn(e,t){return typeof e=="function"?e(t):e}function ln(e){return e.split("-")[0]}function Bn(e){return e.split("-")[1]}function Dm(e){return e==="x"?"y":"x"}function Lm(e){return e==="y"?"height":"width"}const OF=new Set(["top","bottom"]);function Dn(e){return OF.has(ln(e))?"y":"x"}function Fm(e){return Dm(Dn(e))}function qO(e,t,r){r===void 0&&(r=!1);const n=Bn(e),o=Fm(e),a=Lm(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=kd(i)),[i,kd(i)]}function PF(e){const t=kd(e);return[Pd(e),t,Pd(t)]}function Pd(e){return e.replace(/start|end/g,t=>TF[t])}const Qw=["left","right"],Xw=["right","left"],kF=["top","bottom"],EF=["bottom","top"];function NF(e,t,r){switch(e){case"top":case"bottom":return r?t?Xw:Qw:t?Qw:Xw;case"left":case"right":return t?kF:EF;default:return[]}}function jF(e,t,r,n){const o=Bn(e);let a=NF(ln(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(Pd)))),a}function kd(e){return e.replace(/left|right|bottom|top/g,t=>SF[t])}function RF(e){return{top:0,right:0,bottom:0,left:0,...e}}function zm(e){return typeof e!="number"?RF(e):{top:e,right:e,bottom:e,left:e}}function sl(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Jw(e,t,r){let{reference:n,floating:o}=e;const a=Dn(t),i=Fm(t),u=Lm(i),f=ln(t),g=a==="y",b=n.x+n.width/2-o.width/2,_=n.y+n.height/2-o.height/2,O=n[u]/2-o[u]/2;let S;switch(f){case"top":S={x:b,y:n.y-o.height};break;case"bottom":S={x:b,y:n.y+n.height};break;case"right":S={x:n.x+n.width,y:_};break;case"left":S={x:n.x-o.width,y:_};break;default:S={x:n.x,y:n.y}}switch(Bn(t)){case"start":S[i]-=O*(r&&g?-1:1);break;case"end":S[i]+=O*(r&&g?-1:1);break}return S}const AF=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,u=a.filter(Boolean),f=await(i.isRTL==null?void 0:i.isRTL(t));let g=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:b,y:_}=Jw(g,n,f),O=n,S={},C=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:u,middlewareData:f}=t,{element:g,padding:b=0}=Wn(e,t)||{};if(g==null)return{};const _=zm(b),O={x:r,y:n},S=Fm(o),C=Lm(S),w=await i.getDimensions(g),m=S==="y",d=m?"top":"left",l=m?"bottom":"right",c=m?"clientHeight":"clientWidth",s=a.reference[C]+a.reference[S]-O[S]-a.floating[C],h=O[S]-a.reference[S],v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(g));let y=v?v[c]:0;(!y||!await(i.isElement==null?void 0:i.isElement(v)))&&(y=u.floating[c]||a.floating[C]);const E=s/2-h/2,P=y/2-w[C]/2-1,N=Un(_[d],P),R=Un(_[l],P),M=N,D=y-w[C]-R,L=y/2-w[C]/2+E,W=Mh(M,L,D),U=!f.arrow&&Bn(o)!=null&&L!==W&&a.reference[C]/2-(LBn(o)===e),...r.filter(o=>Bn(o)!==e)]:r.filter(o=>ln(o)===o)).filter(o=>e?Bn(o)===e||(t?Pd(o)!==o:!1):!0)}const DF=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,o;const{rects:a,middlewareData:i,placement:u,platform:f,elements:g}=t,{crossAxis:b=!1,alignment:_,allowedPlacements:O=Yw,autoAlignment:S=!0,...C}=Wn(e,t),w=_!==void 0||O===Yw?IF(_||null,S,O):O,m=await Za(t,C),d=((r=i.autoPlacement)==null?void 0:r.index)||0,l=w[d];if(l==null)return{};const c=qO(l,a,await(f.isRTL==null?void 0:f.isRTL(g.floating)));if(u!==l)return{reset:{placement:w[0]}};const s=[m[ln(l)],m[c[0]],m[c[1]]],h=[...((n=i.autoPlacement)==null?void 0:n.overflows)||[],{placement:l,overflows:s}],v=w[d+1];if(v)return{data:{index:d+1,overflows:h},reset:{placement:v}};const y=h.map(N=>{const R=Bn(N.placement);return[N.placement,R&&b?N.overflows.slice(0,2).reduce((M,D)=>M+D,0):N.overflows[0],N.overflows]}).sort((N,R)=>N[1]-R[1]),P=((o=y.filter(N=>N[2].slice(0,Bn(N[0])?2:3).every(R=>R<=0))[0])==null?void 0:o[0])||y[0][0];return P!==u?{data:{index:d+1,overflows:h},reset:{placement:P}}:{}}}},LF=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:u,platform:f,elements:g}=t,{mainAxis:b=!0,crossAxis:_=!0,fallbackPlacements:O,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:w=!0,...m}=Wn(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const d=ln(o),l=Dn(u),c=ln(u)===u,s=await(f.isRTL==null?void 0:f.isRTL(g.floating)),h=O||(c||!w?[kd(u)]:PF(u)),v=C!=="none";!O&&v&&h.push(...jF(u,w,C,s));const y=[u,...h],E=await Za(t,m),P=[];let N=((n=a.flip)==null?void 0:n.overflows)||[];if(b&&P.push(E[d]),_){const L=qO(o,i,s);P.push(E[L[0]],E[L[1]])}if(N=[...N,{placement:o,overflows:P}],!P.every(L=>L<=0)){var R,M;const L=(((R=a.flip)==null?void 0:R.index)||0)+1,W=y[L];if(W&&(!(_==="alignment"?l!==Dn(W):!1)||N.every($=>Dn($.placement)===l?$.overflows[0]>0:!0)))return{data:{index:L,overflows:N},reset:{placement:W}};let U=(M=N.filter(Y=>Y.overflows[0]<=0).sort((Y,$)=>Y.overflows[1]-$.overflows[1])[0])==null?void 0:M.placement;if(!U)switch(S){case"bestFit":{var D;const Y=(D=N.filter($=>{if(v){const z=Dn($.placement);return z===l||z==="y"}return!0}).map($=>[$.placement,$.overflows.filter(z=>z>0).reduce((z,H)=>z+H,0)]).sort(($,z)=>$[1]-z[1])[0])==null?void 0:D[0];Y&&(U=Y);break}case"initialPlacement":U=u;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Zw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ex(e){return $O.some(t=>e[t]>=0)}const FF=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Wn(e,t);switch(n){case"referenceHidden":{const a=await Za(t,{...o,elementContext:"reference"}),i=Zw(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ex(i)}}}case"escaped":{const a=await Za(t,{...o,altBoundary:!0}),i=Zw(a,r.floating);return{data:{escapedOffsets:i,escaped:ex(i)}}}default:return{}}}}};function GO(e){const t=Un(...e.map(a=>a.left)),r=Un(...e.map(a=>a.top)),n=kr(...e.map(a=>a.right)),o=kr(...e.map(a=>a.bottom));return{x:t,y:r,width:n-t,height:o-r}}function zF(e){const t=e.slice().sort((o,a)=>o.y-a.y),r=[];let n=null;for(let o=0;on.height/2?r.push([a]):r[r.length-1].push(a),n=a}return r.map(o=>sl(GO(o)))}const BF=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:n,rects:o,platform:a,strategy:i}=t,{padding:u=2,x:f,y:g}=Wn(e,t),b=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(n.reference))||[]),_=zF(b),O=sl(GO(b)),S=zm(u);function C(){if(_.length===2&&_[0].left>_[1].right&&f!=null&&g!=null)return _.find(m=>f>m.left-S.left&&fm.top-S.top&&g=2){if(Dn(r)==="y"){const N=_[0],R=_[_.length-1],M=ln(r)==="top",D=N.top,L=R.bottom,W=M?N.left:R.left,U=M?N.right:R.right,Y=U-W,$=L-D;return{top:D,bottom:L,left:W,right:U,width:Y,height:$,x:W,y:D}}const m=ln(r)==="left",d=kr(..._.map(N=>N.right)),l=Un(..._.map(N=>N.left)),c=_.filter(N=>m?N.left===l:N.right===d),s=c[0].top,h=c[c.length-1].bottom,v=l,y=d,E=y-v,P=h-s;return{top:s,bottom:h,left:v,right:y,width:E,height:P,x:v,y:s}}return O}const w=await a.getElementRects({reference:{getBoundingClientRect:C},floating:n.floating,strategy:i});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},KO=new Set(["left","top"]);async function VF(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=ln(r),u=Bn(r),f=Dn(r)==="y",g=KO.has(i)?-1:1,b=a&&f?-1:1,_=Wn(t,e);let{mainAxis:O,crossAxis:S,alignmentAxis:C}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:_.mainAxis||0,crossAxis:_.crossAxis||0,alignmentAxis:_.alignmentAxis};return u&&typeof C=="number"&&(S=u==="end"?C*-1:C),f?{x:S*b,y:O*g}:{x:O*g,y:S*b}}const UF=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:u}=t,f=await VF(t,e);return i===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:o+f.x,y:a+f.y,data:{...f,placement:i}}}}},WF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:u={fn:m=>{let{x:d,y:l}=m;return{x:d,y:l}}},...f}=Wn(e,t),g={x:r,y:n},b=await Za(t,f),_=Dn(ln(o)),O=Dm(_);let S=g[O],C=g[_];if(a){const m=O==="y"?"top":"left",d=O==="y"?"bottom":"right",l=S+b[m],c=S-b[d];S=Mh(l,S,c)}if(i){const m=_==="y"?"top":"left",d=_==="y"?"bottom":"right",l=C+b[m],c=C-b[d];C=Mh(l,C,c)}const w=u.fn({...t,[O]:S,[_]:C});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[O]:a,[_]:i}}}}}},HF=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:u=0,mainAxis:f=!0,crossAxis:g=!0}=Wn(e,t),b={x:r,y:n},_=Dn(o),O=Dm(_);let S=b[O],C=b[_];const w=Wn(u,t),m=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const c=O==="y"?"height":"width",s=a.reference[O]-a.floating[c]+m.mainAxis,h=a.reference[O]+a.reference[c]-m.mainAxis;Sh&&(S=h)}if(g){var d,l;const c=O==="y"?"width":"height",s=KO.has(ln(o)),h=a.reference[_]-a.floating[c]+(s&&((d=i.offset)==null?void 0:d[_])||0)+(s?0:m.crossAxis),v=a.reference[_]+a.reference[c]+(s?0:((l=i.offset)==null?void 0:l[_])||0)-(s?m.crossAxis:0);Cv&&(C=v)}return{[O]:S,[_]:C}}}},$F=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:u}=t,{apply:f=()=>{},...g}=Wn(e,t),b=await Za(t,g),_=ln(o),O=Bn(o),S=Dn(o)==="y",{width:C,height:w}=a.floating;let m,d;_==="top"||_==="bottom"?(m=_,d=O===(await(i.isRTL==null?void 0:i.isRTL(u.floating))?"start":"end")?"left":"right"):(d=_,m=O==="end"?"top":"bottom");const l=w-b.top-b.bottom,c=C-b.left-b.right,s=Un(w-b[m],l),h=Un(C-b[d],c),v=!t.middlewareData.shift;let y=s,E=h;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=c),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(y=l),v&&!O){const N=kr(b.left,0),R=kr(b.right,0),M=kr(b.top,0),D=kr(b.bottom,0);S?E=C-2*(N!==0||R!==0?N+R:kr(b.left,b.right)):y=w-2*(M!==0||D!==0?M+D:kr(b.top,b.bottom))}await f({...t,availableWidth:E,availableHeight:y});const P=await i.getDimensions(u.floating);return C!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function yf(){return typeof window<"u"}function _l(e){return YO(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function co(e){var t;return(t=(YO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function YO(e){return yf()?e instanceof Node||e instanceof on(e).Node:!1}function Hn(e){return yf()?e instanceof Element||e instanceof on(e).Element:!1}function so(e){return yf()?e instanceof HTMLElement||e instanceof on(e).HTMLElement:!1}function tx(e){return!yf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof on(e).ShadowRoot}const qF=new Set(["inline","contents"]);function du(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=$n(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!qF.has(o)}const GF=new Set(["table","td","th"]);function KF(e){return GF.has(_l(e))}const YF=[":popover-open",":modal"];function wf(e){return YF.some(t=>{try{return e.matches(t)}catch{return!1}})}const QF=["transform","translate","scale","rotate","perspective"],XF=["transform","translate","scale","rotate","perspective","filter"],JF=["paint","layout","strict","content"];function Bm(e){const t=Vm(),r=Hn(e)?$n(e):e;return QF.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||XF.some(n=>(r.willChange||"").includes(n))||JF.some(n=>(r.contain||"").includes(n))}function ZF(e){let t=va(e);for(;so(t)&&!ul(t);){if(Bm(t))return t;if(wf(t))return null;t=va(t)}return null}function Vm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const e6=new Set(["html","body","#document"]);function ul(e){return e6.has(_l(e))}function $n(e){return on(e).getComputedStyle(e)}function xf(e){return Hn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function va(e){if(_l(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tx(e)&&e.host||co(e);return tx(t)?t.host:t}function QO(e){const t=va(e);return ul(t)?e.ownerDocument?e.ownerDocument.body:e.body:so(t)&&du(t)?t:QO(t)}function Oo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=QO(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=on(o);if(a){const u=Ih(i);return t.concat(i,i.visualViewport||[],du(o)?o:[],u&&r?Oo(u):[])}return t.concat(o,Oo(o,[],r))}function Ih(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function XO(e){const t=$n(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=so(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,u=Od(r)!==a||Od(n)!==i;return u&&(r=a,n=i),{width:r,height:n,$:u}}function Um(e){return Hn(e)?e:e.contextElement}function Ki(e){const t=Um(e);if(!so(t))return io(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=XO(t);let i=(a?Od(r.width):r.width)/n,u=(a?Od(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!u||!Number.isFinite(u))&&(u=1),{x:i,y:u}}const t6=io(0);function JO(e){const t=on(e);return!Vm()||!t.visualViewport?t6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function r6(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==on(e)?!1:t}function ei(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=Um(e);let i=io(1);t&&(n?Hn(n)&&(i=Ki(n)):i=Ki(e));const u=r6(a,r,n)?JO(a):io(0);let f=(o.left+u.x)/i.x,g=(o.top+u.y)/i.y,b=o.width/i.x,_=o.height/i.y;if(a){const O=on(a),S=n&&Hn(n)?on(n):n;let C=O,w=Ih(C);for(;w&&n&&S!==C;){const m=Ki(w),d=w.getBoundingClientRect(),l=$n(w),c=d.left+(w.clientLeft+parseFloat(l.paddingLeft))*m.x,s=d.top+(w.clientTop+parseFloat(l.paddingTop))*m.y;f*=m.x,g*=m.y,b*=m.x,_*=m.y,f+=c,g+=s,C=on(w),w=Ih(C)}}return sl({width:b,height:_,x:f,y:g})}function _f(e,t){const r=xf(e).scrollLeft;return t?t.left+r:ei(co(e)).left+r}function ZO(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-_f(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function n6(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=co(n),u=t?wf(t.floating):!1;if(n===i||u&&a)return r;let f={scrollLeft:0,scrollTop:0},g=io(1);const b=io(0),_=so(n);if((_||!_&&!a)&&((_l(n)!=="body"||du(i))&&(f=xf(n)),so(n))){const S=ei(n);g=Ki(n),b.x=S.x+n.clientLeft,b.y=S.y+n.clientTop}const O=i&&!_&&!a?ZO(i,f):io(0);return{width:r.width*g.x,height:r.height*g.y,x:r.x*g.x-f.scrollLeft*g.x+b.x+O.x,y:r.y*g.y-f.scrollTop*g.y+b.y+O.y}}function o6(e){return Array.from(e.getClientRects())}function a6(e){const t=co(e),r=xf(e),n=e.ownerDocument.body,o=kr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=kr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+_f(e);const u=-r.scrollTop;return $n(n).direction==="rtl"&&(i+=kr(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:u}}const rx=25;function i6(e,t){const r=on(e),n=co(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,u=0,f=0;if(o){a=o.width,i=o.height;const b=Vm();(!b||b&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}const g=_f(n);if(g<=0){const b=n.ownerDocument,_=b.body,O=getComputedStyle(_),S=b.compatMode==="CSS1Compat"&&parseFloat(O.marginLeft)+parseFloat(O.marginRight)||0,C=Math.abs(n.clientWidth-_.clientWidth-S);C<=rx&&(a-=C)}else g<=rx&&(a+=g);return{width:a,height:i,x:u,y:f}}const l6=new Set(["absolute","fixed"]);function s6(e,t){const r=ei(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=so(e)?Ki(e):io(1),i=e.clientWidth*a.x,u=e.clientHeight*a.y,f=o*a.x,g=n*a.y;return{width:i,height:u,x:f,y:g}}function nx(e,t,r){let n;if(t==="viewport")n=i6(e,r);else if(t==="document")n=a6(co(e));else if(Hn(t))n=s6(t,r);else{const o=JO(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return sl(n)}function eP(e,t){const r=va(e);return r===t||!Hn(r)||ul(r)?!1:$n(r).position==="fixed"||eP(r,t)}function u6(e,t){const r=t.get(e);if(r)return r;let n=Oo(e,[],!1).filter(u=>Hn(u)&&_l(u)!=="body"),o=null;const a=$n(e).position==="fixed";let i=a?va(e):e;for(;Hn(i)&&!ul(i);){const u=$n(i),f=Bm(i);!f&&u.position==="fixed"&&(o=null),(a?!f&&!o:!f&&u.position==="static"&&!!o&&l6.has(o.position)||du(i)&&!f&&eP(e,i))?n=n.filter(b=>b!==i):o=u,i=va(i)}return t.set(e,n),n}function c6(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?wf(t)?[]:u6(t,this._c):[].concat(r),n],u=i[0],f=i.reduce((g,b)=>{const _=nx(t,b,o);return g.top=kr(_.top,g.top),g.right=Un(_.right,g.right),g.bottom=Un(_.bottom,g.bottom),g.left=kr(_.left,g.left),g},nx(t,u,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function d6(e){const{width:t,height:r}=XO(e);return{width:t,height:r}}function f6(e,t,r){const n=so(t),o=co(t),a=r==="fixed",i=ei(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const f=io(0);function g(){f.x=_f(o)}if(n||!n&&!a)if((_l(t)!=="body"||du(o))&&(u=xf(t)),n){const S=ei(t,!0,a,t);f.x=S.x+t.clientLeft,f.y=S.y+t.clientTop}else o&&g();a&&!n&&o&&g();const b=o&&!n&&!a?ZO(o,u):io(0),_=i.left+u.scrollLeft-f.x-b.x,O=i.top+u.scrollTop-f.y-b.y;return{x:_,y:O,width:i.width,height:i.height}}function Jp(e){return $n(e).position==="static"}function ox(e,t){if(!so(e)||$n(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return co(e)===r&&(r=r.ownerDocument.body),r}function tP(e,t){const r=on(e);if(wf(e))return r;if(!so(e)){let o=va(e);for(;o&&!ul(o);){if(Hn(o)&&!Jp(o))return o;o=va(o)}return r}let n=ox(e,t);for(;n&&KF(n)&&Jp(n);)n=ox(n,t);return n&&ul(n)&&Jp(n)&&!Bm(n)?r:n||ZF(e)||r}const p6=async function(e){const t=this.getOffsetParent||tP,r=this.getDimensions,n=await r(e.floating);return{reference:f6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function h6(e){return $n(e).direction==="rtl"}const rP={convertOffsetParentRelativeRectToViewportRelativeRect:n6,getDocumentElement:co,getClippingRect:c6,getOffsetParent:tP,getElementRects:p6,getClientRects:o6,getDimensions:d6,getScale:Ki,isElement:Hn,isRTL:h6};function nP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function g6(e,t){let r=null,n;const o=co(e);function a(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function i(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),a();const g=e.getBoundingClientRect(),{left:b,top:_,width:O,height:S}=g;if(u||t(),!O||!S)return;const C=Zu(_),w=Zu(o.clientWidth-(b+O)),m=Zu(o.clientHeight-(_+S)),d=Zu(b),c={rootMargin:-C+"px "+-w+"px "+-m+"px "+-d+"px",threshold:kr(0,Un(1,f))||1};let s=!0;function h(v){const y=v[0].intersectionRatio;if(y!==f){if(!s)return i();y?i(!1,y):n=setTimeout(()=>{i(!1,1e-7)},1e3)}y===1&&!nP(g,e.getBoundingClientRect())&&i(),s=!1}try{r=new IntersectionObserver(h,{...c,root:o.ownerDocument})}catch{r=new IntersectionObserver(h,c)}r.observe(e)}return i(!0),a}function m6(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,g=Um(e),b=o||a?[...g?Oo(g):[],...Oo(t)]:[];b.forEach(d=>{o&&d.addEventListener("scroll",r,{passive:!0}),a&&d.addEventListener("resize",r)});const _=g&&u?g6(g,r):null;let O=-1,S=null;i&&(S=new ResizeObserver(d=>{let[l]=d;l&&l.target===g&&S&&(S.unobserve(t),cancelAnimationFrame(O),O=requestAnimationFrame(()=>{var c;(c=S)==null||c.observe(t)})),r()}),g&&!f&&S.observe(g),S.observe(t));let C,w=f?ei(e):null;f&&m();function m(){const d=ei(e);w&&!nP(w,d)&&r(),w=d,C=requestAnimationFrame(m)}return r(),()=>{var d;b.forEach(l=>{o&&l.removeEventListener("scroll",r),a&&l.removeEventListener("resize",r)}),_==null||_(),(d=S)==null||d.disconnect(),S=null,f&&cancelAnimationFrame(C)}}const kc=Za,oP=UF,b6=DF,v6=WF,y6=LF,w6=$F,x6=FF,ax=MF,_6=BF,C6=HF,aP=(e,t,r)=>{const n=new Map,o={platform:rP,...r},a={...o.platform,_c:n};return AF(e,t,{...o,platform:a})},S6=e=>{const{element:t,padding:r}=e;function n(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return n(t)?t.current!=null?ax({element:t.current,padding:r}).fn(o):{}:t?ax({element:t,padding:r}).fn(o):{}}}};var Ec=typeof document<"u"?j.useLayoutEffect:j.useEffect;function Ed(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Ed(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Ed(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function ix(e){const t=j.useRef(e);return Ec(()=>{t.current=e}),t}function T6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,whileElementsMounted:a,open:i}=e,[u,f]=j.useState({x:null,y:null,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,b]=j.useState(n);Ed(g,n)||b(n);const _=j.useRef(null),O=j.useRef(null),S=j.useRef(u),C=ix(a),w=ix(o),[m,d]=j.useState(null),[l,c]=j.useState(null),s=j.useCallback(N=>{_.current!==N&&(_.current=N,d(N))},[]),h=j.useCallback(N=>{O.current!==N&&(O.current=N,c(N))},[]),v=j.useCallback(()=>{if(!_.current||!O.current)return;const N={placement:t,strategy:r,middleware:g};w.current&&(N.platform=w.current),aP(_.current,O.current,N).then(R=>{const M={...R,isPositioned:!0};y.current&&!Ed(S.current,M)&&(S.current=M,jo.flushSync(()=>{f(M)}))})},[g,t,r,w]);Ec(()=>{i===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[i]);const y=j.useRef(!1);Ec(()=>(y.current=!0,()=>{y.current=!1}),[]),Ec(()=>{if(m&&l){if(C.current)return C.current(m,l,v);v()}},[m,l,v,C]);const E=j.useMemo(()=>({reference:_,floating:O,setReference:s,setFloating:h}),[s,h]),P=j.useMemo(()=>({reference:m,floating:l}),[m,l]);return j.useMemo(()=>({...u,update:v,refs:E,elements:P,reference:s,floating:h}),[u,v,E,P,s,h])}var Ut=typeof document<"u"?j.useLayoutEffect:j.useEffect;let Zp=!1,O6=0;const lx=()=>"floating-ui-"+O6++;function P6(){const[e,t]=j.useState(()=>Zp?lx():void 0);return Ut(()=>{e==null&&t(lx())},[]),j.useEffect(()=>{Zp||(Zp=!0)},[]),e}const k6=Yh["useId".toString()],Ks=k6||P6;function iP(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){e.set(t,(e.get(t)||[]).filter(n=>n!==r))}}}const lP=j.createContext(null),sP=j.createContext(null),Cl=()=>{var e;return((e=j.useContext(lP))==null?void 0:e.id)||null},di=()=>j.useContext(sP),E6=e=>{const t=Ks(),r=di(),n=Cl(),o=e||n;return Ut(()=>{const a={id:t,parentId:o};return r==null||r.addNode(a),()=>{r==null||r.removeNode(a)}},[r,t,o]),t},N6=e=>{let{children:t,id:r}=e;const n=Cl();return j.createElement(lP.Provider,{value:j.useMemo(()=>({id:r,parentId:n}),[r,n])},t)},j6=e=>{let{children:t}=e;const r=j.useRef([]),n=j.useCallback(i=>{r.current=[...r.current,i]},[]),o=j.useCallback(i=>{r.current=r.current.filter(u=>u!==i)},[]),a=j.useState(()=>iP())[0];return j.createElement(sP.Provider,{value:j.useMemo(()=>({nodesRef:r,addNode:n,removeNode:o,events:a}),[r,n,o,a])},t)};function Hr(e){return(e==null?void 0:e.ownerDocument)||document}function Wm(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function uP(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}function Hm(e){return Hr(e).defaultView||window}function xn(e){return e?e instanceof Hm(e).Element:!1}function ti(e){return e?e instanceof Hm(e).HTMLElement:!1}function R6(e){if(typeof ShadowRoot>"u")return!1;const t=Hm(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function cP(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Wm())||t.test(uP()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function dP(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Dh(){return/apple/i.test(navigator.vendor)}function fP(){return Wm().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Nd(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function _n(e){const t=j.useRef(e);return Ut(()=>{t.current=e}),t}const sx="data-floating-ui-safe-polygon";function Nc(e,t,r){return r&&!Nd(r)?0:typeof e=="number"?e:e==null?void 0:e[t]}const A6=function(e,t){let{enabled:r=!0,delay:n=0,handleClose:o=null,mouseOnly:a=!1,restMs:i=0,move:u=!0}=t===void 0?{}:t;const{open:f,onOpenChange:g,dataRef:b,events:_,elements:{domReference:O,floating:S},refs:C}=e,w=di(),m=Cl(),d=_n(o),l=_n(n),c=j.useRef(),s=j.useRef(),h=j.useRef(),v=j.useRef(),y=j.useRef(!0),E=j.useRef(!1),P=j.useRef(()=>{}),N=j.useCallback(()=>{var L;const W=(L=b.current.openEvent)==null?void 0:L.type;return(W==null?void 0:W.includes("mouse"))&&W!=="mousedown"},[b]);j.useEffect(()=>{if(!r)return;function L(){clearTimeout(s.current),clearTimeout(v.current),y.current=!0}return _.on("dismiss",L),()=>{_.off("dismiss",L)}},[r,_]),j.useEffect(()=>{if(!r||!d.current||!f)return;function L(){N()&&g(!1)}const W=Hr(S).documentElement;return W.addEventListener("mouseleave",L),()=>{W.removeEventListener("mouseleave",L)}},[S,f,g,r,d,b,N]);const R=j.useCallback(function(L){L===void 0&&(L=!0);const W=Nc(l.current,"close",c.current);W&&!h.current?(clearTimeout(s.current),s.current=setTimeout(()=>g(!1),W)):L&&(clearTimeout(s.current),g(!1))},[l,g]),M=j.useCallback(()=>{P.current(),h.current=void 0},[]),D=j.useCallback(()=>{if(E.current){const L=Hr(C.floating.current).body;L.style.pointerEvents="",L.removeAttribute(sx),E.current=!1}},[C]);return j.useEffect(()=>{if(!r)return;function L(){return b.current.openEvent?["click","mousedown"].includes(b.current.openEvent.type):!1}function W($){if(clearTimeout(s.current),y.current=!1,a&&!Nd(c.current)||i>0&&Nc(l.current,"open")===0)return;b.current.openEvent=$;const z=Nc(l.current,"open",c.current);z?s.current=setTimeout(()=>{g(!0)},z):g(!0)}function U($){if(L())return;P.current();const z=Hr(S);if(clearTimeout(v.current),d.current){clearTimeout(s.current),h.current=d.current({...e,tree:w,x:$.clientX,y:$.clientY,onClose(){D(),M(),R()}});const H=h.current;z.addEventListener("mousemove",H),P.current=()=>{z.removeEventListener("mousemove",H)};return}R()}function Y($){L()||d.current==null||d.current({...e,tree:w,x:$.clientX,y:$.clientY,onClose(){M(),R()}})($)}if(xn(O)){const $=O;return f&&$.addEventListener("mouseleave",Y),S==null||S.addEventListener("mouseleave",Y),u&&$.addEventListener("mousemove",W,{once:!0}),$.addEventListener("mouseenter",W),$.addEventListener("mouseleave",U),()=>{f&&$.removeEventListener("mouseleave",Y),S==null||S.removeEventListener("mouseleave",Y),u&&$.removeEventListener("mousemove",W),$.removeEventListener("mouseenter",W),$.removeEventListener("mouseleave",U)}}},[O,S,r,e,a,i,u,R,M,D,g,f,w,l,d,b]),Ut(()=>{var L;if(r&&f&&(L=d.current)!=null&&L.__options.blockPointerEvents&&N()){const Y=Hr(S).body;if(Y.setAttribute(sx,""),Y.style.pointerEvents="none",E.current=!0,xn(O)&&S){var W,U;const $=O,z=w==null||(W=w.nodesRef.current.find(H=>H.id===m))==null||(U=W.context)==null?void 0:U.elements.floating;return z&&(z.style.pointerEvents=""),$.style.pointerEvents="auto",S.style.pointerEvents="auto",()=>{$.style.pointerEvents="",S.style.pointerEvents=""}}}},[r,f,m,S,O,w,d,b,N]),Ut(()=>{f||(c.current=void 0,M(),D())},[f,M,D]),j.useEffect(()=>()=>{M(),clearTimeout(s.current),clearTimeout(v.current),D()},[r,M,D]),j.useMemo(()=>{if(!r)return{};function L(W){c.current=W.pointerType}return{reference:{onPointerDown:L,onPointerEnter:L,onMouseMove(){f||i===0||(clearTimeout(v.current),v.current=setTimeout(()=>{y.current||g(!0)},i))}},floating:{onMouseEnter(){clearTimeout(s.current)},onMouseLeave(){_.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),R(!1)}}}},[_,r,i,f,g,R])},pP=j.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),hP=()=>j.useContext(pP),M6=e=>{let{children:t,delay:r,timeoutMs:n=0}=e;const[o,a]=j.useReducer((f,g)=>({...f,...g}),{delay:r,timeoutMs:n,initialDelay:r,currentId:null,isInstantPhase:!1}),i=j.useRef(null),u=j.useCallback(f=>{a({currentId:f})},[]);return Ut(()=>{o.currentId?i.current===null?i.current=o.currentId:a({isInstantPhase:!0}):(a({isInstantPhase:!1}),i.current=null)},[o.currentId]),j.createElement(pP.Provider,{value:j.useMemo(()=>({...o,setState:a,setCurrentId:u}),[o,a,u])},t)},I6=(e,t)=>{let{open:r,onOpenChange:n}=e,{id:o}=t;const{currentId:a,setCurrentId:i,initialDelay:u,setState:f,timeoutMs:g}=hP();j.useEffect(()=>{a&&(f({delay:{open:1,close:Nc(u,"close")}}),a!==o&&n(!1))},[o,n,f,a,u]),j.useEffect(()=>{function b(){n(!1),f({delay:u,currentId:null})}if(!r&&a===o)if(g){const _=window.setTimeout(b,g);return()=>{clearTimeout(_)}}else b()},[r,f,a,o,n,u,g]),j.useEffect(()=>{r&&i(o)},[r,i,o])};function Ys(){return Ys=Object.assign||function(e){for(var t=1;te==null?void 0:e.focus({preventScroll:r});o?a():ux=requestAnimationFrame(a)}function D6(e,t){var r;let n=[],o=(r=e.find(a=>a.id===t))==null?void 0:r.parentId;for(;o;){const a=e.find(i=>i.id===o);o=a==null?void 0:a.parentId,a&&(n=n.concat(a))}return n}function ws(e,t){let r=e.filter(o=>{var a;return o.parentId===t&&((a=o.context)==null?void 0:a.open)})||[],n=r;for(;n.length;)n=e.filter(o=>{var a;return(a=n)==null?void 0:a.some(i=>{var u;return o.parentId===i.id&&((u=o.context)==null?void 0:u.open)})})||[],r=r.concat(n);return r}function Cf(e){return"composedPath"in e?e.composedPath()[0]:e.target}const L6="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function gP(e){return ti(e)&&e.matches(L6)}function mn(e){e.preventDefault(),e.stopPropagation()}const jd=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function mP(e,t){const r=Td(e,jd());t==="prev"&&r.reverse();const n=r.indexOf(ri(Hr(e)));return r.slice(n+1)[0]}function bP(){return mP(document.body,"next")}function vP(){return mP(document.body,"prev")}function xs(e,t){const r=t||e.currentTarget,n=e.relatedTarget;return!n||!Br(r,n)}function F6(e){Td(e,jd()).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function z6(e){e.querySelectorAll("[data-tabindex]").forEach(r=>{const n=r.dataset.tabindex;delete r.dataset.tabindex,n?r.setAttribute("tabindex",n):r.removeAttribute("tabindex")})}const B6=Yh["useInsertionEffect".toString()],V6=B6||(e=>e());function Sl(e){const t=j.useRef(()=>{});return V6(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o(Dh()&&a("button"),document.addEventListener("keydown",cx),()=>{document.removeEventListener("keydown",cx)}),[]),j.createElement("span",Ys({},t,{ref:r,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:$m,onFocus:i=>{Dh()&&fP()&&!U6(i)?(i.persist(),qm=window.setTimeout(()=>{n(i)},50)):n(i)}}))}),yP=j.createContext(null),wP=function(e){let{id:t,enabled:r=!0}=e===void 0?{}:e;const[n,o]=j.useState(null),a=Ks(),i=xP();return Ut(()=>{if(!r)return;const u=t?document.getElementById(t):null;if(u)u.setAttribute("data-floating-ui-portal",""),o(u);else{const f=document.createElement("div");t!==""&&(f.id=t||a),f.setAttribute("data-floating-ui-portal",""),o(f);const g=(i==null?void 0:i.portalNode)||document.body;return g.appendChild(f),()=>{g.removeChild(f)}}},[t,i,a,r]),n},W6=e=>{let{children:t,id:r,root:n=null,preserveTabOrder:o=!0}=e;const a=wP({id:r,enabled:!n}),[i,u]=j.useState(null),f=j.useRef(null),g=j.useRef(null),b=j.useRef(null),_=j.useRef(null),O=!!i&&!i.modal&&!!(n||a)&&o;return j.useEffect(()=>{if(!a||!o||i!=null&&i.modal)return;function S(C){a&&xs(C)&&(C.type==="focusin"?z6:F6)(a)}return a.addEventListener("focusin",S,!0),a.addEventListener("focusout",S,!0),()=>{a.removeEventListener("focusin",S,!0),a.removeEventListener("focusout",S,!0)}},[a,o,i==null?void 0:i.modal]),j.createElement(yP.Provider,{value:j.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:b,afterInsideRef:_,portalNode:a,setFocusManagerState:u}),[o,a])},O&&a&&j.createElement(Rd,{"data-type":"outside",ref:f,onFocus:S=>{if(xs(S,a)){var C;(C=b.current)==null||C.focus()}else{const w=vP()||(i==null?void 0:i.refs.domReference.current);w==null||w.focus()}}}),O&&a&&j.createElement("span",{"aria-owns":a.id,style:$m}),n?jo.createPortal(t,n):a?jo.createPortal(t,a):null,O&&a&&j.createElement(Rd,{"data-type":"outside",ref:g,onFocus:S=>{if(xs(S,a)){var C;(C=_.current)==null||C.focus()}else{const w=bP()||(i==null?void 0:i.refs.domReference.current);w==null||w.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1))}}}))},xP=()=>j.useContext(yP),H6=j.forwardRef(function(t,r){return j.createElement("button",Ys({},t,{type:"button",ref:r,tabIndex:-1,style:$m}))});function $6(e){let{context:t,children:r,order:n=["content"],guards:o=!0,initialFocus:a=0,returnFocus:i=!0,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:g=!0}=e;const{refs:b,nodeId:_,onOpenChange:O,events:S,dataRef:C,elements:{domReference:w,floating:m}}=t,d=_n(n),l=di(),c=xP(),[s,h]=j.useState(null),v=typeof a=="number"&&a<0,y=j.useRef(null),E=j.useRef(null),P=j.useRef(!1),N=j.useRef(null),R=j.useRef(!1),M=c!=null,D=w&&w.getAttribute("role")==="combobox"&&gP(w),L=j.useCallback(function($){return $===void 0&&($=m),$?Td($,jd()):[]},[m]),W=j.useCallback($=>{const z=L($);return d.current.map(H=>w&&H==="reference"?w:m&&H==="floating"?m:z).filter(Boolean).flat()},[w,m,d,L]);j.useEffect(()=>{if(!u)return;function $(H){if(H.key==="Tab"){L().length===0&&!D&&mn(H);const G=W(),X=Cf(H);d.current[0]==="reference"&&X===w&&(mn(H),H.shiftKey?Qo(G[G.length-1]):Qo(G[1])),d.current[1]==="floating"&&X===m&&H.shiftKey&&(mn(H),Qo(G[0]))}}const z=Hr(m);return z.addEventListener("keydown",$),()=>{z.removeEventListener("keydown",$)}},[w,m,u,d,b,D,L,W]),j.useEffect(()=>{if(!g)return;function $(){R.current=!0,setTimeout(()=>{R.current=!1})}function z(H){const G=H.relatedTarget,X=!(Br(w,G)||Br(m,G)||Br(G,m)||Br(c==null?void 0:c.portalNode,G)||G!=null&&G.hasAttribute("data-floating-ui-focus-guard")||l&&(ws(l.nodesRef.current,_).find(ie=>{var fe,pe;return Br((fe=ie.context)==null?void 0:fe.elements.floating,G)||Br((pe=ie.context)==null?void 0:pe.elements.domReference,G)})||D6(l.nodesRef.current,_).find(ie=>{var fe,pe;return((fe=ie.context)==null?void 0:fe.elements.floating)===G||((pe=ie.context)==null?void 0:pe.elements.domReference)===G})));G&&X&&!R.current&&G!==N.current&&(P.current=!0,setTimeout(()=>O(!1)))}if(m&&ti(w))return w.addEventListener("focusout",z),w.addEventListener("pointerdown",$),!u&&m.addEventListener("focusout",z),()=>{w.removeEventListener("focusout",z),w.removeEventListener("pointerdown",$),!u&&m.removeEventListener("focusout",z)}},[w,m,u,_,l,c,O,g]),j.useEffect(()=>{var $;const z=Array.from((c==null||($=c.portalNode)==null?void 0:$.querySelectorAll("[data-floating-ui-portal]"))||[]);function H(){return[y.current,E.current].filter(Boolean)}if(m&&u){const G=[m,...z,...H()],X=aF(d.current.includes("reference")||D?G.concat(w||[]):G);return()=>{X()}}},[w,m,u,d,c,D]),j.useEffect(()=>{if(u&&!o&&m){const $=[],z=jd(),H=Td(Hr(m).body,z),G=W(),X=H.filter(ie=>!G.includes(ie));return X.forEach((ie,fe)=>{$[fe]=ie.getAttribute("tabindex"),ie.setAttribute("tabindex","-1")}),()=>{X.forEach((ie,fe)=>{const pe=$[fe];pe==null?ie.removeAttribute("tabindex"):ie.setAttribute("tabindex",pe)})}}},[m,u,o,W]),Ut(()=>{if(!m)return;const $=Hr(m);let z=i,H=!1;const G=ri($),X=C.current;N.current=G;const ie=W(m),fe=(typeof a=="number"?ie[a]:a.current)||m;!v&&Qo(fe,{preventScroll:fe===m});function pe(oe){if(oe.type==="escapeKey"&&b.domReference.current&&(N.current=b.domReference.current),["referencePress","escapeKey"].includes(oe.type))return;const se=oe.data.returnFocus;typeof se=="object"?(z=!0,H=se.preventScroll):z=se}return S.on("dismiss",pe),()=>{if(S.off("dismiss",pe),Br(m,ri($))&&b.domReference.current&&(N.current=b.domReference.current),z&&ti(N.current)&&!P.current)if(!b.domReference.current||R.current)Qo(N.current,{cancelPrevious:!1,preventScroll:H});else{var oe;X.__syncReturnFocus=!0,(oe=N.current)==null||oe.focus({preventScroll:H}),setTimeout(()=>{delete X.__syncReturnFocus})}}},[m,W,a,i,C,b,S,v]),Ut(()=>{if(c)return c.setFocusManagerState({...t,modal:u,closeOnFocusOut:g}),()=>{c.setFocusManagerState(null)}},[c,u,g,t]),Ut(()=>{if(v||!m)return;function $(){h(L().length)}if($(),typeof MutationObserver=="function"){const z=new MutationObserver($);return z.observe(m,{childList:!0,subtree:!0}),()=>{z.disconnect()}}},[m,L,v,b]);const U=o&&(M||u)&&!D;function Y($){return f&&u?j.createElement(H6,{ref:$==="start"?y:E,onClick:()=>O(!1)},typeof f=="string"?f:"Dismiss"):null}return j.createElement(j.Fragment,null,U&&j.createElement(Rd,{"data-type":"inside",ref:c==null?void 0:c.beforeInsideRef,onFocus:$=>{if(u){const H=W();Qo(n[0]==="reference"?H[0]:H[H.length-1])}else if(c!=null&&c.preserveTabOrder&&c.portalNode)if(P.current=!1,xs($,c.portalNode)){const H=bP()||w;H==null||H.focus()}else{var z;(z=c.beforeOutsideRef.current)==null||z.focus()}}}),D?null:Y("start"),j.cloneElement(r,s===0||n.includes("floating")?{tabIndex:0}:{}),Y("end"),U&&j.createElement(Rd,{"data-type":"inside",ref:c==null?void 0:c.afterInsideRef,onFocus:$=>{if(u)Qo(W()[0]);else if(c!=null&&c.preserveTabOrder&&c.portalNode)if(P.current=!0,xs($,c.portalNode)){const H=vP()||w;H==null||H.focus()}else{var z;(z=c.afterOutsideRef.current)==null||z.focus()}}}))}const ec="data-floating-ui-scroll-lock",q6=j.forwardRef(function(t,r){let{lockScroll:n=!1,...o}=t;return Ut(()=>{var a,i;if(!n||document.body.hasAttribute(ec))return;document.body.setAttribute(ec,"");const g=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",b=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(Wm()))return Object.assign(document.body.style,{overflow:"hidden",[g]:b+"px"}),()=>{document.body.removeAttribute(ec),Object.assign(document.body.style,{overflow:"",[g]:""})};const _=((a=window.visualViewport)==null?void 0:a.offsetLeft)||0,O=((i=window.visualViewport)==null?void 0:i.offsetTop)||0,S=window.pageXOffset,C=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(C-Math.floor(O))+"px",left:-(S-Math.floor(_))+"px",right:"0",[g]:b+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[g]:""}),document.body.removeAttribute(ec),window.scrollTo(S,C)}},[n]),j.createElement("div",Ys({ref:r},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function dx(e){return ti(e.target)&&e.target.tagName==="BUTTON"}function fx(e){return gP(e)}const G6=function(e,t){let{open:r,onOpenChange:n,dataRef:o,elements:{domReference:a}}=e,{enabled:i=!0,event:u="click",toggle:f=!0,ignoreMouse:g=!1,keyboardHandlers:b=!0}=t===void 0?{}:t;const _=j.useRef();return j.useMemo(()=>i?{reference:{onPointerDown(O){_.current=O.pointerType},onMouseDown(O){O.button===0&&(Nd(_.current,!0)&&g||u!=="click"&&(r?f&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")&&n(!1):(O.preventDefault(),n(!0)),o.current.openEvent=O.nativeEvent))},onClick(O){if(!o.current.__syncReturnFocus){if(u==="mousedown"&&_.current){_.current=void 0;return}Nd(_.current,!0)&&g||(r?f&&(!o.current.openEvent||o.current.openEvent.type==="click")&&n(!1):n(!0),o.current.openEvent=O.nativeEvent)}},onKeyDown(O){_.current=void 0,b&&(dx(O)||(O.key===" "&&!fx(a)&&O.preventDefault(),O.key==="Enter"&&(r?f&&n(!1):n(!0))))},onKeyUp(O){b&&(dx(O)||fx(a)||O.key===" "&&(r?f&&n(!1):n(!0)))}}}:{},[i,o,u,g,b,a,f,r,n])};function jc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}const K6={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Y6={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Q6=function(e){var t,r;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(r=e.outsidePress)!=null?r:!0}},X6=function(e,t){let{open:r,onOpenChange:n,events:o,nodeId:a,elements:{reference:i,domReference:u,floating:f},dataRef:g}=e,{enabled:b=!0,escapeKey:_=!0,outsidePress:O=!0,outsidePressEvent:S="pointerdown",referencePress:C=!1,referencePressEvent:w="pointerdown",ancestorScroll:m=!1,bubbles:d=!0}=t===void 0?{}:t;const l=di(),c=Cl()!=null,s=Sl(typeof O=="function"?O:()=>!1),h=typeof O=="function"?s:O,v=j.useRef(!1),{escapeKeyBubbles:y,outsidePressBubbles:E}=Q6(d);return j.useEffect(()=>{if(!r||!b)return;g.current.__escapeKeyBubbles=y,g.current.__outsidePressBubbles=E;function P(L){if(L.key==="Escape"){const W=l?ws(l.nodesRef.current,a):[];if(W.length>0){let U=!0;if(W.forEach(Y=>{var $;if(($=Y.context)!=null&&$.open&&!Y.context.dataRef.current.__escapeKeyBubbles){U=!1;return}}),!U)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function N(L){const W=v.current;if(v.current=!1,W||typeof h=="function"&&!h(L))return;const U=Cf(L);if(ti(U)&&f){const z=f.ownerDocument.defaultView||window,H=U.scrollWidth>U.clientWidth,G=U.scrollHeight>U.clientHeight;let X=G&&L.offsetX>U.clientWidth;if(G&&z.getComputedStyle(U).direction==="rtl"&&(X=L.offsetX<=U.offsetWidth-U.clientWidth),X||H&&L.offsetY>U.clientHeight)return}const Y=l&&ws(l.nodesRef.current,a).some(z=>{var H;return jc(L,(H=z.context)==null?void 0:H.elements.floating)});if(jc(L,f)||jc(L,u)||Y)return;const $=l?ws(l.nodesRef.current,a):[];if($.length>0){let z=!0;if($.forEach(H=>{var G;if((G=H.context)!=null&&G.open&&!H.context.dataRef.current.__outsidePressBubbles){z=!1;return}}),!z)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:c?{preventScroll:!0}:cP(L)||dP(L)}}),n(!1)}function R(){n(!1)}const M=Hr(f);_&&M.addEventListener("keydown",P),h&&M.addEventListener(S,N);let D=[];return m&&(xn(u)&&(D=Oo(u)),xn(f)&&(D=D.concat(Oo(f))),!xn(i)&&i&&i.contextElement&&(D=D.concat(Oo(i.contextElement)))),D=D.filter(L=>{var W;return L!==((W=M.defaultView)==null?void 0:W.visualViewport)}),D.forEach(L=>{L.addEventListener("scroll",R,{passive:!0})}),()=>{_&&M.removeEventListener("keydown",P),h&&M.removeEventListener(S,N),D.forEach(L=>{L.removeEventListener("scroll",R)})}},[g,f,u,i,_,h,S,o,l,a,r,n,m,b,y,E,c]),j.useEffect(()=>{v.current=!1},[h,S]),j.useMemo(()=>b?{reference:{[K6[w]]:()=>{C&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[Y6[S]]:()=>{v.current=!0}}}:{},[b,o,C,S,w,n])},J6=function(e,t){let{open:r,onOpenChange:n,dataRef:o,events:a,refs:i,elements:{floating:u,domReference:f}}=e,{enabled:g=!0,keyboardOnly:b=!0}=t===void 0?{}:t;const _=j.useRef(""),O=j.useRef(!1),S=j.useRef();return j.useEffect(()=>{if(!g)return;const w=Hr(u).defaultView||window;function m(){!r&&ti(f)&&f===ri(Hr(f))&&(O.current=!0)}return w.addEventListener("blur",m),()=>{w.removeEventListener("blur",m)}},[u,f,r,g]),j.useEffect(()=>{if(!g)return;function C(w){(w.type==="referencePress"||w.type==="escapeKey")&&(O.current=!0)}return a.on("dismiss",C),()=>{a.off("dismiss",C)}},[a,g]),j.useEffect(()=>()=>{clearTimeout(S.current)},[]),j.useMemo(()=>g?{reference:{onPointerDown(C){let{pointerType:w}=C;_.current=w,O.current=!!(w&&b)},onMouseLeave(){O.current=!1},onFocus(C){var w;O.current||C.type==="focus"&&((w=o.current.openEvent)==null?void 0:w.type)==="mousedown"&&o.current.openEvent&&jc(o.current.openEvent,f)||(o.current.openEvent=C.nativeEvent,n(!0))},onBlur(C){O.current=!1;const w=C.relatedTarget,m=xn(w)&&w.hasAttribute("data-floating-ui-focus-guard")&&w.getAttribute("data-type")==="outside";S.current=setTimeout(()=>{Br(i.floating.current,w)||Br(f,w)||m||n(!1)})}}}:{},[g,b,f,i,o,n])};let px=!1;const Gm="ArrowUp",Sf="ArrowDown",cl="ArrowLeft",fu="ArrowRight";function tc(e,t,r){return Math.floor(e/t)!==r}function Jl(e,t){return t<0||t>=e.current.length}function Or(e,t){let{startingIndex:r=-1,decrement:n=!1,disabledIndices:o,amount:a=1}=t===void 0?{}:t;const i=e.current;let u=r;do{var f,g;u=u+(n?-a:a)}while(u>=0&&u<=i.length-1&&(o?o.includes(u):i[u]==null||(f=i[u])!=null&&f.hasAttribute("disabled")||((g=i[u])==null?void 0:g.getAttribute("aria-disabled"))==="true"));return u}function Tf(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function hx(e,t){return Tf(t,e===Gm||e===Sf,e===cl||e===fu)}function e0(e,t,r){return Tf(t,e===Sf,r?e===cl:e===fu)||e==="Enter"||e==" "||e===""}function Z6(e,t,r){return Tf(t,r?e===cl:e===fu,e===Sf)}function ez(e,t,r){return Tf(t,r?e===fu:e===cl,e===Gm)}function t0(e,t){return Or(e,{disabledIndices:t})}function gx(e,t){return Or(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const tz=function(e,t){let{open:r,onOpenChange:n,refs:o,elements:{domReference:a}}=e,{listRef:i,activeIndex:u,onNavigate:f=()=>{},enabled:g=!0,selectedIndex:b=null,allowEscape:_=!1,loop:O=!1,nested:S=!1,rtl:C=!1,virtual:w=!1,focusItemOnOpen:m="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:l=!0,disabledIndices:c=void 0,orientation:s="vertical",cols:h=1,scrollItemIntoView:v=!0}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;const y=Cl(),E=di(),P=Sl(f),N=j.useRef(m),R=j.useRef(b??-1),M=j.useRef(null),D=j.useRef(!0),L=j.useRef(P),W=j.useRef(r),U=j.useRef(!1),Y=j.useRef(!1),$=_n(c),z=_n(r),H=_n(v),[G,X]=j.useState(),ie=j.useCallback(function(oe,se,ee){ee===void 0&&(ee=!1);const ae=oe.current[se.current];w?X(ae==null?void 0:ae.id):Qo(ae,{preventScroll:!0,sync:fP()&&Dh()?px||U.current:!1}),requestAnimationFrame(()=>{const ue=H.current;ue&&ae&&(ee||!D.current)&&(ae.scrollIntoView==null||ae.scrollIntoView(typeof ue=="boolean"?{block:"nearest",inline:"nearest"}:ue))})},[w,H]);Ut(()=>{document.createElement("div").focus({get preventScroll(){return px=!0,!1}})},[]),Ut(()=>{g&&(r?N.current&&b!=null&&(Y.current=!0,P(b)):W.current&&(R.current=-1,L.current(null)))},[g,r,b,P]),Ut(()=>{if(g&&r)if(u==null){if(U.current=!1,b!=null)return;W.current&&(R.current=-1,ie(i,R)),!W.current&&N.current&&(M.current!=null||N.current===!0&&M.current==null)&&(R.current=M.current==null||e0(M.current,s,C)||S?t0(i,$.current):gx(i,$.current),P(R.current))}else Jl(i,u)||(R.current=u,ie(i,R,Y.current),Y.current=!1)},[g,r,u,b,S,i,s,C,P,ie,$]),Ut(()=>{if(g&&W.current&&!r){var oe,se;const ee=E==null||(oe=E.nodesRef.current.find(ae=>ae.id===y))==null||(se=oe.context)==null?void 0:se.elements.floating;ee&&!Br(ee,ri(Hr(ee)))&&ee.focus({preventScroll:!0})}},[g,r,E,y]),Ut(()=>{M.current=null,L.current=P,W.current=r});const fe=u!=null,pe=j.useMemo(()=>{function oe(ee){if(!r)return;const ae=i.current.indexOf(ee);ae!==-1&&P(ae)}return{onFocus(ee){let{currentTarget:ae}=ee;oe(ae)},onClick:ee=>{let{currentTarget:ae}=ee;return ae.focus({preventScroll:!0})},...d&&{onMouseMove(ee){let{currentTarget:ae}=ee;oe(ae)},onPointerLeave(){if(D.current&&(R.current=-1,ie(i,R),jo.flushSync(()=>P(null)),!w)){var ee;(ee=o.floating.current)==null||ee.focus({preventScroll:!0})}}}}},[r,o,ie,d,i,P,w]);return j.useMemo(()=>{if(!g)return{};const oe=$.current;function se(de){if(D.current=!1,U.current=!0,!z.current&&de.currentTarget===o.floating.current)return;if(S&&ez(de.key,s,C)){mn(de),n(!1),ti(a)&&a.focus();return}const Te=R.current,xe=t0(i,oe),be=gx(i,oe);if(de.key==="Home"&&(R.current=xe,P(R.current)),de.key==="End"&&(R.current=be,P(R.current)),h>1){const Se=R.current;if(de.key===Gm){if(mn(de),Se===-1)R.current=be;else if(R.current=Or(i,{startingIndex:Se,amount:h,decrement:!0,disabledIndices:oe}),O&&(Se-hje?nt:nt-h}Jl(i,R.current)&&(R.current=Se),P(R.current)}if(de.key===Sf&&(mn(de),Se===-1?R.current=xe:(R.current=Or(i,{startingIndex:Se,amount:h,disabledIndices:oe}),O&&Se+h>be&&(R.current=Or(i,{startingIndex:Se%h-h,amount:h,disabledIndices:oe}))),Jl(i,R.current)&&(R.current=Se),P(R.current)),s==="both"){const je=Math.floor(Se/h);de.key===fu&&(mn(de),Se%h!==h-1?(R.current=Or(i,{startingIndex:Se,disabledIndices:oe}),O&&tc(R.current,h,je)&&(R.current=Or(i,{startingIndex:Se-Se%h-1,disabledIndices:oe}))):O&&(R.current=Or(i,{startingIndex:Se-Se%h-1,disabledIndices:oe})),tc(R.current,h,je)&&(R.current=Se)),de.key===cl&&(mn(de),Se%h!==0?(R.current=Or(i,{startingIndex:Se,disabledIndices:oe,decrement:!0}),O&&tc(R.current,h,je)&&(R.current=Or(i,{startingIndex:Se+(h-Se%h),decrement:!0,disabledIndices:oe}))):O&&(R.current=Or(i,{startingIndex:Se+(h-Se%h),decrement:!0,disabledIndices:oe})),tc(R.current,h,je)&&(R.current=Se));const qe=Math.floor(be/h)===je;Jl(i,R.current)&&(O&&qe?R.current=de.key===cl?be:Or(i,{startingIndex:Se-Se%h-1,disabledIndices:oe}):R.current=Se),P(R.current);return}}if(hx(de.key,s)){if(mn(de),r&&!w&&ri(de.currentTarget.ownerDocument)===de.currentTarget){R.current=e0(de.key,s,C)?xe:be,P(R.current);return}e0(de.key,s,C)?O?R.current=Te>=be?_&&Te!==i.current.length?-1:xe:Or(i,{startingIndex:Te,disabledIndices:oe}):R.current=Math.min(be,Or(i,{startingIndex:Te,disabledIndices:oe})):O?R.current=Te<=xe?_&&Te!==-1?i.current.length:be:Or(i,{startingIndex:Te,decrement:!0,disabledIndices:oe}):R.current=Math.max(xe,Or(i,{startingIndex:Te,decrement:!0,disabledIndices:oe})),Jl(i,R.current)?P(null):P(R.current)}}function ee(de){m==="auto"&&cP(de.nativeEvent)&&(N.current=!0)}function ae(de){N.current=m,m==="auto"&&dP(de.nativeEvent)&&(N.current=!0)}const ue=w&&r&&fe&&{"aria-activedescendant":G};return{reference:{...ue,onKeyDown(de){D.current=!1;const Te=de.key.indexOf("Arrow")===0;if(w&&r)return se(de);if(!r&&!l&&Te)return;if((Te||de.key==="Enter"||de.key===" "||de.key==="")&&(M.current=de.key),S){Z6(de.key,s,C)&&(mn(de),r?(R.current=t0(i,oe),P(R.current)):n(!0));return}hx(de.key,s)&&(b!=null&&(R.current=b),mn(de),!r&&l?n(!0):se(de),r&&P(R.current))},onFocus(){r&&P(null)},onPointerDown:ae,onMouseDown:ee,onClick:ee},floating:{"aria-orientation":s==="both"?void 0:s,...ue,onKeyDown:se,onPointerMove(){D.current=!0}},item:pe}},[a,o,G,$,z,i,g,s,C,w,r,fe,S,b,l,_,h,O,m,P,n,pe])};function rz(e){return j.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})},e)}const nz=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const a=Ks(),i=Ks();return j.useMemo(()=>{const u={id:a,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?a:void 0},floating:u}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":r?a:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:i}},floating:{...u,...o==="menu"&&{"aria-labelledby":i}}}:{}},[n,o,r,a,i])},mx=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,r)=>(r?"-":"")+t.toLowerCase());function oz(e,t){const[r,n]=j.useState(e);return e&&!r&&n(!0),j.useEffect(()=>{if(!e){const o=setTimeout(()=>n(!1),t);return()=>clearTimeout(o)}},[e,t]),r}function _P(e,t){let{open:r,elements:{floating:n}}=e,{duration:o=250}=t===void 0?{}:t;const i=(typeof o=="number"?o:o.close)||0,[u,f]=j.useState(!1),[g,b]=j.useState("unmounted"),_=oz(r,i);return Ut(()=>{u&&!_&&b("unmounted")},[u,_]),Ut(()=>{if(n)if(r){b("initial");const O=requestAnimationFrame(()=>{b("open")});return()=>{cancelAnimationFrame(O)}}else f(!0),b("close")},[r,n]),{isMounted:_,status:g}}function az(e,t){let{initial:r={opacity:0},open:n,close:o,common:a,duration:i=250}=t===void 0?{}:t;const u=e.placement,f=u.split("-")[0],[g,b]=j.useState({}),{isMounted:_,status:O}=_P(e,{duration:i}),S=_n(r),C=_n(n),w=_n(o),m=_n(a),d=typeof i=="number",l=(d?i:i.open)||0,c=(d?i:i.close)||0;return Ut(()=>{const s={side:f,placement:u},h=S.current,v=w.current,y=C.current,E=m.current,P=typeof h=="function"?h(s):h,N=typeof v=="function"?v(s):v,R=typeof E=="function"?E(s):E,M=(typeof y=="function"?y(s):y)||Object.keys(P).reduce((D,L)=>(D[L]="",D),{});if(O==="initial"&&b(D=>({transitionProperty:D.transitionProperty,...R,...P})),O==="open"&&b({transitionProperty:Object.keys(M).map(mx).join(","),transitionDuration:l+"ms",...R,...M}),O==="close"){const D=N||P;b({transitionProperty:Object.keys(D).map(mx).join(","),transitionDuration:c+"ms",...R,...D})}},[f,u,c,w,S,C,m,l,O]),{isMounted:_,styles:g}}const iz=function(e,t){var r;let{open:n,dataRef:o}=e,{listRef:a,activeIndex:i,onMatch:u=()=>{},enabled:f=!0,findMatch:g=null,resetMs:b=1e3,ignoreKeys:_=[],selectedIndex:O=null}=t===void 0?{listRef:{current:[]},activeIndex:null}:t;const S=j.useRef(),C=j.useRef(""),w=j.useRef((r=O??i)!=null?r:-1),m=j.useRef(null),d=Sl(u),l=_n(g),c=_n(_);return Ut(()=>{n&&(clearTimeout(S.current),m.current=null,C.current="")},[n]),Ut(()=>{if(n&&C.current===""){var s;w.current=(s=O??i)!=null?s:-1}},[n,O,i]),j.useMemo(()=>{if(!f)return{};function s(h){const v=Cf(h.nativeEvent);if(xn(v)&&(ri(Hr(v))!==h.currentTarget&&v.closest('[role="dialog"],[role="menu"],[role="listbox"],[role="tree"],[role="grid"]')!==h.currentTarget))return;C.current.length>0&&C.current[0]!==" "&&(o.current.typing=!0,h.key===" "&&mn(h));const y=a.current;if(y==null||c.current.includes(h.key)||h.key.length!==1||h.ctrlKey||h.metaKey||h.altKey)return;y.every(D=>{var L,W;return D?((L=D[0])==null?void 0:L.toLocaleLowerCase())!==((W=D[1])==null?void 0:W.toLocaleLowerCase()):!0})&&C.current===h.key&&(C.current="",w.current=m.current),C.current+=h.key,clearTimeout(S.current),S.current=setTimeout(()=>{C.current="",w.current=m.current,o.current.typing=!1},b);const P=w.current,N=[...y.slice((P||0)+1),...y.slice(0,(P||0)+1)],R=l.current?l.current(N,C.current):N.find(D=>(D==null?void 0:D.toLocaleLowerCase().indexOf(C.current.toLocaleLowerCase()))===0),M=R?y.indexOf(R):-1;M!==-1&&(d(M),m.current=M)}return{reference:{onKeyDown:s},floating:{onKeyDown:s}}},[f,o,a,b,c,l,d])};function bx(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const lz=e=>({name:"inner",options:e,async fn(t){const{listRef:r,overflowRef:n,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:u=4,referenceOverflowThreshold:f=0,scrollRef:g,...b}=e,{rects:_,elements:{floating:O}}=t,S=r.current[i];if(!S)return{};const C={...t,...await oP(-S.offsetTop-_.reference.height/2-S.offsetHeight/2-a).fn(t)},w=(g==null?void 0:g.current)||O,m=await kc(bx(C,w.scrollHeight),b),d=await kc(C,{...b,elementContext:"reference"}),l=Math.max(0,m.top),c=C.y+l,s=Math.max(0,w.scrollHeight-l-Math.max(0,m.bottom));return w.style.maxHeight=s+"px",w.scrollTop=l,o&&(w.offsetHeight=-f||d.bottom>=-f?jo.flushSync(()=>o(!0)):jo.flushSync(()=>o(!1))),n&&(n.current=await kc(bx({...C,y:c},w.offsetHeight),b)),{y:c}}}),sz=(e,t)=>{let{open:r,elements:n}=e,{enabled:o=!0,overflowRef:a,scrollRef:i,onChange:u}=t;const f=Sl(u),g=j.useRef(!1),b=j.useRef(null),_=j.useRef(null);return j.useEffect(()=>{if(!o)return;function O(C){if(C.ctrlKey||!S||a.current==null)return;const w=C.deltaY,m=a.current.top>=-.5,d=a.current.bottom>=-.5,l=S.scrollHeight-S.clientHeight,c=w<0?-1:1,s=w<0?"max":"min";S.scrollHeight<=S.clientHeight||(!m&&w>0||!d&&w<0?(C.preventDefault(),jo.flushSync(()=>{f(h=>h+Math[s](w,l*c))})):/firefox/i.test(uP())&&(S.scrollTop+=w))}const S=(i==null?void 0:i.current)||n.floating;if(r&&S)return S.addEventListener("wheel",O),requestAnimationFrame(()=>{b.current=S.scrollTop,a.current!=null&&(_.current={...a.current})}),()=>{b.current=null,_.current=null,S.removeEventListener("wheel",O)}},[o,r,n.floating,a,i,f]),j.useMemo(()=>o?{floating:{onKeyDown(){g.current=!0},onWheel(){g.current=!1},onPointerMove(){g.current=!1},onScroll(){const O=(i==null?void 0:i.current)||n.floating;if(!(!a.current||!O||!g.current)){if(b.current!==null){const S=O.scrollTop-b.current;(a.current.bottom<-.5&&S<-1||a.current.top<-.5&&S>1)&&jo.flushSync(()=>f(C=>C+S))}requestAnimationFrame(()=>{b.current=O.scrollTop})}}}}:{},[o,a,n.floating,i,f])};function uz(e,t){const[r,n]=e;let o=!1;const a=t.length;for(let i=0,u=a-1;i=n!=_>=n&&r<=(b-f)*(n-g)/(_-g)+f&&(o=!o)}return o}function cz(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function dz(e){let{restMs:t=0,buffer:r=.5,blockPointerEvents:n=!1}=e===void 0?{}:e,o,a=!1,i=!1;const u=f=>{let{x:g,y:b,placement:_,elements:O,onClose:S,nodeId:C,tree:w}=f;return function(d){function l(){clearTimeout(o),S()}if(clearTimeout(o),!O.domReference||!O.floating||_==null||g==null||b==null)return;const{clientX:c,clientY:s}=d,h=[c,s],v=Cf(d),y=d.type==="mouseleave",E=Br(O.floating,v),P=Br(O.domReference,v),N=O.domReference.getBoundingClientRect(),R=O.floating.getBoundingClientRect(),M=_.split("-")[0],D=g>R.right-R.width/2,L=b>R.bottom-R.height/2,W=cz(h,N);if(E&&(i=!0),P&&(i=!1),P&&!y){i=!0;return}if(y&&xn(d.relatedTarget)&&Br(O.floating,d.relatedTarget)||w&&ws(w.nodesRef.current,C).some(z=>{let{context:H}=z;return H==null?void 0:H.open}))return;if(M==="top"&&b>=N.bottom-1||M==="bottom"&&b<=N.top+1||M==="left"&&g>=N.right-1||M==="right"&&g<=N.left+1)return l();let U=[];switch(M){case"top":U=[[R.left,N.top+1],[R.left,R.bottom-1],[R.right,R.bottom-1],[R.right,N.top+1]],a=c>=R.left&&c<=R.right&&s>=R.top&&s<=N.top+1;break;case"bottom":U=[[R.left,R.top+1],[R.left,N.bottom-1],[R.right,N.bottom-1],[R.right,R.top+1]],a=c>=R.left&&c<=R.right&&s>=N.bottom-1&&s<=R.bottom;break;case"left":U=[[R.right-1,R.bottom],[R.right-1,R.top],[N.left+1,R.top],[N.left+1,R.bottom]],a=c>=R.left&&c<=N.left+1&&s>=R.top&&s<=R.bottom;break;case"right":U=[[N.right-1,R.bottom],[N.right-1,R.top],[R.left+1,R.top],[R.left+1,R.bottom]],a=c>=N.right-1&&c<=R.right&&s>=R.top&&s<=R.bottom;break}function Y(z){let[H,G]=z;const X=R.width>N.width,ie=R.height>N.height;switch(M){case"top":{const fe=[X?H+r/2:D?H+r*4:H-r*4,G+r+1],pe=[X?H-r/2:D?H+r*4:H-r*4,G+r+1],oe=[[R.left,D||X?R.bottom-r:R.top],[R.right,D?X?R.bottom-r:R.top:R.bottom-r]];return[fe,pe,...oe]}case"bottom":{const fe=[X?H+r/2:D?H+r*4:H-r*4,G-r],pe=[X?H-r/2:D?H+r*4:H-r*4,G-r],oe=[[R.left,D||X?R.top+r:R.bottom],[R.right,D?X?R.top+r:R.bottom:R.top+r]];return[fe,pe,...oe]}case"left":{const fe=[H+r+1,ie?G+r/2:L?G+r*4:G-r*4],pe=[H+r+1,ie?G-r/2:L?G+r*4:G-r*4];return[...[[L||ie?R.right-r:R.left,R.top],[L?ie?R.right-r:R.left:R.right-r,R.bottom]],fe,pe]}case"right":{const fe=[H-r,ie?G+r/2:L?G+r*4:G-r*4],pe=[H-r,ie?G-r/2:L?G+r*4:G-r*4],oe=[[L||ie?R.left+r:R.right,R.top],[L?ie?R.left+r:R.right:R.left+r,R.bottom]];return[fe,pe,...oe]}}}const $=a?U:Y([g,b]);if(!a){if(i&&!W)return l();uz([c,s],$)?t&&!i&&(o=setTimeout(l,t)):l()}}};return u.__options={blockPointerEvents:n},u}function fz(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=T6(e),a=di(),i=j.useRef(null),u=j.useRef({}),f=j.useState(()=>iP())[0],[g,b]=j.useState(null),_=j.useCallback(d=>{const l=xn(d)?{getBoundingClientRect:()=>d.getBoundingClientRect(),contextElement:d}:d;o.refs.setReference(l)},[o.refs]),O=j.useCallback(d=>{(xn(d)||d===null)&&(i.current=d,b(d)),(xn(o.refs.reference.current)||o.refs.reference.current===null||d!==null&&!xn(d))&&o.refs.setReference(d)},[o.refs]),S=j.useMemo(()=>({...o.refs,setReference:O,setPositionReference:_,domReference:i}),[o.refs,O,_]),C=j.useMemo(()=>({...o.elements,domReference:g}),[o.elements,g]),w=Sl(r),m=j.useMemo(()=>({...o,refs:S,elements:C,dataRef:u,nodeId:n,events:f,open:t,onOpenChange:w}),[o,n,f,t,w,S,C]);return Ut(()=>{const d=a==null?void 0:a.nodesRef.current.find(l=>l.id===n);d&&(d.context=m)}),j.useMemo(()=>({...o,context:m,refs:S,reference:O,positionReference:_}),[o,S,m,O,_])}function r0(e,t,r){const n=new Map;return{...r==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[r]:null).concat(e).reduce((o,a)=>(a&&Object.entries(a).forEach(i=>{let[u,f]=i;if(u.indexOf("on")===0){if(n.has(u)||n.set(u,[]),typeof f=="function"){var g;(g=n.get(u))==null||g.push(f),o[u]=function(){for(var b,_=arguments.length,O=new Array(_),S=0;S<_;S++)O[S]=arguments[S];(b=n.get(u))==null||b.forEach(C=>C(...O))}}}else o[u]=f}),o),{})}}const pz=function(e){e===void 0&&(e=[]);const t=e,r=j.useCallback(a=>r0(a,e,"reference"),t),n=j.useCallback(a=>r0(a,e,"floating"),t),o=j.useCallback(a=>r0(a,e,"item"),e.map(a=>a==null?void 0:a.item));return j.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])},hz=Object.freeze(Object.defineProperty({__proto__:null,FloatingDelayGroup:M6,FloatingFocusManager:$6,FloatingNode:N6,FloatingOverlay:q6,FloatingPortal:W6,FloatingTree:j6,arrow:S6,autoPlacement:b6,autoUpdate:m6,computePosition:aP,detectOverflow:kc,flip:y6,getOverflowAncestors:Oo,hide:x6,inline:_6,inner:lz,limitShift:C6,offset:oP,platform:rP,safePolygon:dz,shift:v6,size:w6,useClick:G6,useDelayGroup:I6,useDelayGroupContext:hP,useDismiss:X6,useFloating:fz,useFloatingNodeId:E6,useFloatingParentNodeId:Cl,useFloatingPortalNode:wP,useFloatingTree:di,useFocus:J6,useHover:A6,useId:Ks,useInnerOffset:sz,useInteractions:pz,useListNavigation:tz,useMergeRefs:rz,useRole:nz,useTransitionStatus:_P,useTransitionStyles:az,useTypeahead:iz},Symbol.toStringTag,{value:"Module"})),ur=Qs(hz);var CP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,w){for(var m in w)Object.defineProperty(C,m,{enumerable:!0,get:w[m]})}t(e,{DialogHeader:function(){return O},default:function(){return S}});var r=g(j),n=g(Xe),o=He,a=g(Be),i=ze,u=yl;function f(){return f=Object.assign||function(C){for(var w=1;w=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function _(C,w){if(C==null)return{};var m={},d=Object.keys(C),l,c;for(c=0;c=0)&&(m[l]=C[l]);return m}var O=r.default.forwardRef(function(C,w){var m=C.className,d=C.children,l=b(C,["className","children"]),c=(0,i.useTheme)().dialogHeader,s=c.defaultProps,h=c.styles.base;m=m??s.className;var v=(0,o.twMerge)((0,n.default)((0,a.default)(h)),m);return r.default.createElement("div",f({},l,{ref:w,className:v}),d)});O.propTypes={className:u.propTypesClassName,children:u.propTypesChildren},O.displayName="MaterialTailwind.DialogHeader";var S=O})(CP);var SP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(w,m){for(var d in m)Object.defineProperty(w,d,{enumerable:!0,get:m[d]})}t(e,{DialogBody:function(){return S},default:function(){return C}});var r=b(j),n=b(Xe),o=He,a=b(Be),i=ze,u=yl;function f(w,m,d){return m in w?Object.defineProperty(w,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):w[m]=d,w}function g(){return g=Object.assign||function(w){for(var m=1;m=0)&&Object.prototype.propertyIsEnumerable.call(w,l)&&(d[l]=w[l])}return d}function O(w,m){if(w==null)return{};var d={},l=Object.keys(w),c,s;for(s=0;s=0)&&(d[c]=w[c]);return d}var S=r.default.forwardRef(function(w,m){var d=w.divider,l=w.className,c=w.children,s=_(w,["divider","className","children"]),h=(0,i.useTheme)().dialogBody,v=h.defaultProps,y=h.styles.base;l=l??v.className;var E=(0,o.twMerge)((0,n.default)((0,a.default)(y.initial),f({},(0,a.default)(y.divider),d)),l);return r.default.createElement("div",g({},s,{ref:m,className:E}),c)});S.propTypes={divider:u.propTypesDivider,className:u.propTypesClassName,children:u.propTypesChildren},S.displayName="MaterialTailwind.DialogBody";var C=S})(SP);var TP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,w){for(var m in w)Object.defineProperty(C,m,{enumerable:!0,get:w[m]})}t(e,{DialogFooter:function(){return O},default:function(){return S}});var r=g(j),n=g(Xe),o=He,a=g(Be),i=ze,u=yl;function f(){return f=Object.assign||function(C){for(var w=1;w=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function _(C,w){if(C==null)return{};var m={},d=Object.keys(C),l,c;for(c=0;c=0)&&(m[l]=C[l]);return m}var O=r.default.forwardRef(function(C,w){var m=C.className,d=C.children,l=b(C,["className","children"]),c=(0,i.useTheme)().dialogFooter,s=c.defaultProps,h=c.styles.base;m=m??s.className;var v=(0,o.twMerge)((0,n.default)((0,a.default)(h)),m);return r.default.createElement("div",f({},l,{ref:w,className:v}),d)});O.propTypes={className:u.propTypesClassName,children:u.propTypesChildren},O.displayName="MaterialTailwind.DialogFooter";var S=O})(TP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(N,R){for(var M in R)Object.defineProperty(N,M,{enumerable:!0,get:R[M]})}t(e,{Dialog:function(){return E},DialogHeader:function(){return S.DialogHeader},DialogBody:function(){return C.DialogBody},DialogFooter:function(){return w.DialogFooter},default:function(){return P}});var r=l(j),n=l($e),o=ur,a=gr,i=l(Xe),u=l(yr),f=He,g=l(zt),b=l(Be),_=ze,O=yl,S=CP,C=SP,w=TP;function m(N,R,M){return R in N?Object.defineProperty(N,R,{value:M,enumerable:!0,configurable:!0,writable:!0}):N[R]=M,N}function d(){return d=Object.assign||function(N){for(var R=1;R=0)&&Object.prototype.propertyIsEnumerable.call(N,D)&&(M[D]=N[D])}return M}function y(N,R){if(N==null)return{};var M={},D=Object.keys(N),L,W;for(W=0;W=0)&&(M[L]=N[L]);return M}var E=r.default.forwardRef(function(N,R){var M=N.open,D=N.handler,L=N.size,W=N.dismiss,U=N.animate,Y=N.className,$=N.children,z=v(N,["open","handler","size","dismiss","animate","className","children"]),H=(0,_.useTheme)().dialog,G=H.defaultProps,X=H.valid,ie=H.styles,fe=ie.base,pe=ie.sizes;D=D??void 0,L=L??G.size,W=W??G.dismiss,U=U??G.animate,Y=Y??G.className;var oe=(0,i.default)((0,b.default)(fe.backdrop)),se=(0,f.twMerge)((0,i.default)((0,b.default)(fe.container),(0,b.default)(pe[(0,g.default)(X.sizes,L,"md")])),Y),ee={unmount:{opacity:0,y:-50,transition:{duration:.3}},mount:{opacity:1,y:0,transition:{duration:.3}}},ae={unmount:{opacity:0,transition:{delay:.2}},mount:{opacity:1}},ue=(0,u.default)(ee,U),de=(0,o.useFloating)({open:M,onOpenChange:D}),Te=de.floating,xe=de.context,be=(0,o.useId)(),Se="".concat(be,"-label"),je="".concat(be,"-description"),qe=(0,o.useInteractions)([(0,o.useClick)(xe),(0,o.useRole)(xe),(0,o.useDismiss)(xe,W)]).getFloatingProps,nt=(0,o.useMergeRefs)([R,Te]),ut=a.AnimatePresence;return r.default.createElement(a.LazyMotion,{features:a.domAnimation},r.default.createElement(o.FloatingPortal,null,r.default.createElement(ut,null,M&&r.default.createElement(o.FloatingOverlay,{style:{zIndex:9999},lockScroll:!0},r.default.createElement(o.FloatingFocusManager,{context:xe},r.default.createElement(a.m.div,{className:L==="xxl"?"":oe,initial:"unmount",exit:"unmount",animate:M?"mount":"unmount",variants:ae,transition:{duration:.2}},r.default.createElement(a.m.div,d({},qe(h(c({},z),{ref:nt,className:se,"aria-labelledby":Se,"aria-describedby":je})),{initial:"unmount",exit:"unmount",animate:M?"mount":"unmount",variants:ue}),$)))))))});E.propTypes={open:O.propTypesOpen,handler:O.propTypesHandler,size:n.default.oneOf(O.propTypesSize),dismiss:O.propTypesDismiss,animate:O.propTypesAnimate,className:O.propTypesClassName,children:O.propTypesChildren},E.displayName="MaterialTailwind.Dialog";var P=Object.assign(E,{Header:S.DialogHeader,Body:C.DialogBody,Footer:w.DialogFooter})})(zO);var OP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{Input:function(){return C},default:function(){return w}});var r=_(j),n=_($e),o=_(Xe),a=_(zt),i=_(Be),u=ze,f=nu;function g(m,d,l){return d in m?Object.defineProperty(m,d,{value:l,enumerable:!0,configurable:!0,writable:!0}):m[d]=l,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,c)&&(l[c]=m[c])}return l}function S(m,d){if(m==null)return{};var l={},c=Object.keys(m),s,h;for(h=0;h=0)&&(l[s]=m[s]);return l}var C=r.default.forwardRef(function(m,d){var l=m.variant,c=m.color,s=m.size,h=m.label,v=m.error,y=m.success,E=m.icon,P=m.containerProps,N=m.labelProps,R=m.className,M=m.shrink,D=m.inputRef,L=O(m,["variant","color","size","label","error","success","icon","containerProps","labelProps","className","shrink","inputRef"]),W=(0,u.useTheme)().input,U=W.defaultProps,Y=W.valid,$=W.styles,z=$.base,H=$.variants;l=l??U.variant,s=s??U.size,c=c??U.color,h=h??U.label,N=N??U.labelProps,P=P??U.containerProps,R=R??U.className,M=M??U.shrink,E=E??U.icon;var G=H[(0,a.default)(Y.variants,l,"outlined")],X=G.sizes[(0,a.default)(Y.sizes,s,"md")],ie=(0,i.default)(G.error.input),fe=(0,i.default)(G.success.input),pe=(0,i.default)(G.shrink.input),oe=(0,i.default)(G.colors.input[(0,a.default)(Y.colors,c,"gray")]),se=(0,i.default)(G.error.label),ee=(0,i.default)(G.success.label),ae=(0,i.default)(G.shrink.label),ue=(0,i.default)(G.colors.label[(0,a.default)(Y.colors,c,"gray")]),de=(0,o.default)((0,i.default)(z.container),(0,i.default)(X.container),P==null?void 0:P.className),Te=(0,o.default)((0,i.default)(z.input),(0,i.default)(G.base.input),(0,i.default)(X.input),g({},(0,i.default)(G.base.inputWithIcon),E),g({},oe,!v&&!y),g({},ie,v),g({},fe,y),g({},pe,M),R),xe=(0,o.default)((0,i.default)(z.label),(0,i.default)(G.base.label),(0,i.default)(X.label),g({},ue,!v&&!y),g({},se,v),g({},ee,y),g({},ae,M),N==null?void 0:N.className),be=(0,o.default)((0,i.default)(z.icon),(0,i.default)(G.base.icon),(0,i.default)(X.icon)),Se=(0,o.default)((0,i.default)(z.asterisk));return r.default.createElement("div",b({},P,{ref:d,className:de}),E&&r.default.createElement("div",{className:be},E),r.default.createElement("input",b({},L,{ref:D,className:Te,placeholder:(L==null?void 0:L.placeholder)||" "})),r.default.createElement("label",b({},N,{className:xe}),h," ",L.required?r.default.createElement("span",{className:Se},"*"):""))});C.propTypes={variant:n.default.oneOf(f.propTypesVariant),size:n.default.oneOf(f.propTypesSize),color:n.default.oneOf(f.propTypesColor),label:f.propTypesLabel,error:f.propTypesError,success:f.propTypesSuccess,icon:f.propTypesIcon,labelProps:f.propTypesLabelProps,containerProps:f.propTypesContainerProps,shrink:f.propTypesShrink,className:f.propTypesClassName},C.displayName="MaterialTailwind.Input";var w=C})(OP);var PP={},pu={},Tl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,h){for(var v in h)Object.defineProperty(s,v,{enumerable:!0,get:h[v]})}t(e,{propTypesOpen:function(){return g},propTypesHandler:function(){return b},propTypesPlacement:function(){return _},propTypesOffset:function(){return O},propTypesDismiss:function(){return S},propTypesAnimate:function(){return C},propTypesLockScroll:function(){return w},propTypesDisabled:function(){return m},propTypesClassName:function(){return d},propTypesChildren:function(){return l},propTypesContextValue:function(){return c}});var r=a($e),n=Dt;function o(s,h,v){return h in s?Object.defineProperty(s,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):s[h]=v,s}function a(s){return s&&s.__esModule?s:{default:s}}function i(s){for(var h=1;hl.length)&&(c=l.length);for(var s=0,h=new Array(c);s=0)&&Object.prototype.propertyIsEnumerable.call(w,l)&&(d[l]=w[l])}return d}function O(w,m){if(w==null)return{};var d={},l=Object.keys(w),c,s;for(s=0;s=0)&&(d[c]=w[c]);return d}var S=r.default.forwardRef(function(w,m){var d=w.children,l=_(w,["children"]),c=(0,o.useMenu)(),s=c.getReferenceProps,h=c.reference,v=c.nested,y=(0,n.useMergeRefs)([m,h]);return r.default.cloneElement(d,f({},s(f(b(f({},l),{ref:y,onClick:function(P){P.stopPropagation()}}),v&&{role:"menuitem"}))))});S.propTypes={children:a.propTypesChildren},S.displayName="MaterialTailwind.MenuHandler";var C=S})(EP);var NP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{MenuList:function(){return w},default:function(){return m}});var r=O(j),n=ur,o=gr,a=O(Xe),i=He,u=O(Be),f=ze,g=pu,b=Tl;function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.children,s=d.className,h=S(d,["children","className"]),v=(0,f.useTheme)().menu,y=v.styles.base,E=(0,g.useMenu)(),P=E.open,N=E.handler,R=E.strategy,M=E.x,D=E.y,L=E.floating,W=E.listItemsRef,U=E.getFloatingProps,Y=E.getItemProps,$=E.appliedAnimation,z=E.lockScroll,H=E.context,G=E.activeIndex,X=E.tree,ie=E.allowHover,fe=E.internalAllowHover,pe=E.setActiveIndex,oe=E.nested;s=s??"";var se=(0,i.twMerge)((0,a.default)((0,u.default)(y.menu)),s),ee=(0,n.useMergeRefs)([l,L]),ae=o.AnimatePresence,ue=r.default.createElement(o.m.div,_({},h,{ref:ee,style:{position:R,top:D??0,left:M??0},className:se},U({onKeyDown:function(Te){Te.key==="Tab"&&(N(!1),Te.shiftKey&&Te.preventDefault())}}),{initial:"unmount",exit:"unmount",animate:P?"mount":"unmount",variants:$}),r.default.Children.map(c,function(de,Te){return r.default.isValidElement(de)&&r.default.cloneElement(de,Y({tabIndex:G===Te?0:-1,role:"menuitem",className:de.props.className,ref:function(be){W.current[Te]=be},onClick:function(be){if(de.props.onClick){var Se,je;(je=(Se=de.props).onClick)===null||je===void 0||je.call(Se,be)}X==null||X.events.emit("click")},onMouseEnter:function(){(ie&&P||fe&&P)&&pe(Te)}}))}));return r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(n.FloatingPortal,null,r.default.createElement(ae,null,P&&r.default.createElement(r.default.Fragment,null,z?r.default.createElement(n.FloatingOverlay,{lockScroll:!0},r.default.createElement(n.FloatingFocusManager,{context:H,modal:!oe,initialFocus:oe?-1:0,returnFocus:!oe,visuallyHiddenDismiss:!0},ue)):r.default.createElement(n.FloatingFocusManager,{context:H,modal:!oe,initialFocus:oe?-1:0,returnFocus:!oe,visuallyHiddenDismiss:!0},ue)))))});w.propTypes={className:b.propTypesClassName,children:b.propTypesChildren},w.displayName="MaterialTailwind.MenuList";var m=w})(NP);var jP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(w,m){for(var d in m)Object.defineProperty(w,d,{enumerable:!0,get:m[d]})}t(e,{MenuItem:function(){return S},default:function(){return C}});var r=b(j),n=b(Xe),o=He,a=b(Be),i=ze,u=Tl;function f(w,m,d){return m in w?Object.defineProperty(w,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):w[m]=d,w}function g(){return g=Object.assign||function(w){for(var m=1;m=0)&&Object.prototype.propertyIsEnumerable.call(w,l)&&(d[l]=w[l])}return d}function O(w,m){if(w==null)return{};var d={},l=Object.keys(w),c,s;for(s=0;s=0)&&(d[c]=w[c]);return d}var S=r.default.forwardRef(function(w,m){var d=w.className,l=d===void 0?"":d,c=w.disabled,s=c===void 0?!1:c,h=w.children,v=_(w,["className","disabled","children"]),y=(0,i.useTheme)().menu,E=y.styles.base,P=(0,o.twMerge)((0,n.default)((0,a.default)(E.item.initial),f({},(0,a.default)(E.item.disabled),s)),l);return r.default.createElement("button",g({},v,{ref:m,role:"menuitem",className:P}),h)});S.propTypes={className:u.propTypesClassName,disabled:u.propTypesDisabled,children:u.propTypesChildren},S.displayName="MaterialTailwind.MenuItem";var C=S})(jP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(S,C){for(var w in C)Object.defineProperty(S,w,{enumerable:!0,get:C[w]})}t(e,{Menu:function(){return _},MenuHandler:function(){return i.MenuHandler},MenuList:function(){return u.MenuList},MenuItem:function(){return f.MenuItem},useMenu:function(){return o.useMenu},default:function(){return O}});var r=b(j),n=ur,o=pu,a=kP,i=EP,u=NP,f=jP;function g(){return g=Object.assign||function(S){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.open,s=d.animate,h=d.className,v=d.children,y=S(d,["open","animate","className","children"]),E;console.error(` will be deprecated in the future versions of @material-tailwind/react use instead. More details: https://www.material-tailwind.com/docs/react/collapse `);var P=r.default.useRef(null),N=(0,g.useTheme)().navbar,R=N.styles,M=R.base.mobileNav;s=s??{},h=h??"";var D=(0,u.twMerge)((0,i.default)((0,f.default)(M)),h),L={unmount:{height:0,opacity:0,transition:{duration:.3,times:"[0.4, 0, 0.2, 1]"}},mount:{opacity:1,height:"".concat((E=P.current)===null||E===void 0?void 0:E.scrollHeight,"px"),transition:{duration:.3,times:"[0.4, 0, 0.2, 1]"}}},W=(0,a.default)(L,s),U=n.AnimatePresence,Y=(0,o.useMergeRefs)([l,P]);return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(U,null,r.default.createElement(n.m.div,_({},y,{ref:Y,className:D,initial:"unmount",exit:"unmount",animate:c?"mount":"unmount",variants:W}),v)))});w.displayName="MaterialTailwind.MobileNav",w.propTypes={open:b.propTypesOpen,animate:b.propTypesAnimate,className:b.propTypesClassName,children:b.propTypesChildren};var m=w})(AP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Navbar:function(){return m},MobileNav:function(){return g.MobileNav},default:function(){return d}});var r=S(j),n=S($e),o=S(Xe),a=He,i=S(zt),u=S(Be),f=ze,g=AP,b=of;function _(l,c,s){return c in l?Object.defineProperty(l,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[c]=s,l}function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.variant,h=l.color,v=l.shadow,y=l.blurred,E=l.fullWidth,P=l.className,N=l.children,R=C(l,["variant","color","shadow","blurred","fullWidth","className","children"]),M=(0,f.useTheme)().navbar,D=M.defaultProps,L=M.valid,W=M.styles,U=W.base,Y=W.variants;s=s??D.variant,h=h??D.color,v=v??D.shadow,y=y??D.blurred,E=E??D.fullWidth,P=P??D.className;var $,z=(0,o.default)((0,u.default)(U.navbar.initial),($={},_($,(0,u.default)(U.navbar.shadow),v),_($,(0,u.default)(U.navbar.blurred),y&&h==="white"),_($,(0,u.default)(U.navbar.fullWidth),E),$)),H=(0,o.default)((0,u.default)(Y[(0,i.default)(L.variants,s,"filled")][(0,i.default)(L.colors,h,"white")])),G=(0,a.twMerge)((0,o.default)(z,H),P);return r.default.createElement("nav",O({},R,{ref:c,className:G}),N)});m.propTypes={variant:n.default.oneOf(b.propTypesVariant),color:n.default.oneOf(b.propTypesColor),shadow:b.propTypesShadow,blurred:b.propTypesBlurred,fullWidth:b.propTypesFullWidth,className:b.propTypesClassName,children:b.propTypesChildren},m.displayName="MaterialTailwind.Navbar";var d=Object.assign(m,{MobileNav:g.MobileNav})})(RP);var MP={},Of={},Ol={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{propTypesOpen:function(){return a},propTypesHandler:function(){return i},propTypesPlacement:function(){return u},propTypesOffset:function(){return f},propTypesDismiss:function(){return g},propTypesAnimate:function(){return b},propTypesContent:function(){return _},propTypesInteractive:function(){return O},propTypesClassName:function(){return S},propTypesChildren:function(){return C},propTypesContextValue:function(){return w}});var r=o($e),n=Dt;function o(m){return m&&m.__esModule?m:{default:m}}var a=r.default.bool,i=r.default.func,u=n.propTypesPlacements,f=n.propTypesOffsetType,g=n.propTypesDismissType,b=n.propTypesAnimation,_=r.default.node,O=r.default.bool,S=r.default.string,C=r.default.node.isRequired,w=r.default.shape({open:r.default.bool.isRequired,strategy:r.default.oneOf(["fixed","absolute"]).isRequired,x:r.default.number,y:r.default.number,context:r.default.instanceOf(Object).isRequired,reference:r.default.func.isRequired,floating:r.default.func.isRequired,getReferenceProps:r.default.func.isRequired,getFloatingProps:r.default.func.isRequired,appliedAnimation:b.isRequired,labelId:r.default.string.isRequired,descriptionId:r.default.string.isRequired}).isRequired})(Ol);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(f,g){for(var b in g)Object.defineProperty(f,b,{enumerable:!0,get:g[b]})}t(e,{PopoverContext:function(){return a},usePopover:function(){return i},PopoverContextProvider:function(){return u}});var r=o(j),n=Ol;function o(f){return f&&f.__esModule?f:{default:f}}var a=r.default.createContext(null);a.displayName="MaterialTailwind.PopoverContext";function i(){var f=r.default.useContext(a);if(!f)throw new Error("usePopover() must be used within a Popover. It happens when you use PopoverHandler or PopoverContent components outside the Popover component.");return f}var u=function(f){var g=f.value,b=f.children;return r.default.createElement(a.Provider,{value:g},b)};u.propTypes={value:n.propTypesContextValue,children:n.propTypesChildren},u.displayName="MaterialTailwind.PopoverContextProvider"})(Of);var IP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(w,m){for(var d in m)Object.defineProperty(w,d,{enumerable:!0,get:m[d]})}t(e,{PopoverHandler:function(){return S},default:function(){return C}});var r=u(j),n=ur,o=Of,a=Ol;function i(w,m,d){return m in w?Object.defineProperty(w,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):w[m]=d,w}function u(w){return w&&w.__esModule?w:{default:w}}function f(w){for(var m=1;m=0)&&Object.prototype.propertyIsEnumerable.call(w,l)&&(d[l]=w[l])}return d}function O(w,m){if(w==null)return{};var d={},l=Object.keys(w),c,s;for(s=0;s=0)&&(d[c]=w[c]);return d}var S=r.default.forwardRef(function(w,m){var d=w.children,l=_(w,["children"]),c=(0,o.usePopover)(),s=c.getReferenceProps,h=c.reference,v=(0,n.useMergeRefs)([m,h]);return r.default.cloneElement(d,f({},s(b(f({},l),{ref:v}))))});S.propTypes={children:a.propTypesChildren},S.displayName="MaterialTailwind.PopoverHandler";var C=S})(IP);var DP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(h,v){for(var y in v)Object.defineProperty(h,y,{enumerable:!0,get:v[y]})}t(e,{PopoverContent:function(){return c},default:function(){return s}});var r=S(j),n=ur,o=gr,a=S(Xe),i=He,u=S(Be),f=ze,g=Of,b=Ol;function _(h,v,y){return v in h?Object.defineProperty(h,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):h[v]=y,h}function O(){return O=Object.assign||function(h){for(var v=1;v=0)&&Object.prototype.propertyIsEnumerable.call(h,E)&&(y[E]=h[E])}return y}function l(h,v){if(h==null)return{};var y={},E=Object.keys(h),P,N;for(N=0;N=0)&&(y[P]=h[P]);return y}var c=r.default.forwardRef(function(h,v){var y=h.children,E=h.className,P=d(h,["children","className"]),N=(0,f.useTheme)().popover,R=N.defaultProps,M=N.styles.base,D=(0,g.usePopover)(),L=D.open,W=D.strategy,U=D.x,Y=D.y,$=D.context,z=D.floating,H=D.getFloatingProps,G=D.appliedAnimation,X=D.labelId,ie=D.descriptionId;E=E??R.className;var fe=(0,i.twMerge)((0,a.default)((0,u.default)(M)),E),pe=(0,n.useMergeRefs)([v,z]),oe=o.AnimatePresence;return r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(n.FloatingPortal,null,r.default.createElement(oe,null,L&&r.default.createElement(n.FloatingFocusManager,{context:$},r.default.createElement(o.m.div,O({},H(m(C({},P),{ref:pe,className:fe,style:{position:W,top:Y??"",left:U??""},"aria-labelledby":X,"aria-describedby":ie})),{initial:"unmount",exit:"unmount",animate:L?"mount":"unmount",variants:G}),y)))))});c.propTypes={className:b.propTypesClassName,children:b.propTypesChildren},c.displayName="MaterialTailwind.PopoverContent";var s=c})(DP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,h){for(var v in h)Object.defineProperty(s,v,{enumerable:!0,get:h[v]})}t(e,{Popover:function(){return l},PopoverHandler:function(){return g.PopoverHandler},PopoverContent:function(){return b.PopoverContent},usePopover:function(){return u.usePopover},default:function(){return c}});var r=S(j),n=S($e),o=ur,a=S(yr),i=ze,u=Of,f=Ol,g=IP,b=DP;function _(s,h){(h==null||h>s.length)&&(h=s.length);for(var v=0,y=new Array(h);v=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.variant,s=d.color,h=d.size,v=d.value,y=d.label,E=d.className,P=d.barProps,N=S(d,["variant","color","size","value","label","className","barProps"]),R=(0,f.useTheme)().progress,M=R.defaultProps,D=R.valid,L=R.styles,W=L.base,U=L.variants,Y=L.sizes;c=c??M.variant,s=s??M.color,h=h??M.size,y=y??M.label,E=E??M.className,P=P??M.barProps;var $=(0,u.default)(U[(0,i.default)(D.variants,c,"filled")][(0,i.default)(D.colors,s,"gray")]),z=(0,u.default)(Y[(0,i.default)(D.sizes,h,"md")].container.initial),H=(0,o.default)((0,u.default)(W.container.initial),z),G=(0,u.default)(Y[(0,i.default)(D.sizes,h,"md")].container.withLabel),X=(0,o.default)((0,u.default)(W.container.withLabel),G),ie=(0,u.default)(Y[(0,i.default)(D.sizes,h,"md")].bar),fe=(0,o.default)((0,u.default)(W.bar),ie),pe=(0,a.twMerge)((0,o.default)(H,b({},X,y)),E),oe=(0,a.twMerge)((0,o.default)(fe,$),P==null?void 0:P.className);return r.default.createElement("div",_({},N,{ref:l,className:pe}),r.default.createElement("div",_({},P,{className:oe,style:{width:"".concat(v,"%")}}),y&&"".concat(v,"% ").concat(typeof y=="string"?y:"")))});w.propTypes={variant:n.default.oneOf(g.propTypesVariant),color:n.default.oneOf(g.propTypesColor),size:n.default.oneOf(g.propTypesSize),value:g.propTypesValue,label:g.propTypesLabel,barProps:g.propTypesBarProps,className:g.propTypesClassName},w.displayName="MaterialTailwind.Progress";var m=w})(LP);var FP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Radio:function(){return m},default:function(){return d}});var r=S(j),n=S($e),o=S(xl),a=S(Xe),i=He,u=S(zt),f=S(Be),g=ze,b=ui;function _(l,c,s){return c in l?Object.defineProperty(l,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[c]=s,l}function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.color,h=l.label,v=l.icon,y=l.ripple,E=l.className,P=l.disabled,N=l.containerProps,R=l.labelProps,M=l.iconProps,D=l.inputRef,L=C(l,["color","label","icon","ripple","className","disabled","containerProps","labelProps","iconProps","inputRef"]),W=(0,g.useTheme)().radio,U=W.defaultProps,Y=W.valid,$=W.styles,z=$.base,H=$.colors,G=r.default.useId();s=s??U.color,h=h??U.label,v=v??U.icon,y=y??U.ripple,E=E??U.className,P=P??U.disabled,N=N??U.containerProps,R=R??U.labelProps,M=M??U.iconProps;var X=y!==void 0&&new o.default,ie=(0,a.default)((0,f.default)(z.root),_({},(0,f.default)(z.disabled),P)),fe=(0,i.twMerge)((0,a.default)((0,f.default)(z.container)),N==null?void 0:N.className),pe=(0,i.twMerge)((0,a.default)((0,f.default)(z.input),(0,f.default)(H[(0,u.default)(Y.colors,s,"gray")])),E),oe=(0,i.twMerge)((0,a.default)((0,f.default)(z.label)),R==null?void 0:R.className),se=(0,a.default)((0,a.default)((0,f.default)(z.icon)),H[(0,u.default)(Y.colors,s,"gray")].color,M==null?void 0:M.className);return r.default.createElement("div",{ref:c,className:ie},r.default.createElement("label",O({},N,{className:fe,htmlFor:L.id||G,onMouseDown:function(ee){var ae=N==null?void 0:N.onMouseDown;return y&&X.create(ee,"dark"),typeof ae=="function"&&ae(ee)}}),r.default.createElement("input",O({},L,{ref:D,type:"radio",disabled:P,className:pe,id:L.id||G})),r.default.createElement("span",{className:se},v||r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3.5 w-3.5",viewBox:"0 0 16 16",fill:"currentColor"},r.default.createElement("circle",{"data-name":"ellipse",cx:"8",cy:"8",r:"8"})))),h&&r.default.createElement("label",O({},R,{className:oe,htmlFor:L.id||G}),h))});m.propTypes={color:n.default.oneOf(b.propTypesColor),label:b.propTypesLabel,icon:b.propTypesIcon,ripple:b.propTypesRipple,className:b.propTypesClassName,disabled:b.propTypesDisabled,containerProps:b.propTypesObject,labelProps:b.propTypesObject},m.displayName="MaterialTailwind.Radio";var d=m})(FP);var zP={},Km={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(b,_){for(var O in _)Object.defineProperty(b,O,{enumerable:!0,get:_[O]})}t(e,{SelectContext:function(){return i},useSelect:function(){return u},usePrevious:function(){return f},SelectContextProvider:function(){return g}});var r=a(j),n=gr,o=ou;function a(b){return b&&b.__esModule?b:{default:b}}var i=r.default.createContext(null);i.displayName="MaterialTailwind.SelectContext";function u(){var b=r.default.useContext(i);if(b===null)throw new Error("useSelect() must be used within a Select. It happens when you use SelectOption component outside the Select component.");return b}function f(b){var _=r.default.useRef();return(0,n.useIsomorphicLayoutEffect)(function(){_.current=b},[b]),_.current}var g=function(b){var _=b.value,O=b.children;return r.default.createElement(i.Provider,{value:_},O)};g.propTypes={value:o.propTypesContextValue,children:o.propTypesChildren},g.displayName="MaterialTailwind.SelectContextProvider"})(Km);var BP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{SelectOption:function(){return C},default:function(){return w}});var r=_(j),n=_(Xe),o=He,a=_(Be),i=ze,u=Km,f=ou;function g(m,d,l){return d in m?Object.defineProperty(m,d,{value:l,enumerable:!0,configurable:!0,writable:!0}):m[d]=l,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,c)&&(l[c]=m[c])}return l}function S(m,d){if(m==null)return{};var l={},c=Object.keys(m),s,h;for(h=0;h=0)&&(l[s]=m[s]);return l}var C=function(m){var d=function(){$(v),G(s),H(!1),ie(null)},l=function(Te){(Te.key==="Enter"||Te.key===" "&&!pe.current.typing)&&(Te.preventDefault(),d())},c=m.value,s=c===void 0?"":c,h=m.index,v=h===void 0?0:h,y=m.disabled,E=y===void 0?!1:y,P=m.className,N=P===void 0?"":P,R=m.children,M=O(m,["value","index","disabled","className","children"]),D=(0,i.useTheme)().select,L=D.styles,W=L.base,U=(0,u.useSelect)(),Y=U.selectedIndex,$=U.setSelectedIndex,z=U.listRef,H=U.setOpen,G=U.onChange,X=U.activeIndex,ie=U.setActiveIndex,fe=U.getItemProps,pe=U.dataRef,oe=(0,a.default)(W.option.initial),se=(0,a.default)(W.option.active),ee=(0,a.default)(W.option.disabled),ae,ue=(0,o.twMerge)((0,n.default)(oe,(ae={},g(ae,se,Y===v),g(ae,ee,E),ae)),N??"");return r.default.createElement("li",b({},M,{role:"option",ref:function(de){return z.current[v]=de},className:ue,disabled:E,tabIndex:X===v?0:1,"aria-selected":X===v&&Y===v,"data-selected":Y===v},fe({onClick:function(de){var Te=M==null?void 0:M.onClick;typeof Te=="function"&&(Te(de),d()),d()},onKeyDown:function(de){var Te=M==null?void 0:M.onKeyDown;typeof Te=="function"&&(Te(de),l(de)),l(de)}})),R)};C.propTypes={value:f.propTypesValue,index:f.propTypesIndex,disabled:f.propTypesDisabled,className:f.propTypesClassName,children:f.propTypesChildren},C.displayName="MaterialTailwind.SelectOption";var w=C})(BP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(z,H){for(var G in H)Object.defineProperty(z,G,{enumerable:!0,get:H[G]})}t(e,{Select:function(){return Y},Option:function(){return C.SelectOption},useSelect:function(){return O.useSelect},usePrevious:function(){return O.usePrevious},default:function(){return $}});var r=s(j),n=s($e),o=ur,a=gr,i=s(Xe),u=He,f=s(yr),g=s(zt),b=s(Be),_=ze,O=Km,S=ou,C=BP;function w(z,H){(H==null||H>z.length)&&(H=z.length);for(var G=0,X=new Array(H);G=0)&&Object.prototype.propertyIsEnumerable.call(z,X)&&(G[X]=z[X])}return G}function D(z,H){if(z==null)return{};var G={},X=Object.keys(z),ie,fe;for(fe=0;fe=0)&&(G[ie]=z[ie]);return G}function L(z,H){return m(z)||v(z,H)||U(z,H)||y()}function W(z){return d(z)||h(z)||U(z)||E()}function U(z,H){if(z){if(typeof z=="string")return w(z,H);var G=Object.prototype.toString.call(z).slice(8,-1);if(G==="Object"&&z.constructor&&(G=z.constructor.name),G==="Map"||G==="Set")return Array.from(G);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return w(z,H)}}var Y=r.default.forwardRef(function(z,H){var G=z.variant,X=z.color,ie=z.size,fe=z.label,pe=z.error,oe=z.success,se=z.arrow,ee=z.value,ae=z.onChange,ue=z.selected,de=z.offset,Te=z.dismiss,xe=z.animate,be=z.lockScroll,Se=z.labelProps,je=z.menuProps,qe=z.className,nt=z.disabled,ut=z.name,Ye=z.children,rt=z.containerProps,Je=M(z,["variant","color","size","label","error","success","arrow","value","onChange","selected","offset","dismiss","animate","lockScroll","labelProps","menuProps","className","disabled","name","children","containerProps"]),Ve,me=(0,_.useTheme)().select,te=me.defaultProps,ge=me.valid,_e=me.styles,Pe=_e.base,Ce=_e.variants,we=L(r.default.useState("close"),2),Ie=we[0],Ue=we[1];G=G??te.variant,X=X??te.color,ie=ie??te.size,fe=fe??te.label,pe=pe??te.error,oe=oe??te.success,se=se??te.arrow,ee=ee??te.value,ae=ae??te.onChange,ue=ue??te.selected,de=de??te.offset,Te=Te??te.dismiss,xe=xe??te.animate,Se=Se??te.labelProps,je=je??te.menuProps;var Ze;rt=(Ze=(0,f.default)(rt,(te==null?void 0:te.containerProps)||{}))!==null&&Ze!==void 0?Ze:te.containerProps,qe=qe??te.className;var Bt=r.default.useRef([]),et,Xt=r.default.useRef(W((et=r.default.Children.map(Ye,function(Pt){var Kt=Pt.props;return Kt==null?void 0:Kt.value}))!==null&&et!==void 0?et:[])),qt=L(r.default.useState(!1),2),Et=qt[0],tr=qt[1],Jt=L(r.default.useState(null),2),Nt=Jt[0],Nr=Jt[1],bt=L(r.default.useState(0),2),Gt=bt[0],On=bt[1],Gn=L(r.default.useState(!1),2),fo=Gn[0],Kr=Gn[1],Kn=(0,O.usePrevious)(Nt),wr=(0,o.useFloating)({placement:"bottom-start",open:Et,onOpenChange:tr,whileElementsMounted:o.autoUpdate,middleware:[(0,o.offset)(5),(0,o.flip)({padding:10}),(0,o.size)({apply:function(Kt){var Rt=Kt.rects,cn=Kt.elements,jr,dn;Object.assign(cn==null||(jr=cn.floating)===null||jr===void 0?void 0:jr.style,{width:"".concat(Rt==null||(dn=Rt.reference)===null||dn===void 0?void 0:dn.width,"px"),zIndex:99})},padding:20})]}),Yr=wr.x,pt=wr.y,po=wr.strategy,Z=wr.refs,Oe=wr.context;r.default.useEffect(function(){On(Math.max(0,Xt.current.indexOf(ee)+1))},[ee]);var Re=Z.floating,_t=(0,o.useInteractions)([(0,o.useClick)(Oe),(0,o.useRole)(Oe,{role:"listbox"}),(0,o.useDismiss)(Oe,P({},Te)),(0,o.useListNavigation)(Oe,{listRef:Bt,activeIndex:Nt,selectedIndex:Gt,onNavigate:Nr,loop:!0}),(0,o.useTypeahead)(Oe,{listRef:Xt,activeIndex:Nt,selectedIndex:Gt,onMatch:Et?Nr:On})]),jt=_t.getReferenceProps,vt=_t.getFloatingProps,Ct=_t.getItemProps;(0,a.useIsomorphicLayoutEffect)(function(){var Pt=Re.current;if(Et&&fo&&Pt){var Kt=Nt!=null?Bt.current[Nt]:Gt!=null?Bt.current[Gt]:null;if(Kt&&Kn!=null){var Rt,cn,jr=(cn=(Rt=Bt.current[Kn])===null||Rt===void 0?void 0:Rt.offsetHeight)!==null&&cn!==void 0?cn:0,dn=Pt.offsetHeight,ka=Kt.offsetTop,gi=ka+jr;kadn+Pt.scrollTop&&(Pt.scrollTop+=gi-dn-Pt.scrollTop+5)}}},[Et,fo,Kn,Nt]);var cr=r.default.useMemo(function(){return{selectedIndex:Gt,setSelectedIndex:On,listRef:Bt,setOpen:tr,onChange:ae||function(){},activeIndex:Nt,setActiveIndex:Nr,getItemProps:Ct,dataRef:Oe.dataRef}},[Gt,ae,Nt,Ct,Oe.dataRef]);r.default.useEffect(function(){Ue(Et?"open":!Et&&Gt||!Et&&ee?"withValue":"close")},[Et,ee,Gt,ue]);var lt=Ce[(0,g.default)(ge.variants,G,"outlined")],xr=lt.sizes[(0,g.default)(ge.sizes,ie,"md")],Zt=lt.error.select,ar=lt.success.select,Fr=lt.colors.select[(0,g.default)(ge.colors,X,"gray")],Pn=lt.error.label,Qr=lt.success.label,Sa=lt.colors.label[(0,g.default)(ge.colors,X,"gray")],Ta=lt.states[Ie],Yn=(0,i.default)((0,b.default)(Pe.container),(0,b.default)(xr.container),rt==null?void 0:rt.className),Xr=(0,u.twMerge)((0,i.default)((0,b.default)(Pe.select),(0,b.default)(lt.base.select),(0,b.default)(Ta.select),(0,b.default)(xr.select),l({},(0,b.default)(Fr[Ie]),!pe&&!oe),l({},(0,b.default)(Zt.initial),pe),l({},(0,b.default)(Zt.states[Ie]),pe),l({},(0,b.default)(ar.initial),oe),l({},(0,b.default)(ar.states[Ie]),oe)),qe),Qn,hi=(0,u.twMerge)((0,i.default)((0,b.default)(Pe.label),(0,b.default)(lt.base.label),(0,b.default)(Ta.label),(0,b.default)(xr.label.initial),(0,b.default)(xr.label.states[Ie]),l({},(0,b.default)(Sa[Ie]),!pe&&!oe),l({},(0,b.default)(Pn.initial),pe),l({},(0,b.default)(Pn.states[Ie]),pe),l({},(0,b.default)(Qr.initial),oe),l({},(0,b.default)(Qr.states[Ie]),oe)),(Qn=Se.className)!==null&&Qn!==void 0?Qn:""),ho=(0,i.default)((0,b.default)(Pe.arrow.initial),l({},(0,b.default)(Pe.arrow.active),Et)),Do,Lo=(0,u.twMerge)((0,i.default)((0,b.default)(Pe.menu)),(Do=je.className)!==null&&Do!==void 0?Do:""),Oa=(0,i.default)("absolute top-2/4 -translate-y-2/4",G==="outlined"?"left-3 pt-0.5":"left-0 pt-3"),Nl={unmount:{opacity:0,transformOrigin:"top",transform:"scale(0.95)",transition:{duration:.2,times:[.4,0,.2,1]}},mount:{opacity:1,transformOrigin:"top",transform:"scale(1)",transition:{duration:.2,times:[.4,0,.2,1]}}},jl=(0,f.default)(Nl,xe),Pa=a.AnimatePresence;r.default.useEffect(function(){ee&&!ae&&console.error("Warning: You provided a `value` prop to a select component without an `onChange` handler. This will render a read-only select. If the field should be mutable use `onChange` handler with `value` together.")},[ee,ae]);var go=r.default.createElement(o.FloatingFocusManager,{context:Oe,modal:!1},r.default.createElement(a.m.ul,c({},vt(R(P({},je),{ref:Z.setFloating,role:"listbox",className:Lo,style:{position:po,top:pt??0,left:Yr??0,overflow:"auto"},onPointerEnter:function(Kt){var Rt=je==null?void 0:je.onPointerEnter;typeof Rt=="function"&&(Rt(Kt),Kr(!1)),Kr(!1)},onPointerMove:function(Kt){var Rt=je==null?void 0:je.onPointerMove;typeof Rt=="function"&&(Rt(Kt),Kr(!1)),Kr(!1)},onKeyDown:function(Kt){var Rt=je==null?void 0:je.onKeyDown;typeof Rt=="function"&&(Rt(Kt),Kr(!0)),Kr(!0)}})),{initial:"unmount",exit:"unmount",animate:Et?"mount":"unmount",variants:jl}),r.default.Children.map(Ye,function(Pt,Kt){var Rt;return r.default.isValidElement(Pt)&&r.default.cloneElement(Pt,R(P({},Pt.props),{index:((Rt=Pt.props)===null||Rt===void 0?void 0:Rt.index)||Kt+1,id:"material-tailwind-select-".concat(Kt)}))})));return r.default.createElement(O.SelectContextProvider,{value:cr},r.default.createElement("div",c({},rt,{ref:H,className:Yn}),r.default.createElement("button",c({type:"button"},jt(R(P({},Je),{ref:Z.setReference,className:Xr,disabled:nt,name:ut}))),typeof ue=="function"?r.default.createElement("span",{className:Oa},ue(Ye[Gt-1],Gt-1)):ee&&!ae?r.default.createElement("span",{className:Oa},ee):r.default.createElement("span",c({},(Ve=Ye[Gt-1])===null||Ve===void 0?void 0:Ve.props,{className:Oa})),r.default.createElement("div",{className:ho},se??r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},r.default.createElement("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})))),r.default.createElement("label",c({},Se,{className:hi}),fe),r.default.createElement(a.LazyMotion,{features:a.domAnimation},r.default.createElement(Pa,null,Et&&r.default.createElement(r.default.Fragment,null,be?r.default.createElement(o.FloatingOverlay,{lockScroll:!0},go):go)))))});Y.propTypes={variant:n.default.oneOf(S.propTypesVariant),color:n.default.oneOf(S.propTypesColor),size:n.default.oneOf(S.propTypesSize),label:S.propTypesLabel,error:S.propTypesError,success:S.propTypesSuccess,arrow:S.propTypesArrow,value:S.propTypesValue,onChange:S.propTypesOnChange,selected:S.propTypesSelected,offset:S.propTypesOffset,dismiss:S.propTypesDismiss,animate:S.propTypesAnimate,lockScroll:S.propTypesLockScroll,labelProps:S.propTypesLabelProps,menuProps:S.propTypesMenuProps,className:S.propTypesClassName,disabled:S.propTypesDisabled,name:S.propTypesName,children:S.propTypesChildren,containerProps:S.propTypesContainerProps},Y.displayName="MaterialTailwind.Select";var $=Object.assign(Y,{Option:C.SelectOption})})(zP);var VP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Switch:function(){return m},default:function(){return d}});var r=S(j),n=S($e),o=S(xl),a=S(Xe),i=He,u=S(zt),f=S(Be),g=ze,b=ui;function _(l,c,s){return c in l?Object.defineProperty(l,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[c]=s,l}function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.color,h=l.label,v=l.ripple,y=l.className,E=l.disabled,P=l.containerProps,N=l.circleProps,R=l.labelProps,M=l.inputRef,D=C(l,["color","label","ripple","className","disabled","containerProps","circleProps","labelProps","inputRef"]),L=(0,g.useTheme)(),W=L.switch,U=W.defaultProps,Y=W.valid,$=W.styles,z=$.base,H=$.colors,G=r.default.useId();s=s??U.color,v=v??U.ripple,y=y??U.className,E=E??U.disabled,P=P??U.containerProps,R=R??U.labelProps,N=N??U.circleProps;var X=v!==void 0&&new o.default,ie=(0,a.default)((0,f.default)(z.root),_({},(0,f.default)(z.disabled),E)),fe=(0,i.twMerge)((0,a.default)((0,f.default)(z.container)),P==null?void 0:P.className),pe=(0,i.twMerge)((0,a.default)((0,f.default)(z.input),(0,f.default)(H[(0,u.default)(Y.colors,s,"gray")])),y),oe=(0,i.twMerge)((0,a.default)((0,f.default)(z.circle),H[(0,u.default)(Y.colors,s,"gray")].circle,H[(0,u.default)(Y.colors,s,"gray")].before),N==null?void 0:N.className),se=(0,a.default)((0,f.default)(z.ripple)),ee=(0,i.twMerge)((0,a.default)((0,f.default)(z.label)),R==null?void 0:R.className);return r.default.createElement("div",{ref:c,className:ie},r.default.createElement("div",O({},P,{className:fe}),r.default.createElement("input",O({},D,{ref:M,type:"checkbox",disabled:E,id:D.id||G,className:pe})),r.default.createElement("label",O({},N,{htmlFor:D.id||G,className:oe}),v&&r.default.createElement("div",{className:se,onMouseDown:function(ae){var ue=P==null?void 0:P.onMouseDown;return v&&X.create(ae,"dark"),typeof ue=="function"&&ue(ae)}}))),h&&r.default.createElement("label",O({},R,{htmlFor:D.id||G,className:ee}),h))});m.propTypes={color:n.default.oneOf(b.propTypesColor),label:b.propTypesLabel,ripple:b.propTypesRipple,className:b.propTypesClassName,disabled:b.propTypesDisabled,containerProps:b.propTypesObject,labelProps:b.propTypesObject,circleProps:b.propTypesObject},m.displayName="MaterialTailwind.Switch";var d=m})(VP);var UP={},Pl={},fi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(S,C){for(var w in C)Object.defineProperty(S,w,{enumerable:!0,get:C[w]})}t(e,{propTypesId:function(){return a},propTypesValue:function(){return i},propTypesAnimate:function(){return u},propTypesDisabled:function(){return f},propTypesClassName:function(){return g},propTypesOrientation:function(){return b},propTypesIndicator:function(){return _},propTypesChildren:function(){return O}});var r=o($e),n=Dt;function o(S){return S&&S.__esModule?S:{default:S}}var a=r.default.string,i=r.default.oneOfType([r.default.string,r.default.number]).isRequired,u=n.propTypesAnimation,f=r.default.bool,g=r.default.string,b=r.default.oneOf(["horizontal","vertical"]),_=r.default.instanceOf(Object),O=r.default.node.isRequired})(fi);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(P,N){for(var R in N)Object.defineProperty(P,R,{enumerable:!0,get:N[R]})}t(e,{TabsContext:function(){return m},useTabs:function(){return d},TabsContextProvider:function(){return l},setId:function(){return c},setActive:function(){return s},setAnimation:function(){return h},setIndicator:function(){return v},setIsInitial:function(){return y},setOrientation:function(){return E}});var r=u(j),n=fi;function o(P,N){(N==null||N>P.length)&&(N=P.length);for(var R=0,M=new Array(N);R=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.value,s=d.className,h=d.activeClassName,v=d.disabled,y=d.children,E=S(d,["value","className","activeClassName","disabled","children"]),P=(0,u.useTheme)(),N=P.tab,R=N.defaultProps,M=N.styles.base,D=(0,f.useTabs)(),L=D.state,W=D.dispatch,U=L.id,Y=L.active,$=L.indicatorProps;s=s??R.className,h=h??R.activeClassName,v=v??R.disabled;var z,H=(0,a.twMerge)((0,o.default)((0,i.default)(M.tab.initial),(z={},b(z,(0,i.default)(M.tab.disabled),v),b(z,h,Y===c),z)),s),G,X=(0,a.twMerge)((0,o.default)((0,i.default)(M.indicator)),(G=$==null?void 0:$.className)!==null&&G!==void 0?G:"");return r.default.createElement("li",_({},E,{ref:l,role:"tab",className:H,onClick:function(ie){var fe=E==null?void 0:E.onClick;typeof fe=="function"&&((0,f.setActive)(W,c),(0,f.setIsInitial)(W,!1),fe(ie)),(0,f.setIsInitial)(W,!1),(0,f.setActive)(W,c)},"data-value":c}),r.default.createElement("div",{className:"z-20 text-inherit"},y),Y===c&&r.default.createElement(n.motion.div,_({},$,{transition:{duration:.5},className:X,layoutId:U})))});w.propTypes={value:g.propTypesValue,className:g.propTypesClassName,disabled:g.propTypesDisabled,children:g.propTypesChildren},w.displayName="MaterialTailwind.Tab";var m=w})(WP);var HP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{TabsBody:function(){return w},default:function(){return m}});var r=O(j),n=gr,o=O(yr),a=O(Xe),i=He,u=O(Be),f=ze,g=Pl,b=fi;function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.animate,s=d.className,h=d.children,v=S(d,["animate","className","children"]),y=(0,f.useTheme)().tabsBody,E=y.defaultProps,P=y.styles.base,N=(0,g.useTabs)().dispatch;s=s??E.className,c=c??E.animate;var R=(0,i.twMerge)((0,a.default)((0,u.default)(P)),s),M=r.default.useMemo(function(){return{initial:{opacity:0,position:"absolute",top:"0",left:"0",zIndex:1,transition:{duration:0}},unmount:{opacity:0,position:"absolute",top:"0",left:"0",zIndex:1,transition:{duration:.5,times:[.4,0,.2,1]}},mount:{opacity:1,position:"relative",zIndex:2,transition:{duration:.5,times:[.4,0,.2,1]}}}},[]),D=r.default.useMemo(function(){return(0,o.default)(M,c)},[c,M]);return(0,n.useIsomorphicLayoutEffect)(function(){(0,g.setAnimation)(N,D)},[D,N]),r.default.createElement("div",_({},v,{ref:l,className:R}),h)});w.propTypes={animate:b.propTypesAnimate,className:b.propTypesClassName,children:b.propTypesChildren},w.displayName="MaterialTailwind.TabsBody";var m=w})(HP);var $P={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{TabsHeader:function(){return C},default:function(){return w}});var r=_(j),n=_(Xe),o=He,a=_(Be),i=ze,u=Pl,f=fi;function g(m,d,l){return d in m?Object.defineProperty(m,d,{value:l,enumerable:!0,configurable:!0,writable:!0}):m[d]=l,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,c)&&(l[c]=m[c])}return l}function S(m,d){if(m==null)return{};var l={},c=Object.keys(m),s,h;for(h=0;h=0)&&(l[s]=m[s]);return l}var C=r.default.forwardRef(function(m,d){var l=m.indicatorProps,c=m.className,s=m.children,h=O(m,["indicatorProps","className","children"]),v=(0,i.useTheme)().tabsHeader,y=v.defaultProps,E=v.styles,P=(0,u.useTabs)(),N=P.state,R=P.dispatch,M=N.orientation;r.default.useEffect(function(){(0,u.setIndicator)(R,l)},[R,l]),c=c??y.className;var D=(0,o.twMerge)((0,n.default)((0,a.default)(E.base),g({},E[M]&&(0,a.default)(E[M]),M)),c);return r.default.createElement("nav",null,r.default.createElement("ul",b({},h,{ref:d,role:"tablist",className:D}),s))});C.propTypes={indicatorProps:f.propTypesIndicator,className:f.propTypesClassName,children:f.propTypesChildren},C.displayName="MaterialTailwind.TabsHeader";var w=C})($P);var qP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{TabPanel:function(){return C},default:function(){return w}});var r=_(j),n=gr,o=_(Xe),a=He,i=_(Be),u=ze,f=Pl,g=fi;function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,c)&&(l[c]=m[c])}return l}function S(m,d){if(m==null)return{};var l={},c=Object.keys(m),s,h;for(h=0;h=0)&&(l[s]=m[s]);return l}var C=r.default.forwardRef(function(m,d){var l=m.value,c=m.className,s=m.children,h=O(m,["value","className","children"]),v=(0,u.useTheme)().tabPanel,y=v.defaultProps,E=v.styles.base,P=(0,f.useTabs)().state,N=P.active,R=P.appliedAnimation,M=P.isInitial;c=c??y.className;var D=(0,a.twMerge)((0,o.default)((0,i.default)(E)),c),L=n.AnimatePresence;return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(L,{exitBeforeEnter:!0},r.default.createElement(n.m.div,b({},h,{ref:d,role:"tabpanel",className:D,initial:"unmount",exit:"unmount",animate:N===l?"mount":M?"initial":"unmount",variants:R,"data-value":l}),s)))});C.propTypes={value:g.propTypesValue,className:g.propTypesClassName,children:g.propTypesChildren},C.displayName="MaterialTailwind.TabPanel";var w=C})(qP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,h){for(var v in h)Object.defineProperty(s,v,{enumerable:!0,get:h[v]})}t(e,{Tabs:function(){return l},Tab:function(){return f.Tab},TabsBody:function(){return g.TabsBody},TabsHeader:function(){return b.TabsHeader},TabPanel:function(){return _.TabPanel},useTabs:function(){return u.useTabs},default:function(){return c}});var r=w(j),n=w(Xe),o=He,a=w(Be),i=ze,u=Pl,f=WP,g=HP,b=$P,_=qP,O=fi;function S(s,h,v){return h in s?Object.defineProperty(s,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):s[h]=v,s}function C(){return C=Object.assign||function(s){for(var h=1;h=0)&&Object.prototype.propertyIsEnumerable.call(s,y)&&(v[y]=s[y])}return v}function d(s,h){if(s==null)return{};var v={},y=Object.keys(s),E,P;for(P=0;P=0)&&(v[E]=s[E]);return v}var l=r.default.forwardRef(function(s,h){var v=s.value,y=s.className,E=s.orientation,P=s.children,N=m(s,["value","className","orientation","children"]),R=(0,i.useTheme)().tabs,M=R.defaultProps,D=R.styles,L=r.default.useId();y=y??M.className,E=E??M.orientation;var W=(0,o.twMerge)((0,n.default)((0,a.default)(D.base),S({},D[E]&&(0,a.default)(D[E]),E)),y);return r.default.createElement(u.TabsContextProvider,{id:L,value:v,orientation:E},r.default.createElement("div",C({},N,{ref:h,className:W}),P))});l.propTypes={id:O.propTypesId,value:O.propTypesValue,className:O.propTypesClassName,orientation:O.propTypesOrientation,children:O.propTypesChildren},l.displayName="MaterialTailwind.Tabs";var c=Object.assign(l,{Tab:f.Tab,Body:g.TabsBody,Header:b.TabsHeader,Panel:_.TabPanel})})(UP);var GP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{Textarea:function(){return C},default:function(){return w}});var r=_(j),n=_($e),o=_(Xe),a=_(zt),i=_(Be),u=ze,f=nu;function g(m,d,l){return d in m?Object.defineProperty(m,d,{value:l,enumerable:!0,configurable:!0,writable:!0}):m[d]=l,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,c)&&(l[c]=m[c])}return l}function S(m,d){if(m==null)return{};var l={},c=Object.keys(m),s,h;for(h=0;h=0)&&(l[s]=m[s]);return l}var C=r.default.forwardRef(function(m,d){var l=m.variant,c=m.color,s=m.size,h=m.label,v=m.error,y=m.success,E=m.resize,P=m.labelProps,N=m.containerProps,R=m.shrink,M=m.className,D=O(m,["variant","color","size","label","error","success","resize","labelProps","containerProps","shrink","className"]),L=(0,u.useTheme)().textarea,W=L.defaultProps,U=L.valid,Y=L.styles,$=Y.base,z=Y.variants;l=l??W.variant,s=s??W.size,c=c??W.color,h=h??W.label,P=P??W.labelProps,N=N??W.containerProps,R=R??W.shrink,M=M??W.className;var H=z[(0,a.default)(U.variants,l,"outlined")],G=(0,i.default)(H.error.textarea),X=(0,i.default)(H.success.textarea),ie=(0,i.default)(H.shrink.textarea),fe=(0,i.default)(H.colors.textarea[(0,a.default)(U.colors,c,"gray")]),pe=(0,i.default)(H.error.label),oe=(0,i.default)(H.success.label),se=(0,i.default)(H.shrink.label),ee=(0,i.default)(H.colors.label[(0,a.default)(U.colors,c,"gray")]),ae=(0,o.default)((0,i.default)($.container),N==null?void 0:N.className),ue=(0,o.default)((0,i.default)($.textarea),(0,i.default)(H.base.textarea),(0,i.default)(H.sizes[(0,a.default)(U.sizes,s,"md")].textarea),g({},fe,!v&&!y),g({},G,v),g({},X,y),g({},ie,R),E?"":"!resize-none",M),de=(0,o.default)((0,i.default)($.label),(0,i.default)(H.base.label),(0,i.default)(H.sizes[(0,a.default)(U.sizes,s,"md")].label),g({},ee,!v&&!y),g({},pe,v),g({},oe,y),g({},se,R),P==null?void 0:P.className);return r.default.createElement("div",{ref:d,className:ae},r.default.createElement("textarea",b({},D,{className:ue,placeholder:(D==null?void 0:D.placeholder)||" "})),r.default.createElement("label",{className:de},h))});C.propTypes={variant:n.default.oneOf(f.propTypesVariant),size:n.default.oneOf(f.propTypesSize),color:n.default.oneOf(f.propTypesColor),label:f.propTypesLabel,error:f.propTypesError,success:f.propTypesSuccess,resize:f.propTypesResize,labelProps:f.propTypesLabelProps,containerProps:f.propTypesContainerProps,shrink:f.propTypesShrink,className:f.propTypesClassName},C.displayName="MaterialTailwind.Textarea";var w=C})(GP);var KP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(M,D){for(var L in D)Object.defineProperty(M,L,{enumerable:!0,get:D[L]})}t(e,{Tooltip:function(){return N},default:function(){return R}});var r=m(j),n=m($e),o=ur,a=gr,i=m(Xe),u=He,f=m(yr),g=m(Be),b=ze,_=Ol;function O(M,D){(D==null||D>M.length)&&(D=M.length);for(var L=0,W=new Array(D);L=0)&&Object.prototype.propertyIsEnumerable.call(M,W)&&(L[W]=M[W])}return L}function y(M,D){if(M==null)return{};var L={},W=Object.keys(M),U,Y;for(Y=0;Y=0)&&(L[U]=M[U]);return L}function E(M,D){return S(M)||d(M,D)||P(M,D)||l()}function P(M,D){if(M){if(typeof M=="string")return O(M,D);var L=Object.prototype.toString.call(M).slice(8,-1);if(L==="Object"&&M.constructor&&(L=M.constructor.name),L==="Map"||L==="Set")return Array.from(L);if(L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L))return O(M,D)}}var N=r.default.forwardRef(function(M,D){var L=M.open,W=M.handler,U=M.content,Y=M.interactive,$=M.placement,z=M.offset,H=M.dismiss,G=M.animate,X=M.className,ie=M.children,fe=v(M,["open","handler","content","interactive","placement","offset","dismiss","animate","className","children"]),pe=(0,b.useTheme)().tooltip,oe=pe.defaultProps,se=pe.styles.base,ee=E(r.default.useState(!1),2),ae=ee[0],ue=ee[1];L=L??ae,W=W??ue,Y=Y??oe.interactive,$=$??oe.placement,z=z??oe.offset,H=H??oe.dismiss,G=G??oe.animate,X=X??oe.className;var de=(0,u.twMerge)((0,i.default)((0,g.default)(se)),X),Te={unmount:{opacity:0},mount:{opacity:1}},xe=(0,f.default)(Te,G),be=(0,o.useFloating)({open:L,onOpenChange:W,middleware:[(0,o.offset)(z),(0,o.flip)(),(0,o.shift)()],placement:$}),Se=be.x,je=be.y,qe=be.reference,nt=be.floating,ut=be.strategy,Ye=be.refs,rt=be.update,Je=be.context,Ve=(0,o.useInteractions)([(0,o.useClick)(Je,{enabled:Y}),(0,o.useFocus)(Je),(0,o.useHover)(Je),(0,o.useRole)(Je,{role:"tooltip"}),(0,o.useDismiss)(Je,H)]),me=Ve.getReferenceProps,te=Ve.getFloatingProps;r.default.useEffect(function(){if(Ye.reference.current&&Ye.floating.current&&L)return(0,o.autoUpdate)(Ye.reference.current,Ye.floating.current,rt)},[L,rt,Ye.reference,Ye.floating]);var ge=(0,o.useMergeRefs)([D,nt]),_e=(0,o.useMergeRefs)([D,qe]),Pe=a.AnimatePresence;return r.default.createElement(r.default.Fragment,null,typeof ie=="string"?r.default.createElement("span",w({},me({ref:_e})),ie):r.default.cloneElement(ie,c({},me(h(c({},ie==null?void 0:ie.props),{ref:_e})))),r.default.createElement(a.LazyMotion,{features:a.domAnimation},r.default.createElement(o.FloatingPortal,null,r.default.createElement(Pe,null,L&&r.default.createElement(a.m.div,w({},te(h(c({},fe),{ref:ge,className:de,style:{position:ut,top:je??"",left:Se??""}})),{initial:"unmount",exit:"unmount",animate:L?"mount":"unmount",variants:xe}),U)))))});N.propTypes={open:_.propTypesOpen,handler:_.propTypesHandler,content:_.propTypesContent,interactive:_.propTypesInteractive,placement:n.default.oneOf(_.propTypesPlacement),offset:_.propTypesOffset,dismiss:_.propTypesDismiss,animate:_.propTypesAnimate,className:_.propTypesClassName,children:_.propTypesChildren},N.displayName="MaterialTailwind.Tooltip";var R=N})(KP);var YP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,s){for(var h in s)Object.defineProperty(c,h,{enumerable:!0,get:s[h]})}t(e,{Typography:function(){return d},default:function(){return l}});var r=_(j),n=_($e),o=_(Xe),a=He,i=_(zt),u=_(Be),f=ze,g=um;function b(c,s,h){return s in c?Object.defineProperty(c,s,{value:h,enumerable:!0,configurable:!0,writable:!0}):c[s]=h,c}function _(c){return c&&c.__esModule?c:{default:c}}function O(c){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(c,v)&&(h[v]=c[v])}return h}function m(c,s){if(c==null)return{};var h={},v=Object.keys(c),y,E;for(E=0;E=0)&&(h[y]=c[y]);return h}var d=r.default.forwardRef(function(c,s){var h=c.variant,v=c.color,y=c.textGradient,E=c.as,P=c.className,N=c.children,R=w(c,["variant","color","textGradient","as","className","children"]),M=(0,f.useTheme)().typography,D=M.defaultProps,L=M.valid,W=M.styles,U=W.variants,Y=W.colors,$=W.textGradient;h=h??D.variant,v=v??D.color,y=y||D.textGradient,E=E??void 0,P=P??D.className;var z=(0,u.default)(U[(0,i.default)(L.variants,h,"paragraph")]),H=Y[(0,i.default)(L.colors,v,"inherit")],G=(0,u.default)($),X=(0,a.twMerge)((0,o.default)(z,b({},H.color,!y),b({},G,y),b({},H.gradient,y)),P),ie;switch(h){case"h1":ie=r.default.createElement(E||"h1",C(O({},R),{ref:s,className:X}),N);break;case"h2":ie=r.default.createElement(E||"h2",C(O({},R),{ref:s,className:X}),N);break;case"h3":ie=r.default.createElement(E||"h3",C(O({},R),{ref:s,className:X}),N);break;case"h4":ie=r.default.createElement(E||"h4",C(O({},R),{ref:s,className:X}),N);break;case"h5":ie=r.default.createElement(E||"h5",C(O({},R),{ref:s,className:X}),N);break;case"h6":ie=r.default.createElement(E||"h6",C(O({},R),{ref:s,className:X}),N);break;case"lead":ie=r.default.createElement(E||"p",C(O({},R),{ref:s,className:X}),N);break;case"paragraph":ie=r.default.createElement(E||"p",C(O({},R),{ref:s,className:X}),N);break;case"small":ie=r.default.createElement(E||"p",C(O({},R),{ref:s,className:X}),N);break;default:ie=r.default.createElement(E||"p",C(O({},R),{ref:s,className:X}),N);break}return ie});d.propTypes={variant:n.default.oneOf(g.propTypesVariant),color:n.default.oneOf(g.propTypesColor),as:g.propTypesAs,textGradient:g.propTypesTextGradient,className:g.propTypesClassName,children:g.propTypesChildren},d.displayName="MaterialTailwind.Typography";var l=d})(YP);var QP={},XP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(g,b){for(var _ in b)Object.defineProperty(g,_,{enumerable:!0,get:b[_]})}t(e,{propTypesClassName:function(){return a},propTypesChildren:function(){return i},propTypesOpen:function(){return u},propTypesAnimate:function(){return f}});var r=o($e),n=Dt;function o(g){return g&&g.__esModule?g:{default:g}}var a=r.default.string,i=r.default.node.isRequired,u=r.default.bool.isRequired,f=n.propTypesAnimation})(XP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{Collapse:function(){return w},default:function(){return m}});var r=O(j),n=gr,o=ur,a=O(yr),i=O(Xe),u=He,f=O(Be),g=ze,b=XP;function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.open,s=d.animate,h=d.className,v=d.children,y=S(d,["open","animate","className","children"]),E=r.default.useRef(null),P=(0,g.useTheme)().collapse,N=P.styles,R=N.base;s=s??{},h=h??"";var M=(0,u.twMerge)((0,i.default)((0,f.default)(R)),h),D={unmount:{height:"0px",transition:{duration:.3,times:[.4,0,.2,1]}},mount:{height:"auto",transition:{duration:.3,times:[.4,0,.2,1]}}},L=(0,a.default)(D,s),W=n.AnimatePresence,U=(0,o.useMergeRefs)([l,E]);return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(W,null,r.default.createElement(n.m.div,_({},y,{ref:U,className:M,initial:"unmount",exit:"unmount",animate:c?"mount":"unmount",variants:L}),v)))});w.displayName="MaterialTailwind.Collapse",w.propTypes={open:b.propTypesOpen,animate:b.propTypesAnimate,className:b.propTypesClassName,children:b.propTypesChildren};var m=w})(QP);var JP={},hu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(g,b){for(var _ in b)Object.defineProperty(g,_,{enumerable:!0,get:b[_]})}t(e,{propTypesClassName:function(){return o},propTypesDisabled:function(){return a},propTypesSelected:function(){return i},propTypesRipple:function(){return u},propTypesChildren:function(){return f}});var r=n($e);function n(g){return g&&g.__esModule?g:{default:g}}var o=r.default.string,a=r.default.bool,i=r.default.bool,u=r.default.bool,f=r.default.node.isRequired})(hu);var ZP={},Ym={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,w){for(var m in w)Object.defineProperty(C,m,{enumerable:!0,get:w[m]})}t(e,{ListItemPrefix:function(){return O},default:function(){return S}});var r=g(j),n=ze,o=g(Xe),a=He,i=g(Be),u=hu;function f(){return f=Object.assign||function(C){for(var w=1;w=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function _(C,w){if(C==null)return{};var m={},d=Object.keys(C),l,c;for(c=0;c=0)&&(m[l]=C[l]);return m}var O=r.default.forwardRef(function(C,w){var m=C.className,d=C.children,l=b(C,["className","children"]),c=(0,n.useTheme)().list,s=c.styles.base,h=(0,a.twMerge)((0,o.default)((0,i.default)(s.itemPrefix)),m);return r.default.createElement("div",f({},l,{ref:w,className:h}),d)});O.propTypes={className:u.propTypesClassName,children:u.propTypesChildren},O.displayName="MaterialTailwind.ListItemPrefix";var S=O})(Ym);var Qm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,w){for(var m in w)Object.defineProperty(C,m,{enumerable:!0,get:w[m]})}t(e,{ListItemSuffix:function(){return O},default:function(){return S}});var r=g(j),n=ze,o=g(Xe),a=He,i=g(Be),u=hu;function f(){return f=Object.assign||function(C){for(var w=1;w=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function _(C,w){if(C==null)return{};var m={},d=Object.keys(C),l,c;for(c=0;c=0)&&(m[l]=C[l]);return m}var O=r.default.forwardRef(function(C,w){var m=C.className,d=C.children,l=b(C,["className","children"]),c=(0,n.useTheme)().list,s=c.styles.base,h=(0,a.twMerge)((0,o.default)((0,i.default)(s.itemSuffix)),m);return r.default.createElement("div",f({},l,{ref:w,className:h}),d)});O.propTypes={className:u.propTypesClassName,children:u.propTypesChildren},O.displayName="MaterialTailwind.ListItemSuffix";var S=O})(Qm);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{ListItem:function(){return m},ListItemPrefix:function(){return g.ListItemPrefix},ListItemSuffix:function(){return b.ListItemSuffix},default:function(){return d}});var r=S(j),n=ze,o=S(xl),a=S(Xe),i=He,u=S(Be),f=hu,g=Ym,b=Qm;function _(l,c,s){return c in l?Object.defineProperty(l,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[c]=s,l}function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.className,h=l.disabled,v=l.selected,y=l.ripple,E=l.children,P=C(l,["className","disabled","selected","ripple","children"]),N=(0,n.useTheme)().list,R=N.defaultProps,M=N.styles.base;y=y??R.ripple;var D=y!==void 0&&new o.default,L,W=(0,i.twMerge)((0,a.default)((0,u.default)(M.item.initial),(L={},_(L,(0,u.default)(M.item.disabled),h),_(L,(0,u.default)(M.item.selected),v&&!h),L)),s);return r.default.createElement("div",O({},P,{ref:c,role:"button",tabIndex:0,className:W,onMouseDown:function(U){var Y=P==null?void 0:P.onMouseDown;return y&&D.create(U,"dark"),typeof Y=="function"&&Y(U)}}),E)});m.propTypes={className:f.propTypesClassName,selected:f.propTypesSelected,disabled:f.propTypesDisabled,ripple:f.propTypesRipple,children:f.propTypesChildren},m.displayName="MaterialTailwind.ListItem";var d=Object.assign(m,{Prefix:g.ListItemPrefix,Suffix:b.ListItemSuffix})})(ZP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{List:function(){return w},ListItem:function(){return f.ListItem},ListItemPrefix:function(){return g.ListItemPrefix},ListItemSuffix:function(){return b.ListItemSuffix},default:function(){return m}});var r=O(j),n=ze,o=O(Xe),a=He,i=O(Be),u=hu,f=ZP,g=Ym,b=Qm;function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.className,s=d.children,h=S(d,["className","children"]),v=(0,n.useTheme)().list,y=v.defaultProps,E=v.styles.base;c=c??y.className;var P=(0,a.twMerge)((0,o.default)((0,i.default)(E.list)),c);return r.default.createElement("nav",_({},h,{ref:l,className:P}),s)});w.propTypes={className:u.propTypesClassName,children:u.propTypesChildren},w.displayName="MaterialTailwind.List";var m=Object.assign(w,{Item:f.ListItem,ItemPrefix:g.ListItemPrefix,ItemSuffix:b.ListItemSuffix})})(JP);var ek={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,l){for(var c in l)Object.defineProperty(d,c,{enumerable:!0,get:l[c]})}t(e,{ButtonGroup:function(){return w},default:function(){return m}});var r=O(j),n=O($e),o=O(Xe),a=He,i=O(zt),u=O(Be),f=ze,g=li;function b(d,l,c){return l in d?Object.defineProperty(d,l,{value:c,enumerable:!0,configurable:!0,writable:!0}):d[l]=c,d}function _(){return _=Object.assign||function(d){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(d,s)&&(c[s]=d[s])}return c}function C(d,l){if(d==null)return{};var c={},s=Object.keys(d),h,v;for(v=0;v=0)&&(c[h]=d[h]);return c}var w=r.default.forwardRef(function(d,l){var c=d.variant,s=d.size,h=d.color,v=d.fullWidth,y=d.ripple,E=d.className,P=d.children,N=S(d,["variant","size","color","fullWidth","ripple","className","children"]),R=(0,f.useTheme)().buttonGroup,M=R.defaultProps,D=R.styles,L=R.valid,W=D.base,U=D.dividerColor;c=c??M.variant,s=s??M.size,h=h??M.color,y=y??M.ripple,v=v??M.fullWidth,E=E??M.className;var Y,$=(0,a.twMerge)((0,o.default)((0,u.default)(W.initial),(Y={},b(Y,(0,u.default)(W.fullWidth),v),b(Y,"divide-x",c!=="outlined"),b(Y,(0,u.default)(U[(0,i.default)(L.colors,h,"gray")]),c!=="outlined"),Y)),E);return r.default.createElement("div",_({},N,{ref:l,className:$}),r.default.Children.map(P,function(z,H){var G;return r.default.isValidElement(z)&&r.default.cloneElement(z,{variant:c,size:s,color:h,ripple:y,fullWidth:v,className:(0,a.twMerge)((0,o.default)({"rounded-r-none":H!==r.default.Children.count(P)-1,"border-r-0":H!==r.default.Children.count(P)-1,"rounded-l-none":H!==0}),(G=z.props)===null||G===void 0?void 0:G.className)})}))});w.propTypes={variant:n.default.oneOf(g.propTypesVariant),size:n.default.oneOf(g.propTypesSize),color:n.default.oneOf(g.propTypesColor),fullWidth:g.propTypesFullWidth,ripple:g.propTypesRipple,className:g.propTypesClassName,children:g.propTypesChildren},w.displayName="MaterialTailwind.ButtonGroup";var m=w})(ek);var tk={},rk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,w){for(var m in w)Object.defineProperty(C,m,{enumerable:!0,get:w[m]})}t(e,{propTypesClassName:function(){return o},propTypesPrevArrow:function(){return a},propTypesNextArrow:function(){return i},propTypesNavigation:function(){return u},propTypesAutoplay:function(){return f},propTypesAutoplayDelay:function(){return g},propTypesTransition:function(){return b},propTypesLoop:function(){return _},propTypesChildren:function(){return O},propTypesSlideRef:function(){return S}});var r=n($e);function n(C){return C&&C.__esModule?C:{default:C}}var o=r.default.string,a=r.default.func,i=r.default.func,u=r.default.func,f=r.default.bool,g=r.default.number,b=r.default.object,_=r.default.bool,O=r.default.node.isRequired,S=r.default.oneOfType([r.default.func,r.default.shape({current:r.default.any})])})(rk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(v,y){for(var E in y)Object.defineProperty(v,E,{enumerable:!0,get:y[E]})}t(e,{Carousel:function(){return s},default:function(){return h}});var r=S(j),n=gr,o=ur,a=S(Xe),i=He,u=S(Be),f=ze,g=rk;function b(v,y){(y==null||y>v.length)&&(y=v.length);for(var E=0,P=new Array(y);E=0)&&Object.prototype.propertyIsEnumerable.call(v,P)&&(E[P]=v[P])}return E}function d(v,y){if(v==null)return{};var E={},P=Object.keys(v),N,R;for(R=0;R=0)&&(E[N]=v[N]);return E}function l(v,y){return _(v)||C(v,y)||c(v,y)||w()}function c(v,y){if(v){if(typeof v=="string")return b(v,y);var E=Object.prototype.toString.call(v).slice(8,-1);if(E==="Object"&&v.constructor&&(E=v.constructor.name),E==="Map"||E==="Set")return Array.from(E);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return b(v,y)}}var s=r.default.forwardRef(function(v,y){var E=v.children,P=v.prevArrow,N=v.nextArrow,R=v.navigation,M=v.autoplay,D=v.autoplayDelay,L=v.transition,W=v.loop,U=v.className,Y=v.slideRef,$=m(v,["children","prevArrow","nextArrow","navigation","autoplay","autoplayDelay","transition","loop","className","slideRef"]),z=(0,f.useTheme)().carousel,H=z.defaultProps,G=z.styles.base,X=(0,n.useMotionValue)(0),ie=r.default.useRef(null),fe=l(r.default.useState(0),2),pe=fe[0],oe=fe[1],se=r.default.Children.toArray(E);U=U??H.className,P=P??H.prevArrow,N=N??H.nextArrow,R=R??H.navigation,M=M??H.autoplay,D=D??H.autoplayDelay,L=L??H.transition,W=W??H.loop;var ee=(0,i.twMerge)((0,a.default)((0,u.default)(G.carousel)),U),ae=(0,i.twMerge)((0,a.default)((0,u.default)(G.slide))),ue=r.default.useCallback(function(){var be;return-pe*(((be=ie.current)===null||be===void 0?void 0:be.clientWidth)||0)},[pe]),de=r.default.useCallback(function(){var be=W?0:pe;oe(pe+1===se.length?be:pe+1)},[pe,W,se.length]),Te=function(){var be=W?se.length-1:0;oe(pe-1<0?be:pe-1)};r.default.useEffect(function(){var be=(0,n.animate)(X,ue(),L);return be.stop},[ue,pe,X,L]),r.default.useEffect(function(){window.addEventListener("resize",function(){(0,n.animate)(X,ue(),L)})},[ue,L,X]),r.default.useEffect(function(){if(M){var be=setInterval(function(){return de()},D);return function(){return clearInterval(be)}}},[M,de,D]);var xe=(0,o.useMergeRefs)([ie,y]);return r.default.createElement("div",O({},$,{ref:xe,className:ee}),se.map(function(be,Se){return r.default.createElement(n.LazyMotion,{key:Se,features:n.domAnimation},r.default.createElement(n.m.div,{ref:Y,className:ae,style:{x:X,left:"".concat(Se*100,"%"),right:"".concat(Se*100,"%")}},be))}),P&&P({loop:W,handlePrev:Te,activeIndex:pe,firstIndex:pe===0}),N&&N({loop:W,handleNext:de,activeIndex:pe,lastIndex:pe===se.length-1}),R&&R({setActiveIndex:oe,activeIndex:pe,length:se.length}))});s.propTypes={className:g.propTypesClassName,children:g.propTypesChildren,nextArrow:g.propTypesNextArrow,prevArrow:g.propTypesPrevArrow,navigation:g.propTypesNavigation,autoplay:g.propTypesAutoplay,autoplayDelay:g.propTypesAutoplayDelay,transition:g.propTypesTransition,loop:g.propTypesLoop,slideRef:g.propTypesSlideRef},s.displayName="MaterialTailwind.Carousel";var h=s})(tk);var nk={},ok={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{propTypesOpen:function(){return a},propTypesSize:function(){return i},propTypesOverlay:function(){return u},propTypesChildren:function(){return f},propTypesPlacement:function(){return g},propTypesOverlayProps:function(){return b},propTypesClassName:function(){return _},propTypesOnClose:function(){return O},propTypesDismiss:function(){return S},propTypesTransition:function(){return C},propTypesOverlayRef:function(){return w}});var r=o($e),n=Dt;function o(m){return m&&m.__esModule?m:{default:m}}var a=r.default.bool.isRequired,i=r.default.number,u=r.default.bool,f=r.default.node.isRequired,g=["top","right","bottom","left"],b=r.default.object,_=r.default.string,O=r.default.func,S=n.propTypesDismissType,C=r.default.object,w=r.default.oneOfType([r.default.func,r.default.shape({current:r.default.any})])})(ok);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,h){for(var v in h)Object.defineProperty(s,v,{enumerable:!0,get:h[v]})}t(e,{Drawer:function(){return l},default:function(){return c}});var r=C(j),n=C($e),o=gr,a=ur,i=C(yr),u=C(Xe),f=He,g=C(Be),b=ze,_=ok;function O(s,h,v){return h in s?Object.defineProperty(s,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):s[h]=v,s}function S(){return S=Object.assign||function(s){for(var h=1;h=0)&&Object.prototype.propertyIsEnumerable.call(s,y)&&(v[y]=s[y])}return v}function d(s,h){if(s==null)return{};var v={},y=Object.keys(s),E,P;for(P=0;P=0)&&(v[E]=s[E]);return v}var l=r.default.forwardRef(function(s,h){var v=s.open,y=s.size,E=s.overlay,P=s.children,N=s.placement,R=s.overlayProps,M=s.className,D=s.onClose,L=s.dismiss,W=s.transition,U=s.overlayRef,Y=m(s,["open","size","overlay","children","placement","overlayProps","className","onClose","dismiss","transition","overlayRef"]),$=(0,b.useTheme)().drawer,z=$.defaultProps,H=$.styles.base,G=(0,o.useAnimation)();y=y??z.size,E=E??z.overlay,N=N??z.placement,M=M??z.className,R=R??z.overlayProps,D=D??z.onClose;var X;L=(X=(0,i.default)(z.dismiss,L||{}))!==null&&X!==void 0?X:z.dismiss,W=W??z.transition;var ie=(0,f.twMerge)((0,u.default)((0,g.default)(H.drawer),{"top-0 right-0":N==="right","bottom-0 left-0":N==="bottom","top-0 left-0":N==="top"||N==="left"}),M),fe=(0,f.twMerge)((0,u.default)((0,g.default)(H.overlay)),R==null?void 0:R.className),pe=(0,a.useFloating)({open:v,onOpenChange:D}).context,oe=(0,a.useInteractions)([(0,a.useDismiss)(pe,L)]).getFloatingProps;r.default.useEffect(function(){G.start(v?"open":"close")},[v,G,N]);var se={open:{x:0,y:0},close:{x:N==="left"?-y:N==="right"?y:0,y:N==="top"?-y:N==="bottom"?y:0}},ee={unmount:{opacity:0,transition:{delay:.3}},mount:{opacity:1}};return r.default.createElement(r.default.Fragment,null,r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(o.AnimatePresence,null,E&&v&&r.default.createElement(o.m.div,{ref:U,className:fe,initial:"unmount",exit:"unmount",animate:v?"mount":"unmount",variants:ee,transition:{duration:.3}})),r.default.createElement(o.m.div,S({},oe(w({ref:h},Y)),{className:ie,style:{maxWidth:N==="left"||N==="right"?y:"100%",maxHeight:N==="top"||N==="bottom"?y:"100%",height:N==="left"||N==="right"?"100vh":"100%"},initial:"close",animate:G,variants:se,transition:W}),P)))});l.propTypes={open:_.propTypesOpen,size:_.propTypesSize,overlay:_.propTypesOverlay,children:_.propTypesChildren,placement:n.default.oneOf(_.propTypesPlacement),overlayProps:_.propTypesOverlayProps,className:_.propTypesClassName,onClose:_.propTypesOnClose,dismiss:_.propTypesDismiss,transition:_.propTypesTransition,overlayRef:_.propTypesOverlayRef},l.displayName="MaterialTailwind.Drawer";var c=l})(nk);var ak={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Badge:function(){return m},default:function(){return d}});var r=S(j),n=S($e),o=S(yr),a=S(Xe),i=He,u=S(zt),f=S(Be),g=ze,b=cm;function _(l,c,s){return c in l?Object.defineProperty(l,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):l[c]=s,l}function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.color,h=l.invisible,v=l.withBorder,y=l.overlap,E=l.placement,P=l.className,N=l.content,R=l.children,M=l.containerProps,D=l.containerRef,L=C(l,["color","invisible","withBorder","overlap","placement","className","content","children","containerProps","containerRef"]),W=(0,g.useTheme)().badge,U=W.valid,Y=W.defaultProps,$=W.styles,z=$.base,H=$.placements,G=$.colors;s=s??Y.color,h=h??Y.invisible,v=v??Y.withBorder,y=y??Y.overlap,E=E??Y.placement;var X;P=(X=(0,a.default)(P,Y.className))!==null&&X!==void 0?X:Y.className;var ie;M=(ie=(0,o.default)(M,Y.containerProps||{}))!==null&&ie!==void 0?ie:Y.containerProps;var fe=(0,f.default)(z.badge.initial),pe=(0,f.default)(z.badge.withBorder),oe=(0,f.default)(z.badge.withContent),se=(0,f.default)(G[(0,u.default)(U.colors,s,"red")]),ee=(0,f.default)(H[(0,u.default)(U.placements,E,"top-end")][(0,u.default)(U.overlaps,y,"square")]),ae,ue=(0,i.twMerge)((0,a.default)(fe,ee,se,(ae={},_(ae,pe,v),_(ae,oe,N),ae)),P),de=(0,i.twMerge)((0,a.default)((0,f.default)(z.container),M==null?void 0:M.className));return r.default.createElement("div",O({ref:D},M,{className:de}),R,!h&&r.default.createElement("span",O({},L,{ref:c,className:ue}),N))});m.propTypes={color:n.default.oneOf(b.propTypesColor),invisible:b.propTypesInvisible,withBorder:b.propTypesWithBorder,overlap:n.default.oneOf(b.propTypesOverlap),className:b.propTypesClassName,content:b.propTypesContent,children:b.propTypesChildren,placement:n.default.oneOf(b.propTypesPlacement),containerProps:b.propTypesContainerProps,containerRef:b.propTypesContainerRef},m.displayName="MaterialTailwind.Badge";var d=m})(ak);var ik={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(N,R){for(var M in R)Object.defineProperty(N,M,{enumerable:!0,get:R[M]})}t(e,{Rating:function(){return E},default:function(){return P}});var r=C(j),n=C($e),o=C(Xe),a=He,i=C(zt),u=C(Be),f=ze,g=dm;function b(N,R){(R==null||R>N.length)&&(R=N.length);for(var M=0,D=new Array(R);M=0)&&Object.prototype.propertyIsEnumerable.call(N,D)&&(M[D]=N[D])}return M}function s(N,R){if(N==null)return{};var M={},D=Object.keys(N),L,W;for(W=0;W=0)&&(M[L]=N[L]);return M}function h(N,R){return _(N)||m(N,R)||y(N,R)||d()}function v(N){return O(N)||w(N)||y(N)||l()}function y(N,R){if(N){if(typeof N=="string")return b(N,R);var M=Object.prototype.toString.call(N).slice(8,-1);if(M==="Object"&&N.constructor&&(M=N.constructor.name),M==="Map"||M==="Set")return Array.from(M);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return b(N,R)}}var E=r.default.forwardRef(function(N,R){var M=N.count,D=N.value,L=N.ratedIcon,W=N.unratedIcon,U=N.ratedColor,Y=N.unratedColor,$=N.className,z=N.onChange,H=N.readonly,G=c(N,["count","value","ratedIcon","unratedIcon","ratedColor","unratedColor","className","onChange","readonly"]),X,ie,fe=(0,f.useTheme)().rating,pe=fe.valid,oe=fe.defaultProps,se=fe.styles,ee=se.base,ae=se.colors;M=M??oe.count,D=D??oe.value,L=L??oe.ratedIcon,L=L??oe.ratedIcon,W=W??oe.unratedIcon,U=U??oe.ratedColor,Y=Y??oe.unratedColor,$=$??oe.className,z=z??oe.onChange,H=H??oe.readonly;var ue=h(r.default.useState(function(){return v(Array(D).fill("rated")).concat(v(Array(M-D).fill("un_rated")))}),2),de=ue[0],Te=ue[1],xe=h(r.default.useState(function(){return v(Array(M).fill("un_rated"))}),2),be=xe[0],Se=xe[1],je=h(r.default.useState(!1),2),qe=je[0],nt=je[1],ut=(0,u.default)(ae[(0,i.default)(pe.colors,U,"yellow")]),Ye=(0,u.default)(ae[(0,i.default)(pe.colors,Y,"blue-gray")]),rt=(0,a.twMerge)((0,o.default)((0,u.default)(ee.rating),$)),Je=(0,u.default)(ee.icon),Ve=L,me=W,te=r.default.isValidElement(L)&&r.default.cloneElement(Ve,{className:(0,a.twMerge)((0,o.default)(Je,ut,Ve==null||(X=Ve.props)===null||X===void 0?void 0:X.className))}),ge=r.default.isValidElement(L)&&r.default.cloneElement(me,{className:(0,a.twMerge)((0,o.default)(Je,Ye,me==null||(ie=me.props)===null||ie===void 0?void 0:ie.className))}),_e=!r.default.isValidElement(L)&&r.default.createElement(L,{className:(0,a.twMerge)((0,o.default)(Je,ut))}),Pe=!r.default.isValidElement(L)&&r.default.createElement(W,{className:(0,a.twMerge)((0,o.default)(Je,Ye))}),Ce=function(we){return we.map(function(Ie,Ue){return r.default.createElement("span",{key:Ue,onClick:function(){if(!H){var Ze=de.map(function(Bt,et){return et<=Ue?"rated":"un_rated"});Te(Ze),z&&typeof z=="function"&&z(Ze.filter(function(Bt){return Bt==="rated"}).length)}},onMouseEnter:function(){if(!H){var Ze=be.map(function(Bt,et){return et<=Ue?"rated":"un_rated"});nt(!0),Se(Ze)}},onMouseLeave:function(){return!H&&nt(!1)}},r.default.isValidElement(Ie==="rated"?L:W)?Ie==="rated"?te:ge:Ie==="rated"?_e:Pe)})};return r.default.createElement("div",S({},G,{ref:R,className:rt}),Ce(qe?be:de))});E.propTypes={count:g.propTypesCount,value:g.propTypesValue,ratedIcon:g.propTypesRatedIcon,unratedIcon:g.propTypesUnratedIcon,ratedColor:n.default.oneOf(g.propTypesColor),unratedColor:n.default.oneOf(g.propTypesColor),className:g.propTypesClassName,onChange:g.propTypesOnChange,readonly:g.propTypesReadonly},E.displayName="MaterialTailwind.Rating";var P=E})(ik);var lk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(y,E){for(var P in E)Object.defineProperty(y,P,{enumerable:!0,get:E[P]})}t(e,{Slider:function(){return h},default:function(){return v}});var r=C(j),n=C($e),o=C(yr),a=C(Xe),i=He,u=C(zt),f=C(Be),g=ze,b=fm;function _(y,E){(E==null||E>y.length)&&(E=y.length);for(var P=0,N=new Array(E);P=0)&&Object.prototype.propertyIsEnumerable.call(y,N)&&(P[N]=y[N])}return P}function l(y,E){if(y==null)return{};var P={},N=Object.keys(y),R,M;for(M=0;M=0)&&(P[R]=y[R]);return P}function c(y,E){return O(y)||w(y,E)||s(y,E)||m()}function s(y,E){if(y){if(typeof y=="string")return _(y,E);var P=Object.prototype.toString.call(y).slice(8,-1);if(P==="Object"&&y.constructor&&(P=y.constructor.name),P==="Map"||P==="Set")return Array.from(P);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return _(y,E)}}var h=r.default.forwardRef(function(y,E){var P=y.color,N=y.size,R=y.className,M=y.trackClassName,D=y.thumbClassName,L=y.barClassName,W=y.value,U=y.defaultValue,Y=y.onChange,$=y.min,z=y.max,H=y.step,G=y.inputRef,X=y.inputProps,ie=d(y,["color","size","className","trackClassName","thumbClassName","barClassName","value","defaultValue","onChange","min","max","step","inputRef","inputProps"]),fe=(0,g.useTheme)().slider,pe=fe.valid,oe=fe.defaultProps,se=fe.styles,ee=se.base,ae=se.sizes,ue=se.colors,de=c(r.default.useState(U||0),2),Te=de[0],xe=de[1];r.default.useMemo(function(){U&&xe(U)},[U]),P=P??oe.color,N=N??oe.size,$=$??oe.min,z=z??oe.max,H=H??oe.step;var be;R=(be=(0,a.default)(oe.className,R))!==null&&be!==void 0?be:oe.className;var Se;D=(Se=(0,a.default)(oe.thumbClassName,D))!==null&&Se!==void 0?Se:oe.thumbClassName;var je;M=(je=(0,a.default)(oe.trackClassName,M))!==null&&je!==void 0?je:oe.trackClassName;var qe;L=(qe=(0,a.default)(oe.barClassName,L))!==null&&qe!==void 0?qe:oe.barClassName;var nt;X=(nt=(0,o.default)(X,(oe==null?void 0:oe.inputProps)||{}))!==null&&nt!==void 0?nt:oe.inputProps;var ut=(0,i.twMerge)((0,a.default)((0,f.default)(ee.container),(0,f.default)(ue[(0,u.default)(pe.colors,P,"gray")]),(0,f.default)(ae[(0,u.default)(pe.sizes,N,"md")].container),R)),Ye=(0,i.twMerge)((0,a.default)((0,f.default)(ee.bar),L)),rt=(0,a.default)((0,f.default)(ee.track),(0,f.default)(ae[(0,u.default)(pe.sizes,N,"md")].track)),Je=(0,a.default)((0,f.default)(ee.thumb),(0,f.default)(ae[(0,u.default)(pe.sizes,N,"md")].thumb)),Ve=(0,a.default)((0,f.default)(ee.slider),(0,i.twMerge)(rt,M),(0,i.twMerge)(Je,D));return r.default.createElement("div",S({},ie,{ref:E,className:ut}),r.default.createElement("label",{className:Ye,style:{width:"".concat(W||Te,"%")}}),r.default.createElement("input",S({ref:G,type:"range",max:z,min:$,step:H,className:Ve},W?{value:W}:null,{defaultValue:U,onChange:function(me){return Y?Y(me):xe(Number(me.target.value))}})))});h.propTypes={color:n.default.oneOf(b.propTypesColor),size:n.default.oneOf(b.propTypesSize),className:b.propTypesClassName,trackClassName:b.propTypesTrackClassName,thumbClassName:b.propTypesThumbClassName,barClassName:b.propTypesBarClassName,defaultValue:b.propTypesDefaultValue,value:b.propTypesValue,onChange:b.propTypesOnChange,min:b.propTypesMin,max:b.propTypesMax,step:b.propTypesStep,inputRef:b.propTypesInputRef,inputProps:b.propTypesInputProps},h.displayName="MaterialTailwind.Slider";var v=h})(lk);var sk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Spinner:function(){return m},default:function(){return d}});var r=_($e),n=S(j),o=_(Xe),a=He,i=_(zt),u=_(Be),f=ze,g=pm;function b(){return b=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=(0,n.forwardRef)(function(l,c){var s=l.color,h=l.className,v=C(l,["color","className"]),y=(0,f.useTheme)().spinner,E=y.defaultProps,P=y.valid,N=y.styles,R=N.base,M=N.colors;s=s??E.color;var D;h=(D=(0,o.default)(E.className,h))!==null&&D!==void 0?D:E.className;var L=(0,u.default)(M[(0,i.default)(P.colors,s,"gray")]),W=(0,a.twMerge)((0,o.default)((0,u.default)(R)),h),U,Y;return n.default.createElement("svg",b({},v,{ref:c,className:W,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:(U=v==null?void 0:v.width)!==null&&U!==void 0?U:24,height:(Y=v==null?void 0:v.height)!==null&&Y!==void 0?Y:24}),n.default.createElement("path",{d:"M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}),n.default.createElement("path",{d:"M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round",className:L}))});m.propTypes={color:r.default.oneOf(g.propTypesColor),className:g.propTypesClassName},m.displayName="MaterialTailwind.Spinner";var d=m})(sk);var uk={},gu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(h,v){for(var y in v)Object.defineProperty(h,y,{enumerable:!0,get:v[y]})}t(e,{useTimelineItem:function(){return l},TimelineItem:function(){return c},default:function(){return s}});var r=b(j),n=He,o=b(Be),a=ze,i=Io;function u(h,v){(v==null||v>h.length)&&(v=h.length);for(var y=0,E=new Array(v);y=0)&&Object.prototype.propertyIsEnumerable.call(h,E)&&(y[E]=h[E])}return y}function C(h,v){if(h==null)return{};var y={},E=Object.keys(h),P,N;for(N=0;N=0)&&(y[P]=h[P]);return y}function w(h,v){return f(h)||_(h,v)||m(h,v)||O()}function m(h,v){if(h){if(typeof h=="string")return u(h,v);var y=Object.prototype.toString.call(h).slice(8,-1);if(y==="Object"&&h.constructor&&(y=h.constructor.name),y==="Map"||y==="Set")return Array.from(y);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return u(h,v)}}var d=r.default.createContext(0);d.displayName="MaterialTailwind.TimelineItemContext";function l(){var h=r.default.useContext(d);if(!h)throw new Error("useTimelineItemContext() must be used within a TimelineItem. It happens when you use TimelineIcon, TimelineConnector or TimelineBody components outside the TimelineItem component.");return h}var c=r.default.forwardRef(function(h,v){var y=h.className,E=h.children,P=S(h,["className","children"]),N=(0,a.useTheme)().timelineItem,R=N.styles,M=R.base,D=w(r.default.useState(0),2),L=D[0],W=D[1],U=r.default.useMemo(function(){return[L,W]},[L,W]),Y=(0,n.twMerge)((0,o.default)(M),y);return r.default.createElement(d.Provider,{value:U},r.default.createElement("li",g({ref:v},P,{className:Y}),E))});c.propTypes={className:i.propTypeClassName,children:i.propTypeChildren.isRequired},c.displayName="MaterialTailwind.TimelineItem";var s=c})(gu);var ck={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(y,E){for(var P in E)Object.defineProperty(y,P,{enumerable:!0,get:E[P]})}t(e,{TimelineIcon:function(){return h},default:function(){return v}});var r=C(j),n=C($e),o=ur,a=He,i=C(zt),u=C(Be),f=ze,g=gu,b=Io;function _(y,E){(E==null||E>y.length)&&(E=y.length);for(var P=0,N=new Array(E);P=0)&&Object.prototype.propertyIsEnumerable.call(y,N)&&(P[N]=y[N])}return P}function l(y,E){if(y==null)return{};var P={},N=Object.keys(y),R,M;for(M=0;M=0)&&(P[R]=y[R]);return P}function c(y,E){return O(y)||w(y,E)||s(y,E)||m()}function s(y,E){if(y){if(typeof y=="string")return _(y,E);var P=Object.prototype.toString.call(y).slice(8,-1);if(P==="Object"&&y.constructor&&(P=y.constructor.name),P==="Map"||P==="Set")return Array.from(P);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return _(y,E)}}var h=r.default.forwardRef(function(y,E){var P=y.color,N=y.variant,R=y.className,M=y.children,D=d(y,["color","variant","className","children"]),L=(0,f.useTheme)().timelineIcon,W=L.styles,U=L.valid,Y=W.base,$=W.variants,z=c((0,g.useTimelineItem)(),2),H=z[1],G=r.default.useRef(null),X=(0,o.useMergeRefs)([E,G]);r.default.useEffect(function(){var pe=G.current;if(pe){var oe=pe.getBoundingClientRect().width;return H(oe),function(){H(0)}}},[H,R,M]);var ie=(0,u.default)($[(0,i.default)(U.variants,N,"filled")][(0,i.default)(U.colors,P,"gray")]),fe=(0,a.twMerge)((0,u.default)(Y),ie,R);return r.default.createElement("span",S({ref:X},D,{className:fe}),M)});h.propTypes={children:b.propTypeChildren,className:b.propTypeClassName,color:n.default.oneOf(b.propTypeColor),variant:n.default.oneOf(b.propTypeVariant)},h.displayName="MaterialTailwind.TimelineIcon";var v=h})(ck);var dk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,h){for(var v in h)Object.defineProperty(s,v,{enumerable:!0,get:h[v]})}t(e,{TimelineHeader:function(){return l},default:function(){return c}});var r=_(j),n=He,o=_(Be),a=ze,i=gu,u=Io;function f(s,h){(h==null||h>s.length)&&(h=s.length);for(var v=0,y=new Array(h);v=0)&&Object.prototype.propertyIsEnumerable.call(s,y)&&(v[y]=s[y])}return v}function w(s,h){if(s==null)return{};var v={},y=Object.keys(s),E,P;for(P=0;P=0)&&(v[E]=s[E]);return v}function m(s,h){return g(s)||O(s,h)||d(s,h)||S()}function d(s,h){if(s){if(typeof s=="string")return f(s,h);var v=Object.prototype.toString.call(s).slice(8,-1);if(v==="Object"&&s.constructor&&(v=s.constructor.name),v==="Map"||v==="Set")return Array.from(v);if(v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v))return f(s,h)}}var l=r.default.forwardRef(function(s,h){var v=s.className,y=s.children,E=C(s,["className","children"]),P=(0,a.useTheme)().timelineBody,N=P.styles,R=N.base,M=m((0,i.useTimelineItem)(),1),D=M[0],L=(0,n.twMerge)((0,o.default)(R),v);return r.default.createElement("div",b({},E,{ref:h,className:L}),r.default.createElement("span",{className:"pointer-events-none invisible h-full flex-shrink-0",style:{width:"".concat(D,"px")}}),r.default.createElement("div",null,y))});l.propTypes={children:u.propTypeChildren,className:u.propTypeClassName},l.displayName="MaterialTailwind.TimelineHeader";var c=l})(dk);var fk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(S,C){for(var w in C)Object.defineProperty(S,w,{enumerable:!0,get:C[w]})}t(e,{TimelineHeader:function(){return _},default:function(){return O}});var r=f(j),n=He,o=f(Be),a=ze,i=Io;function u(){return u=Object.assign||function(S){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(S,m)&&(w[m]=S[m])}return w}function b(S,C){if(S==null)return{};var w={},m=Object.keys(S),d,l;for(l=0;l=0)&&(w[d]=S[d]);return w}var _=r.default.forwardRef(function(S,C){var w=S.className,m=S.children,d=g(S,["className","children"]),l=(0,a.useTheme)().timelineHeader,c=l.styles,s=c.base,h=(0,n.twMerge)((0,o.default)(s),w);return r.default.createElement("div",u({},d,{ref:C,className:h}),m)});_.propTypes={children:i.propTypeChildren,className:i.propTypeClassName},_.displayName="MaterialTailwind.TimelineHeader";var O=_})(fk);var pk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,h){for(var v in h)Object.defineProperty(s,v,{enumerable:!0,get:h[v]})}t(e,{TimelineConnector:function(){return l},default:function(){return c}});var r=_(j),n=He,o=_(Be),a=ze,i=gu,u=Io;function f(s,h){(h==null||h>s.length)&&(h=s.length);for(var v=0,y=new Array(h);v=0)&&Object.prototype.propertyIsEnumerable.call(s,y)&&(v[y]=s[y])}return v}function w(s,h){if(s==null)return{};var v={},y=Object.keys(s),E,P;for(P=0;P=0)&&(v[E]=s[E]);return v}function m(s,h){return g(s)||O(s,h)||d(s,h)||S()}function d(s,h){if(s){if(typeof s=="string")return f(s,h);var v=Object.prototype.toString.call(s).slice(8,-1);if(v==="Object"&&s.constructor&&(v=s.constructor.name),v==="Map"||v==="Set")return Array.from(v);if(v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v))return f(s,h)}}var l=r.default.forwardRef(function(s,h){var v=s.className,y=s.children,E=C(s,["className","children"]),P,N=(0,a.useTheme)().timelineConnector,R=N.styles,M=R.base,D=m((0,i.useTimelineItem)(),1),L=D[0],W=(0,o.default)(M.line),U=(0,n.twMerge)((0,o.default)(M.container),v);return r.default.createElement("span",b({},E,{ref:h,className:U,style:{top:"".concat(L,"px"),width:"".concat(L,"px"),opacity:L?1:0,height:"calc(100% - ".concat(L,"px)")}}),y&&r.default.isValidElement(y)?r.default.cloneElement(y,{className:(0,n.twMerge)(W,(P=y.props)===null||P===void 0?void 0:P.className)}):r.default.createElement("span",{className:W}))});l.propTypes={children:u.propTypeChildren,className:u.propTypeClassName},l.displayName="MaterialTailwind.TimelineConnector";var c=l})(pk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var s in c)Object.defineProperty(l,s,{enumerable:!0,get:c[s]})}t(e,{Timeline:function(){return m},TimelineItem:function(){return u.default},TimelineIcon:function(){return f.default},TimelineBody:function(){return g.default},TimelineHeader:function(){return b.default},TimelineConnector:function(){return _.default},default:function(){return d}});var r=S(j),n=He,o=S(Be),a=ze,i=Io,u=S(gu),f=S(ck),g=S(dk),b=S(fk),_=S(pk);function O(){return O=Object.assign||function(l){for(var c=1;c=0)&&Object.prototype.propertyIsEnumerable.call(l,h)&&(s[h]=l[h])}return s}function w(l,c){if(l==null)return{};var s={},h=Object.keys(l),v,y;for(y=0;y=0)&&(s[v]=l[v]);return s}var m=r.default.forwardRef(function(l,c){var s=l.className,h=l.children,v=C(l,["className","children"]),y=(0,a.useTheme)().timeline,E=y.styles,P=E.base,N=(0,n.twMerge)((0,o.default)(P),s);return r.default.createElement("ul",O({ref:c},v,{className:N}),h)});m.propTypes={className:i.propTypeClassName,children:i.propTypeChildren},m.displayName="MaterialTailwind.Timeline";var d=Object.assign(m,{Item:u.default,Icon:f.default,Header:b.default,Body:g.default,Connector:_.default})})(uk);var hk={},gk={},Xm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(g,b){for(var _ in b)Object.defineProperty(g,_,{enumerable:!0,get:b[_]})}t(e,{propTypesActiveStep:function(){return o},propTypesIsLastStep:function(){return a},propTypesIsFirstStep:function(){return i},propTypesChildren:function(){return u},propTypesClassName:function(){return f}});var r=n($e);function n(g){return g&&g.__esModule?g:{default:g}}var o=r.default.number,a=r.default.func,i=r.default.func,u=r.default.node,f=r.default.string})(Xm);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(S,C){for(var w in C)Object.defineProperty(S,w,{enumerable:!0,get:C[w]})}t(e,{Step:function(){return _},default:function(){return O}});var r=f(j),n=He,o=f(Be),a=ze,i=Xm;function u(){return u=Object.assign||function(S){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(S,m)&&(w[m]=S[m])}return w}function b(S,C){if(S==null)return{};var w={},m=Object.keys(S),d,l;for(l=0;l=0)&&(w[d]=S[d]);return w}var _=r.default.forwardRef(function(S,C){var w=S.className;S.activeClassName,S.completedClassName;var m=S.children,d=g(S,["className","activeClassName","completedClassName","children"]),l=(0,a.useTheme)().step,c=l.styles.base,s=(0,n.twMerge)((0,o.default)(c.initial),w);return r.default.createElement("div",u({},d,{ref:C,className:s}),m)});_.propTypes={className:i.propTypesClassName,activeClassName:i.propTypesClassName,completedClassName:i.propTypesClassName,children:i.propTypesChildren},_.displayName="MaterialTailwind.Step";var O=_})(gk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(P,N){for(var R in N)Object.defineProperty(P,R,{enumerable:!0,get:N[R]})}t(e,{Stepper:function(){return y},Step:function(){return u.default},default:function(){return E}});var r=S(j),n=ur,o=He,a=S(Be),i=ze,u=S(gk),f=Xm;function g(P,N){(N==null||N>P.length)&&(N=P.length);for(var R=0,M=new Array(N);R=0)&&Object.prototype.propertyIsEnumerable.call(P,M)&&(R[M]=P[M])}return R}function s(P,N){if(P==null)return{};var R={},M=Object.keys(P),D,L;for(L=0;L=0)&&(R[D]=P[D]);return R}function h(P,N){return b(P)||C(P,N)||v(P,N)||w()}function v(P,N){if(P){if(typeof P=="string")return g(P,N);var R=Object.prototype.toString.call(P).slice(8,-1);if(R==="Object"&&P.constructor&&(R=P.constructor.name),R==="Map"||R==="Set")return Array.from(R);if(R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R))return g(P,N)}}var y=r.default.forwardRef(function(P,N){var R=P.activeStep,M=P.isFirstStep,D=P.isLastStep,L=P.className,W=P.lineClassName,U=P.activeLineClassName,Y=P.children,$=c(P,["activeStep","isFirstStep","isLastStep","className","lineClassName","activeLineClassName","children"]),z=(0,i.useTheme)(),H=z.stepper,G=z.step,X=H.styles.base,ie=G.styles,fe=ie.base,pe=r.default.useRef(null),oe=h(r.default.useState(0),2),se=oe[0],ee=oe[1],ae=R===0,ue=Array.isArray(Y)&&R===Y.length-1,de=Array.isArray(Y)&&R>Y.length-1;r.default.useEffect(function(){if(pe.current){var nt=Y,ut=pe.current.getBoundingClientRect().width,Ye=ut/(nt.length-1);ee(Ye)}},[Y]);var Te=r.default.useMemo(function(){if(!de)return se*R},[R,de,se]);(0,n.useMergeRefs)([N,pe]);var xe=(0,o.twMerge)((0,a.default)(X.stepper),L),be=(0,o.twMerge)((0,a.default)(X.line.initial),W),Se=(0,o.twMerge)(be,(0,a.default)(X.line.active),U),je=(0,a.default)(fe.active),qe=(0,a.default)(fe.completed);return r.default.useEffect(function(){D&&typeof D=="function"&&D(ue),M&&typeof M=="function"&&M(ae)},[M,ae,D,ue]),r.default.createElement("div",O({},$,{ref:pe,className:xe}),r.default.createElement("div",{className:be}),r.default.createElement("div",{className:Se,style:{width:"".concat(Te,"px")}}),Array.isArray(Y)?Y.map(function(nt,ut){var Ye,rt;return r.default.cloneElement(nt,l(m({key:ut},nt.props),{className:(0,o.twMerge)(nt.props.className,ut===R?(0,o.twMerge)(je,(Ye=nt.props)===null||Ye===void 0?void 0:Ye.activeClassName):ut=0)&&Object.prototype.propertyIsEnumerable.call(m,c)&&(l[c]=m[c])}return l}function S(m,d){if(m==null)return{};var l={},c=Object.keys(m),s,h;for(h=0;h=0)&&(l[s]=m[s]);return l}var C=r.default.forwardRef(function(m,d){var l=m.children,c=O(m,["children"]),s,h=(0,o.useSpeedDial)(),v=h.getReferenceProps,y=h.refs,E=(0,n.useMergeRefs)([d,y.setReference]);return r.default.cloneElement(l,g({},v(_(g({},c),{ref:E,className:(0,a.twMerge)(l==null||(s=l.props)===null||s===void 0?void 0:s.className,c==null?void 0:c.className)}))))});C.propTypes={children:i.propTypesChildren},C.displayName="MaterialTailwind.SpeedDialHandler";var w=C}(o0)),o0}var a0={},yx;function mz(){return yx||(yx=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var l in d)Object.defineProperty(m,l,{enumerable:!0,get:d[l]})}t(e,{SpeedDialContent:function(){return C},default:function(){return w}});var r=_(j),n=gr,o=ur,a=Jm(),i=ze,u=He,f=_(Be),g=mu;function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,c)&&(l[c]=m[c])}return l}function S(m,d){if(m==null)return{};var l={},c=Object.keys(m),s,h;for(h=0;h=0)&&(l[s]=m[s]);return l}var C=r.default.forwardRef(function(m,d){var l=m.children,c=m.className,s=O(m,["children","className"]),h=(0,i.useTheme)(),v=h.speedDialContent.styles,y=(0,a.useSpeedDial)(),E=y.x,P=y.y,N=y.refs,R=y.open,M=y.strategy,D=y.getFloatingProps,L=y.animation,W=(0,o.useMergeRefs)([d,N.setFloating]),U=(0,u.twMerge)((0,f.default)(v),c),Y=n.AnimatePresence;return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(Y,null,R&&r.default.createElement("div",b({},s,{ref:W,className:U,style:{position:M,top:P??0,left:E??0}},D()),r.default.Children.map(l,function($){return r.default.createElement(n.m.div,{initial:"unmount",exit:"unmount",animate:R?"mount":"unmount",variants:L},$)}))))});C.propTypes={children:g.propTypesChildren,className:g.propTypesClassName},C.displayName="MaterialTailwind.SpeedDialContent";var w=C}(a0)),a0}var mk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(S,C){for(var w in C)Object.defineProperty(S,w,{enumerable:!0,get:C[w]})}t(e,{SpeedDialAction:function(){return _},default:function(){return O}});var r=f(j),n=ze,o=He,a=f(Be),i=mu;function u(){return u=Object.assign||function(S){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(S,m)&&(w[m]=S[m])}return w}function b(S,C){if(S==null)return{};var w={},m=Object.keys(S),d,l;for(l=0;l=0)&&(w[d]=S[d]);return w}var _=r.default.forwardRef(function(S,C){var w=S.className,m=S.children,d=g(S,["className","children"]),l=(0,n.useTheme)(),c=l.speedDialAction.styles,s=(0,o.twMerge)((0,a.default)(c),w);return r.default.createElement("button",u({},d,{ref:C,className:s}),m)});_.propTypes={children:i.propTypesChildren,className:i.propTypesClassName},_.displayName="SpeedDialAction";var O=_})(mk);var wx;function Jm(){return wx||(wx=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(h,v){for(var y in v)Object.defineProperty(h,y,{enumerable:!0,get:v[y]})}t(e,{SpeedDialContext:function(){return d},useSpeedDial:function(){return l},SpeedDial:function(){return c},SpeedDialHandler:function(){return u.default},SpeedDialContent:function(){return f.default},SpeedDialAction:function(){return g.default},default:function(){return s}});var r=O(j),n=ur,o=ze,a=O(yr),i=mu,u=O(gz()),f=O(mz()),g=O(mk);function b(h,v){(v==null||v>h.length)&&(v=h.length);for(var y=0,E=new Array(v);y.");return h}function c(h){var v=h.open,y=h.handler,E=h.placement,P=h.offset,N=h.dismiss,R=h.animate,M=h.children,D=(0,o.useTheme)(),L=D.speedDial.defaultProps,W=w(r.default.useState(!1),2),U=W[0],Y=W[1];v=v??U,y=y??Y,E=E??L.placement,P=P??L.offset,N=N??L.dismiss,R=R??L.animate;var $={unmount:{opacity:0,transform:"scale(0.5)",transition:{duration:.2,times:[.4,0,.2,1]}},mount:{opacity:1,transform:"scale(1)",transition:{duration:.2,times:[.4,0,.2,1]}}},z=(0,a.default)($,R),H=(0,n.useFloatingNodeId)(),G=(0,n.useFloating)({open:v,nodeId:H,placement:E,onOpenChange:y,whileElementsMounted:n.autoUpdate,middleware:[(0,n.offset)(P),(0,n.flip)(),(0,n.shift)()]}),X=G.x,ie=G.y,fe=G.strategy,pe=G.refs,oe=G.context,se=(0,n.useInteractions)([(0,n.useHover)(oe,{handleClose:(0,n.safePolygon)()}),(0,n.useDismiss)(oe,N)]),ee=se.getReferenceProps,ae=se.getFloatingProps,ue=r.default.useMemo(function(){return{x:X,y:ie,strategy:fe,refs:pe,open:v,context:oe,getReferenceProps:ee,getFloatingProps:ae,animation:z}},[oe,ae,ee,pe,fe,X,ie,v,z]);return r.default.createElement(d.Provider,{value:ue},r.default.createElement("div",{className:"group"},r.default.createElement(n.FloatingNode,{id:H},M)))}c.propTypes={open:i.propTypesOpen,handler:i.propTypesHanlder,placement:i.propTypesPlacement,offset:i.propTypesOffset,dismiss:i.propTypesDismiss,className:i.propTypesClassName,children:i.propTypesChildren,animate:i.propTypesAnimate},c.displayName="MaterialTailwind.SpeedDial";var s=Object.assign(c,{Handler:u.default,Content:f.default,Action:g.default})}(n0)),n0}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),t(E5,e),t(kO,e),t(EO,e),t(NO,e),t(RO,e),t(AO,e),t(LO,e),t(FO,e),t(zO,e),t(vf,e),t(OP,e),t(PP,e),t(RP,e),t(MP,e),t(LP,e),t(FP,e),t(zP,e),t(VP,e),t(UP,e),t(GP,e),t(KP,e),t(YP,e),t(QP,e),t(JP,e),t(ek,e),t(tk,e),t(nk,e),t(ak,e),t(ik,e),t(lk,e),t(sk,e),t(uk,e),t(hk,e),t(Jm(),e),t(ze,e),t(Jg,e);function t(r,n){return Object.keys(r).forEach(function(o){o!=="default"&&!Object.prototype.hasOwnProperty.call(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:function(){return r[o]}})}),r}})(Q);function bz({title:e,titleId:t,...r},n){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const vz=j.forwardRef(bz),bk=vz,Zm=lo.createContext(null);Zm.displayName="MaterialTailwindContext";function yz(e,t){switch(t.type){case"OPEN_SIDENAV":return{...e,openSidenav:t.value};case"SIDENAV_TYPE":return{...e,sidenavType:t.value};case"SIDENAV_COLOR":return{...e,sidenavColor:t.value};case"TRANSPARENT_NAVBAR":return{...e,transparentNavbar:t.value};case"FIXED_NAVBAR":return{...e,fixedNavbar:t.value};case"OPEN_CONFIGURATOR":return{...e,openConfigurator:t.value};default:throw new Error(`Unhandled action type: ${t.type}`)}}function eb({children:e}){const t={openSidenav:!1,sidenavColor:"gray",sidenavType:"white",transparentNavbar:!1,fixedNavbar:!0,openConfigurator:!1},[r,n]=lo.useReducer(yz,t),o=lo.useMemo(()=>[r,n],[r,n]);return T.jsx(Zm.Provider,{value:o,children:e})}function Pf(){const e=lo.useContext(Zm);if(!e)throw new Error("useMaterialTailwindController should be used inside the MaterialTailwindControllerProvider.");return e}eb.displayName="/src/context/index.jsx";eb.propTypes={children:Co.node.isRequired};const vk=(e,t)=>e({type:"OPEN_SIDENAV",value:t}),wz=(e,t)=>e({type:"SIDENAV_COLOR",value:t}),xz=(e,t)=>e({type:"FIXED_NAVBAR",value:t}),tb=(e,t)=>e({type:"OPEN_CONFIGURATOR",value:t}),_z="/assets/stackpulse-846837e9.png";function kf({brandImg:e,brandName:t,routes:r}){const[n,o]=Pf(),{sidenavColor:a,sidenavType:i,openSidenav:u}=n,f={dark:"bg-gradient-to-br from-gray-800 to-gray-900",white:"bg-white shadow-sm",transparent:"bg-transparent"};return T.jsxs("aside",{className:`${f[i]} ${u?"translate-x-0":"-translate-x-80"} fixed inset-0 z-50 my-4 ml-4 h-[calc(100vh-32px)] w-72 rounded-xl transition-transform duration-300 xl:translate-x-0 border border-blue-gray-100`,children:[T.jsxs("div",{className:"relative py-6 px-8 text-right",children:[T.jsx("img",{src:_z,alt:"StackPulse",className:"w-auto"}),T.jsx("span",{className:"mt-1 text-xs text-stormGrey-500 block antialiased font-sans",children:"v0.4"}),T.jsx(Q.IconButton,{variant:"text",size:"sm",ripple:!1,className:"absolute right-0 top-0 grid rounded-br-none rounded-tl-none",onClick:()=>vk(o,!1),children:T.jsx(bk,{strokeWidth:2.5,className:"h-5 w-5 text-black"})})]}),T.jsx("div",{className:"m-4",children:r.map(({layout:g,title:b,pages:_},O)=>T.jsxs("ul",{className:"mb-4 flex flex-col gap-1",children:[b&&T.jsx("li",{className:"mx-3.5 mt-4 mb-2",children:T.jsx(Q.Typography,{variant:"small",color:i==="dark"?"white":"blue-gray",className:"font-black uppercase opacity-75",children:b})}),_.map(({icon:S,name:C,path:w})=>T.jsx("li",{children:T.jsx(NI,{to:`/${g}${w}`,children:({isActive:m})=>T.jsxs(Q.Button,{variant:m?"gradient":"text",color:m?a:i==="dark"?"white":"blue-gray",className:"flex items-center gap-4 px-4 capitalize",fullWidth:!0,children:[S,T.jsx(Q.Typography,{color:"inherit",className:"font-medium capitalize",children:C})]})})},C))]},O))})]})}kf.defaultProps={brandImg:"/img/logo-ct.png",brandName:"Material Tailwind React"};kf.propTypes={brandImg:Co.string,brandName:Co.string,routes:Co.arrayOf(Co.object).isRequired};kf.displayName="/src/widgets/layout/sidnave.jsx";function yk(){const[e,t]=Pf(),{fixedNavbar:r,openSidenav:n}=e,{pathname:o}=_a();return o.split("/").filter(a=>a!==""),T.jsx(Q.Navbar,{color:r?"white":"transparent",className:`rounded-xl transition-all ${r?"sticky top-4 z-40 py-3 shadow-md shadow-blue-gray-500/5":"px-0 py-1"}`,fullWidth:!0,blurred:r,children:T.jsxs("div",{className:"flex justify-between gap-6 flex-row items-center",children:[T.jsx("div",{className:"capitalize"}),T.jsxs("div",{className:"flex items-center",children:[T.jsx(Q.IconButton,{variant:"text",color:"blue-gray",className:"grid xl:hidden",onClick:()=>vk(t,!n),children:T.jsx(DI,{strokeWidth:3,className:"h-6 w-6 text-blue-gray-500"})}),T.jsx(Q.IconButton,{variant:"text",color:"blue-gray",onClick:()=>tb(t,!0),children:T.jsx(k5,{className:"h-5 w-5 text-blue-gray-500 "})})]})]})})}yk.displayName="/src/widgets/layout/dashboard-navbar.jsx";function Cz(e,t){t=Math.pow(10,t);const r=["K","M","B","T"];for(let o=r.length-1;o>=0;o--){var n=Math.pow(10,(o+1)*3);if(n<=e){e=Math.round(e*t/n)/t,e==1e3&&o{fetch("https://api.github.com/repos/creativetimofficial/material-tailwind-dashboard-react").then(g=>g.json()).then(g=>u(Cz(g.stargazers_count,1)))},[]),T.jsxs("aside",{className:`fixed top-0 right-0 z-50 h-screen w-96 bg-white px-2.5 shadow-lg transition-transform duration-300 ${r?"translate-x-0":"translate-x-96"}`,children:[T.jsxs("div",{className:"flex items-start justify-between px-6 pt-8 pb-6",children:[T.jsxs("div",{children:[T.jsx(Q.Typography,{variant:"h5",color:"blue-gray",children:"Dashboard Configurator"}),T.jsx(Q.Typography,{className:"font-normal text-blue-gray-600",children:"See our dashboard options."})]}),T.jsx(Q.IconButton,{variant:"text",color:"blue-gray",onClick:()=>tb(t,!1),children:T.jsx(bk,{strokeWidth:2.5,className:"h-5 w-5"})})]}),T.jsxs("div",{className:"py-4 px-6",children:[T.jsxs("div",{className:"mb-12",children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",children:"Sidenav Colors"}),T.jsx("div",{className:"mt-3 flex items-center gap-2",children:Object.keys(f).map(g=>T.jsx("span",{className:`h-6 w-6 cursor-pointer rounded-full border bg-gradient-to-br transition-transform hover:scale-105 ${f[g]} ${n===g?"border-black":"border-transparent"}`,onClick:()=>wz(t,g)},g))})]}),T.jsxs("div",{className:"mb-12",children:[T.jsx("hr",{}),T.jsxs("div",{className:"flex items-center justify-between py-5",children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",children:"Navbar Fixed"}),T.jsx(Q.Switch,{defaultChecked:!0,id:"navbar-fixed",value:a,onChange:()=>xz(t,!a)})]})]})]})]})}wk.displayName="/src/widgets/layout/configurator.jsx";function xk(){const e=new Date().getFullYear();return T.jsx("footer",{children:T.jsx("div",{className:"flex w-full flex-wrap items-center justify-center md:justify-end",children:T.jsxs(Q.Typography,{variant:"small",className:"mt-1 text-xs text-stormGrey-500 block antialiased font-sans",children:["StackPulse: © ",e," by Michael Böhmländer"]})})})}xk.displayName="/src/widgets/layout/footer.jsx";Co.string,Co.arrayOf(Co.object).isRequired,Co.node;const uo=Object.create(null);uo.open="0";uo.close="1";uo.ping="2";uo.pong="3";uo.message="4";uo.upgrade="5";uo.noop="6";const Rc=Object.create(null);Object.keys(uo).forEach(e=>{Rc[uo[e]]=e});const Fh={type:"error",data:"parser error"},_k=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ck=typeof ArrayBuffer=="function",Sk=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,rb=({type:e,data:t},r,n)=>_k&&t instanceof Blob?r?n(t):xx(t,n):Ck&&(t instanceof ArrayBuffer||Sk(t))?r?n(t):xx(new Blob([t]),n):n(uo[e]+(t||"")),xx=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function _x(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let i0;function Sz(e,t){if(_k&&e.data instanceof Blob)return e.data.arrayBuffer().then(_x).then(t);if(Ck&&(e.data instanceof ArrayBuffer||Sk(e.data)))return t(_x(e.data));rb(e,!1,r=>{i0||(i0=new TextEncoder),t(i0.encode(r))})}const Cx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ls=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,r=e.length,n,o=0,a,i,u,f;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const g=new ArrayBuffer(t),b=new Uint8Array(g);for(n=0;n>4,b[o++]=(i&15)<<4|u>>2,b[o++]=(u&3)<<6|f&63;return g},Oz=typeof ArrayBuffer=="function",nb=(e,t)=>{if(typeof e!="string")return{type:"message",data:Tk(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:Pz(e.substring(1),t)}:Rc[r]?e.length>1?{type:Rc[r],data:e.substring(1)}:{type:Rc[r]}:Fh},Pz=(e,t)=>{if(Oz){const r=Tz(e);return Tk(r,t)}else return{base64:!0,data:e}},Tk=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Ok=String.fromCharCode(30),kz=(e,t)=>{const r=e.length,n=new Array(r);let o=0;e.forEach((a,i)=>{rb(a,!1,u=>{n[i]=u,++o===r&&t(n.join(Ok))})})},Ez=(e,t)=>{const r=e.split(Ok),n=[];for(let o=0;o{const n=r.length;let o;if(n<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,n);else if(n<65536){o=new Uint8Array(3);const a=new DataView(o.buffer);a.setUint8(0,126),a.setUint16(1,n)}else{o=new Uint8Array(9);const a=new DataView(o.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(r)})}})}let l0;function rc(e){return e.reduce((t,r)=>t+r.length,0)}function nc(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let o=0;oMath.pow(2,53-32)-1){u.enqueue(Fh);break}o=b*Math.pow(2,32)+g.getUint32(4),n=3}else{if(rc(r)e){u.enqueue(Fh);break}}}})}const Pk=4;function nr(e){if(e)return Rz(e)}function Rz(e){for(var t in nr.prototype)e[t]=nr.prototype[t];return e}nr.prototype.on=nr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};nr.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};nr.prototype.off=nr.prototype.removeListener=nr.prototype.removeAllListeners=nr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,o=0;otypeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,r)=>r(t,0))(),yn=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Az="arraybuffer";function kk(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}const Mz=yn.setTimeout,Iz=yn.clearTimeout;function Nf(e,t){t.useNativeTimers?(e.setTimeoutFn=Mz.bind(yn),e.clearTimeoutFn=Iz.bind(yn)):(e.setTimeoutFn=yn.setTimeout.bind(yn),e.clearTimeoutFn=yn.clearTimeout.bind(yn))}const Dz=1.33;function Lz(e){return typeof e=="string"?Fz(e):Math.ceil((e.byteLength||e.size)*Dz)}function Fz(e){let t=0,r=0;for(let n=0,o=e.length;n=57344?r+=3:(n++,r+=4);return r}function Ek(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function zz(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function Bz(e){let t={},r=e.split("&");for(let n=0,o=r.length;n{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};Ez(t,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,kz(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Ek()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let Nk=!1;try{Nk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Wz=Nk;function Hz(){}class $z extends Uz{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,r){const n=this.request({method:"POST",data:t});n.on("success",r),n.on("error",(o,a)=>{this.onError("xhr post error",o,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=t}}let Yi=class Ac extends nr{constructor(t,r,n){super(),this.createRequest=t,Nf(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=kk(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&n.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var o;n.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Ac.requestsCount++,Ac.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Hz,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ac.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Yi.requestsCount=0;Yi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Sx);else if(typeof addEventListener=="function"){const e="onpagehide"in yn?"pagehide":"unload";addEventListener(e,Sx,!1)}}function Sx(){for(let e in Yi.requests)Yi.requests.hasOwnProperty(e)&&Yi.requests[e].abort()}const qz=function(){const e=jk({xdomain:!1});return e&&e.responseType!==null}();class Gz extends $z{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=qz&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Yi(jk,this.uri(),t)}}function jk(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Wz))return new XMLHttpRequest}catch{}if(!t)try{return new yn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Rk=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Kz extends ob{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,n=Rk?{}:kk(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,n)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r{try{this.doWrite(n,a)}catch{}o&&Ef(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Ek()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const s0=yn.WebSocket||yn.MozWebSocket;class Yz extends Kz{createSocket(t,r,n){return Rk?new s0(t,r,n):r?new s0(t,r):new s0(t)}doWrite(t,r){this.ws.send(r)}}class Qz extends ob{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const r=jz(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(r).getReader(),o=Nz();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const a=()=>{n.read().then(({done:u,value:f})=>{u||(this.onPacket(f),a())}).catch(u=>{})};a();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r{o&&Ef(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Xz={websocket:Yz,webtransport:Qz,polling:Gz},Jz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Zz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zh(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let o=Jz.exec(e||""),a={},i=14;for(;i--;)a[Zz[i]]=o[i]||"";return r!=-1&&n!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=eB(a,a.path),a.queryKey=tB(a,a.query),a}function eB(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function tB(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,a){o&&(r[o]=a)}),r}const Bh=typeof addEventListener=="function"&&typeof removeEventListener=="function",Mc=[];Bh&&addEventListener("offline",()=>{Mc.forEach(e=>e())},!1);class ga extends nr{constructor(t,r){if(super(),this.binaryType=Az,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=zh(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=zh(r.host).host);Nf(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const o=n.prototype.name;this.transports.push(o),this._transportsByName[o]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Bz(this.opts.query)),Bh&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Mc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=Pk,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ga.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",ga.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ef(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,o){if(typeof r=="function"&&(o=r,r=void 0),typeof n=="function"&&(o=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const a={type:t,data:r,options:n};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(ga.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Bh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Mc.indexOf(this._offlineEventListener);n!==-1&&Mc.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}ga.protocol=Pk;class rB extends ga{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",_=>{if(!n)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;ga.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(b(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const O=new Error("probe error");O.transport=r.name,this.emitReserved("upgradeError",O)}}))};function a(){n||(n=!0,b(),r.close(),r=null)}const i=_=>{const O=new Error("probe error: "+_);O.transport=r.name,a(),this.emitReserved("upgradeError",O)};function u(){i("transport closed")}function f(){i("socket closed")}function g(_){r&&_.name!==r.name&&a()}const b=()=>{r.removeListener("open",o),r.removeListener("error",i),r.removeListener("close",u),this.off("close",f),this.off("upgrading",g)};r.once("open",o),r.once("error",i),r.once("close",u),this.once("close",f),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let n=0;nXz[o]).filter(o=>!!o)),super(t,n)}};function oB(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=zh(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const a=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+a+":"+n.port+t,n.href=n.protocol+"://"+a+(r&&r.port===n.port?"":":"+n.port),n}const aB=typeof ArrayBuffer=="function",iB=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ak=Object.prototype.toString,lB=typeof Blob=="function"||typeof Blob<"u"&&Ak.call(Blob)==="[object BlobConstructor]",sB=typeof File=="function"||typeof File<"u"&&Ak.call(File)==="[object FileConstructor]";function ab(e){return aB&&(e instanceof ArrayBuffer||iB(e))||lB&&e instanceof Blob||sB&&e instanceof File}function Ic(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r=0&&e.num{delete this.acks[t];for(let u=0;u{this.io.clearTimeoutFn(a),r.apply(this,u)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...r){return new Promise((n,o)=>{const a=(i,u)=>i?o(i):n(u);a.withError=!0,r.push(a),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...a)=>n!==this._queue[0]?void 0:(o!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(o)):(this._queue.shift(),r&&r(null,...a)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ft.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ft.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ft.EVENT:case ft.BINARY_EVENT:this.onevent(t);break;case ft.ACK:case ft.BINARY_ACK:this.onack(t);break;case ft.DISCONNECT:this.ondisconnect();break;case ft.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const r=this;let n=!1;return function(...o){n||(n=!0,r.packet({type:ft.ACK,id:t,data:o}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ft.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const r=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}kl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+r:e-r}return Math.min(e,this.max)|0};kl.prototype.reset=function(){this.attempts=0};kl.prototype.setMin=function(e){this.ms=e};kl.prototype.setMax=function(e){this.max=e};kl.prototype.setJitter=function(e){this.jitter=e};class Wh extends nr{constructor(t,r){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,Nf(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new kl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const o=r.parser||gB;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new nB(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const o=An(r,"open",function(){n.onopen(),t&&t()}),a=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},i=An(r,"error",a);if(this._timeout!==!1){const u=this._timeout,f=this.setTimeoutFn(()=>{o(),a(new Error("timeout")),r.close()},u);this.opts.autoUnref&&f.unref(),this.subs.push(()=>{this.clearTimeoutFn(f)})}return this.subs.push(o),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(An(t,"ping",this.onping.bind(this)),An(t,"data",this.ondata.bind(this)),An(t,"error",this.onerror.bind(this)),An(t,"close",this.onclose.bind(this)),An(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){Ef(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new Mk(this,t,r),this.nsps[t]=n),n}_destroy(t){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let n=0;nt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Zl={};function Dc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=oB(e,t.path||"/socket.io"),n=r.source,o=r.id,a=r.path,i=Zl[o]&&a in Zl[o].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let f;return u?f=new Wh(n,t):(Zl[o]||(Zl[o]=new Wh(n,t)),f=Zl[o]),r.query&&!t.query&&(t.query=r.queryKey),f.socket(r.path,t)}Object.assign(Dc,{Manager:Wh,Socket:Mk,io:Dc,connect:Dc});const Ik=j.createContext(null),u0={success:{container:"border-mossGreen-500/80 bg-mossGreen-900/90 text-white",accent:"bg-mossGreen-400"},warning:{container:"border-warmAmberGlow-500/80 bg-warmAmberGlow-900/90 text-white",accent:"bg-warmAmberGlow-400"},error:{container:"border-sunsetCoral-500/80 bg-sunsetCoral-900/90 text-white",accent:"bg-sunsetCoral-400"},info:{container:"border-arcticBlue-500 bg-arcticBlue-900/90 text-white",accent:"bg-arcticBlue-400"}},bB=6e3;function vB({children:e}){const[t,r]=j.useState([]),n=j.useRef(new Map),o=j.useCallback(u=>{r(g=>g.filter(b=>b.id!==u));const f=n.current.get(u);f&&typeof window<"u"&&window.clearTimeout(f),n.current.delete(u)},[]),a=j.useCallback(({id:u,title:f,description:g,variant:b="info",duration:_=bB}={})=>{const O=u??`${Date.now()}-${Math.random().toString(16).slice(2)}`,S=u0[b]?b:"info";if(r(C=>[...C.filter(m=>m.id!==O),{id:O,title:f,description:g,variant:S}]),_!==null&&_!==1/0&&typeof window<"u"){const C=window.setTimeout(()=>{o(O)},_),w=n.current.get(O);w&&window.clearTimeout(w),n.current.set(O,C)}return O},[o]);j.useEffect(()=>()=>{typeof window>"u"||(n.current.forEach(u=>window.clearTimeout(u)),n.current.clear())},[]);const i=j.useMemo(()=>({showToast:a,dismissToast:o}),[a,o]);return T.jsxs(Ik.Provider,{value:i,children:[e,T.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-50 flex w-80 max-w-full flex-col gap-3",children:t.map(u=>{const f=u0[u.variant]??u0.info;return T.jsx("div",{className:`pointer-events-auto overflow-hidden rounded-lg border px-4 py-3 shadow-xl backdrop-blur ${f.container}`,children:T.jsxs("div",{className:"flex items-start gap-3",children:[T.jsx("span",{className:`mt-1 h-2 flex-shrink-0 w-2 rounded-full ${f.accent}`}),T.jsxs("div",{className:"flex-1",children:[u.title&&T.jsx("p",{className:"text-sm font-semibold",children:u.title}),u.description&&T.jsx("p",{className:"mt-1 text-sm leading-snug text-white/80",children:u.description})]}),T.jsx("button",{type:"button",onClick:()=>o(u.id),className:"ml-2 rounded-md p-1 text-xs uppercase tracking-wide text-white/60 transition hover:text-white/90",children:"Schließen"})]})},u.id)})})]})}function El(){const e=j.useContext(Ik);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}const Dk=j.createContext(null),yB={maintenance:null,update:null,script:null,ssh:null,loading:!0,error:"",lastUpdated:null};function wB({children:e}){var v,y;const[t,r]=j.useState(yB),n=j.useRef(null),o=j.useRef(!1),a=j.useCallback(E=>{r(P=>({...P,...E}))},[]),i=j.useCallback(async()=>{var E,P;a({loading:!0,error:""});try{const R=(await at.get("/api/maintenance/config")).data??{};a({maintenance:R.maintenance??null,update:R.update??null,script:R.script??null,ssh:R.ssh??null,loading:!1,error:"",lastUpdated:new Date})}catch(N){const R=((P=(E=N.response)==null?void 0:E.data)==null?void 0:P.error)||N.message||"Fehler beim Laden der Wartungsdaten";a({loading:!1,error:R})}},[a]),u=j.useCallback(async()=>{var E,P;try{const R=(await at.get("/api/maintenance/update-status")).data??{};r(M=>({...M,maintenance:R.maintenance??M.maintenance,update:R.update??M.update,error:""}))}catch(N){const R=((P=(E=N.response)==null?void 0:E.data)==null?void 0:P.error)||N.message||"Fehler beim Aktualisieren des Wartungsstatus";r(M=>({...M,error:R}))}},[]);j.useEffect(()=>{i()},[i]),j.useEffect(()=>{var E;if((E=t.update)!=null&&E.running){u();const P=setInterval(()=>{u()},5e3);return n.current=P,()=>clearInterval(P)}n.current&&(clearInterval(n.current),n.current=null)},[(v=t.update)==null?void 0:v.running,u]),j.useEffect(()=>{var P;const E=!!((P=t.update)!=null&&P.running);!E&&o.current&&i(),o.current=E},[(y=t.update)==null?void 0:y.running,i]);const f=j.useCallback(async(E={})=>{await at.post("/api/maintenance/portainer-update",E),await u()},[u]),g=j.useCallback(async E=>{await at.put("/api/maintenance/update-script",{script:E}),await i()},[i]),b=j.useCallback(async()=>{await at.delete("/api/maintenance/update-script"),await i()},[i]),_=j.useCallback(async E=>{await at.put("/api/maintenance/ssh-config",E),await i()},[i]),O=j.useCallback(async()=>{await at.delete("/api/maintenance/ssh-config"),await i()},[i]),S=j.useCallback(async({active:E,message:P}={})=>{var D;const N={active:!!E};P!==void 0&&(N.message=P);const M=((D=(await at.post("/api/maintenance/mode",N)).data)==null?void 0:D.maintenance)??null;return a({maintenance:M,error:""}),M},[a]),C=j.useCallback(async E=>(await at.post("/api/maintenance/test-ssh",E??{})).data,[]),w=j.useCallback(async()=>{const P=(await at.get("/api/auth/superuser/status")).data??{};return{exists:!!P.exists,user:P.user??null}},[]),m=j.useCallback(async()=>(await at.get("/api/setup/status")).data??{},[]),d=j.useCallback(async E=>(await at.delete(`/api/setup/endpoints/${E}`)).data??{success:!1},[]),l=j.useCallback(async E=>(await at.delete(`/api/setup/servers/${E}`)).data??{success:!1},[]),c=j.useCallback(async(E,P)=>(await at.put(`/api/setup/servers/${E}/api-key`,{apiKey:P})).data??{success:!1},[]),s=j.useCallback(async()=>(await at.delete("/api/auth/superuser")).data??{success:!1},[]),h=j.useMemo(()=>({maintenance:t.maintenance,update:t.update,script:t.script,ssh:t.ssh,loading:t.loading,error:t.error,lastUpdated:t.lastUpdated,refreshConfig:i,refreshUpdateStatus:u,setMaintenanceMode:S,triggerUpdate:f,saveScript:g,resetScript:b,saveSshConfig:_,deleteSshConfig:O,testSshConnection:C,fetchSuperuserStatus:w,fetchSetupStatus:m,deleteSetupEndpoint:d,deleteSetupServer:l,updateSetupApiKey:c,removeSuperuserAccount:s}),[t,i,u,S,f,g,b,_,O,C,w,m,d,l,c,s]);return T.jsx(Dk.Provider,{value:h,children:e})}function pi(){const e=j.useContext(Dk);if(!e)throw new Error("useMaintenance must be used within a MaintenanceProvider");return e}const xB=[{value:"10",label:"10"},{value:"25",label:"25"},{value:"50",label:"50"},{value:"100",label:"100"},{value:"all",label:"Alle"}],Ox="50",Lk=j.createContext(null),_B=(e,t)=>{const r=Number(e);if(Number.isFinite(r)&&r>0)return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:1};function CB({children:e,initialPage:t=1,initialPerPage:r=Ox,perPageOptions:n=xB}){const[o,a]=j.useState(t),[i,u]=j.useState(r),[f,g]=j.useState(0),[b,_]=j.useState(0),O=j.useRef(t),S=j.useRef(r),C=j.useMemo(()=>new Set(n.map(R=>String(R.value))),[n]),w=i==="all",m=j.useCallback(()=>w?null:_B(i,r),[i,w,r]),d=j.useCallback((R,M)=>{g(Math.max(0,Number(R)||0)),_(Math.max(0,Number(M)||0))},[]),l=j.useCallback(()=>{a(O.current??1),u(S.current??Ox),g(0),_(0)},[]),c=j.useCallback((R,{resetPage:M=!0}={})=>{if(R==null)return;const D=String(R);C.has(D)&&(u(D),M&&a(1))},[C]),s=j.useCallback(R=>{var D;const M=typeof R=="string"?R:(D=R==null?void 0:R.target)==null?void 0:D.value;c(M,{resetPage:!0})},[c]),h=j.useCallback(R=>{if(w)return;const M=Number(R);if(!Number.isFinite(M)||M<1)return;const D=m();if(!D)return;const L=Math.max(1,Math.ceil((f||0)/D));M>L||a(M)},[w,m,f]),v=j.useMemo(()=>{if(w)return 1;const R=m();return R?Math.max(1,Math.ceil((f||0)/R)):1},[w,m,f]),y=j.useMemo(()=>{if(!f)return 0;if(w)return 1;const R=m();return(o-1)*R+1},[f,w,m,o]),E=j.useMemo(()=>{if(!f)return 0;if(w)return f;const R=m(),M=(o-1)*R+(b||R);return Math.min(f,M)},[f,w,m,o,b]),P=j.useMemo(()=>f?w?`Zeige alle ${f.toLocaleString()} Einträge`:`Zeige ${y.toLocaleString()} – ${E.toLocaleString()} von ${f.toLocaleString()} Einträgen`:"Keine Einträge",[f,w,y,E]),N=j.useMemo(()=>({page:o,perPage:i,perPageOptions:n,perPageIsAll:w,totalItems:f,visibleItems:b,totalPages:v,rangeStart:y,rangeEnd:E,summaryLabel:P,setPage:a,setPerPage:c,setTotals:d,setTotalItems:g,setVisibleItems:_,handlePageChange:h,handlePerPageChange:s,validPerPageValues:C,resetPagination:l}),[o,i,n,w,f,b,v,y,E,P,d,c,h,s,C,l]);return T.jsx(Lk.Provider,{value:N,children:e})}function bu(){const e=j.useContext(Lk);if(!e)throw new Error("usePage must be used within a PageProvider");return e}function jf({disabled:e=!1}){const{summaryLabel:t,perPageIsAll:r,page:n,totalPages:o,handlePageChange:a}=bu();return T.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T.jsx("span",{children:t}),!r&&T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("button",{onClick:()=>a(n-1),disabled:e||n<=1,className:"rounded-md border border-slate-300 p-2.5 text-center text-sm transition-all shadow-sm hover:shadow-lg text-slate-600 hover:text-white hover:bg-slate-800 hover:border-slate-800 focus:text-white focus:bg-slate-800 focus:border-slate-800 active:border-slate-800 active:text-white active:bg-slate-800 disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none",type:"button",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4",children:T.jsx("path",{d:"M11.03 3.97a.75.75 0 0 1 0 1.06l-6.22 6.22H21a.75.75 0 0 1 0 1.5H4.81l6.22 6.22a.75.75 0 1 1-1.06 1.06l-7.5-7.5a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 0 1 1.06 0Z"})})}),T.jsxs("p",{className:"text-slate-600",children:["Seite ",T.jsx("strong",{className:"text-slate-800",children:n})," / ",T.jsx("strong",{className:"text-slate-800",children:o})]}),T.jsx("button",{onClick:()=>a(n+1),disabled:e||n>=o,className:"rounded-md border border-slate-300 p-2.5 text-center text-sm transition-all shadow-sm hover:shadow-lg text-slate-600 hover:text-white hover:bg-slate-800 hover:border-slate-800 focus:text-white focus:bg-slate-800 focus:border-slate-800 active:border-slate-800 active:text-white active:bg-slate-800 disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none",type:"button",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4",children:T.jsx("path",{d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z"})})})]})]})}const oc="stackSelectionPreference",SB=30*1e3,TB=30*1e3;let Wa={data:null,timestamp:0},ac=null;const ht={QUEUED:"queued",STARTED:"started",SUCCESS:"success",ERROR:"error",INFO:"info"},OB={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},PB=()=>!!Wa.data&&Date.now()-Wa.timestamp{Wa={data:e,timestamp:Date.now()}},kB=e=>Array.isArray(e)?[...e].sort((t,r)=>((t==null?void 0:t.Name)||"").localeCompare((r==null?void 0:r.Name)||"")):[];function EB(){const[e,t]=j.useState(()=>kB(Wa.data)),[r,n]=j.useState(()=>!Wa.data),[o,a]=j.useState(""),[i,u]=j.useState([]),[f,g]=j.useState("all"),[b,_]=j.useState(""),[O,S]=j.useState(!1),[C,w]=j.useState(!1),[m,d]=j.useState(!1),{showToast:l}=El(),{maintenance:c,update:s,script:h,ssh:v}=pi(),y=!!(c!=null&&c.active),E=c==null?void 0:c.message,P=!!(s!=null&&s.running),N=y||P,R=s!=null&&s.stage?OB[s.stage]??s.stage:"–",{page:M,perPage:D,perPageOptions:L,setPage:W,setTotals:U,handlePerPageChange:Y,resetPagination:$}=bu(),z=j.useCallback(()=>{},[]);j.useEffect(()=>()=>$(),[$]),j.useEffect(()=>{N&&(n(!1),t([]),u([]))},[N]);const H=j.useRef(new Map),G=j.useCallback((te,ge)=>{const _e=new Map(te.map(Ce=>[Ce.Id,Ce]));return[...ge].sort((Ce,we)=>Ce.Name.localeCompare(we.Name)).map(Ce=>{const we=_e.get(Ce.Id);if(we&&we.updateStatus==="✅"&&Ce.updateStatus==="⚠️"){const et=Ce.Name?`${Ce.Name} (ID: ${Ce.Id})`:`Stack ${Ce.Id}`;l({variant:"warning",title:"Aktualisierung gefunden",description:et})}let Ie=Ce.redeployPhase??(we==null?void 0:we.redeployPhase)??null;!Ie&&(Ce.redeploying||we!=null&&we.redeploying)&&(Ie=ht.STARTED);const Ue=Ie===ht.QUEUED,Ze=Ie===ht.STARTED;return{...Ce,redeployPhase:Ie,redeployQueued:Ue,redeploying:Ue||Ze,redeployDisabled:Ce.redeployDisabled??(we==null?void 0:we.redeployDisabled)??!1,duplicateName:Ce.duplicateName??(we==null?void 0:we.duplicateName)??!1}})},[l]);j.useEffect(()=>{const te=Dc("/",{path:"/socket.io",transports:["websocket"]});return console.log("🔌 Socket connected"),te.on("redeployStatus",async(ge={})=>{const{stackId:_e}=ge;if(!_e)return;let Pe=_e;if(typeof _e=="string"){const et=Number(_e);Number.isNaN(et)||(Pe=et)}const Ce=ge.redeployPhase??ge.phase;let we=Ce;we?Ce==="started"||Ce==="running"?we=ht.STARTED:Ce==="queued"?we=ht.QUEUED:Ce==="success"?we=ht.SUCCESS:Ce==="error"?we=ht.ERROR:Ce==="info"&&(we=ht.INFO):ge.isRedeploying===!0?we=ht.STARTED:ge.isRedeploying===!1&&(we=ht.SUCCESS);const Ie=H.current.get(Pe)??H.current.get(String(Pe)),Ue=ge.stackName??(Ie==null?void 0:Ie.Name),Ze=Ue?`${Ue} (ID: ${Pe})`:`Stack ${Pe}`;if(console.log(`🔄 Stack ${Pe} Redeploy Update: ${we??"unbekannt"}`),we===ht.STARTED)l({variant:"info",title:"Redeploy gestartet",description:Ze});else if(we===ht.SUCCESS)l({variant:"success",title:"Redeploy abgeschlossen",description:Ze});else if(we===ht.ERROR){const et=ge.message?` – ${ge.message}`:"";l({variant:"error",title:"Redeploy fehlgeschlagen",description:`${Ze}${et}`})}if(t(et=>et.map(Xt=>{if(String(Xt.Id)!==String(Pe))return Xt;const qt=we??Xt.redeployPhase??null,Et=qt===ht.QUEUED,tr=qt===ht.STARTED,Jt=qt===ht.SUCCESS,Nt=qt===ht.ERROR,Nr=Et||tr,bt={...Xt,redeployPhase:qt,redeployQueued:Et,redeploying:Nr};return Jt&&(bt.updateStatus="✅",bt.redeploying=!1,bt.redeployQueued=!1),Nt&&(bt.redeploying=!1,bt.redeployQueued=!1),!Nr&&!Jt&&!Nt&&we===void 0&&(bt.redeploying=!1,bt.redeployQueued=!1,bt.redeployPhase=Xt.redeployPhase??null),bt})),we===ht.SUCCESS||we===ht.ERROR||ge.isRedeploying===!1&&!we)try{const et=await at.get("/api/stacks");Px(et.data),t(Xt=>G(Xt,et.data))}catch(et){console.error("Fehler beim Aktualisieren nach Redeploy:",et)}}),()=>te.disconnect()},[]);const X=j.useCallback(async({force:te=!1,silent:ge=!1}={})=>{if(y||P){ge||n(!1);return}const _e=!!Wa.data;if(!te&&_e&&(t(Ce=>G(Ce,Wa.data)),!ge&&(n(!1),PB())))return;const Pe=!ge&&(!_e||te);Pe&&n(!0);try{(te||!ac)&&(ac=at.get("/api/stacks").then(we=>(Px(we.data),we.data)).finally(()=>{ac=null}));const Ce=await ac;t(we=>G(we,Ce)),a("")}catch(Ce){console.error("❌ Fehler beim Abrufen der Stacks:",Ce),!_e&&!ge&&a("Fehler beim Laden der Stacks")}finally{Pe&&n(!1)}},[y,P,G]);j.useEffect(()=>{X()},[X]),j.useEffect(()=>{if(typeof document>"u"||y||P)return;const te=setInterval(()=>{document.hidden||X({force:!0,silent:!0})},TB);return()=>clearInterval(te)},[X,y,P]),j.useEffect(()=>{if(typeof document>"u"||y||P)return;const te=()=>{document.hidden||X({force:!0,silent:!0})};return document.addEventListener("visibilitychange",te),()=>{document.removeEventListener("visibilitychange",te)}},[X,y,P]),j.useEffect(()=>{u(te=>{const ge=te.filter(_e=>{const Pe=e.find(we=>we.Id===_e);if(!Pe||Pe.updateStatus==="✅"||Pe.redeployDisabled)return!1;const Ce=Pe.redeployPhase;return!(Ce===ht.STARTED||Ce===ht.QUEUED)});return ge.length===te.length?te:ge})},[e]),j.useEffect(()=>{const te=new Map;e.forEach(ge=>{te.set(ge.Id,ge),te.set(String(ge.Id),ge)}),H.current=te},[e]);const ie=b.trim().toLowerCase(),fe=j.useMemo(()=>e.filter(te=>!(f==="current"&&te.updateStatus!=="✅"||f==="outdated"&&te.updateStatus==="✅"||ie&&!`${te.Name??""} ${te.Id??""}`.toLowerCase().includes(ie))),[e,f,ie]),pe=j.useMemo(()=>fe.filter(te=>{if(te.updateStatus==="✅"||te.redeployDisabled)return!1;const ge=te.redeployPhase;return!(ge===ht.STARTED||ge===ht.QUEUED)}),[fe]),oe=j.useMemo(()=>{const te=new Map;return e.forEach(ge=>{te.set(ge.Id,ge)}),te},[e]);j.useMemo(()=>new Set(fe.map(te=>te.Id)),[fe]);const se=j.useMemo(()=>{if(D==="all")return fe;const te=Number(D),ge=(M-1)*te;return fe.slice(ge,ge+te)},[fe,D,M]);j.useEffect(()=>{U(fe.length,se.length)},[fe.length,se.length,U]);const ee=j.useRef({action:"keep",remember:!1}),ae=j.useRef({status:f,search:ie}),ue=j.useRef(!1);j.useEffect(()=>{if(!(typeof window>"u"))try{const te=window.sessionStorage.getItem(oc);if(!te)return;const ge=JSON.parse(te);ge&&(ge.action==="keep"||ge.action==="clear")&&(ee.current={action:ge.action,remember:!0},d(!0))}catch(te){console.error("⚠️ Konnte gespeicherte Auswahl-Einstellung nicht laden:",te),ee.current={action:"keep",remember:!1}}},[]),j.useEffect(()=>{const te=ie;if(!ue.current){ue.current=!0,ae.current={status:f,search:te};return}const ge=ae.current;if(!(ge.status!==f||ge.search!==te)){f==="all"&&te.length===0&&O&&S(!1);return}if(ae.current={status:f,search:te},i.length===0){S(!1);return}if(!(f!=="all"||te.length>0)){S(!1);return}const Ce=ee.current;if(Ce!=null&&Ce.remember){Ce.action==="clear"&&u([]),S(!1);return}w(!!(Ce!=null&&Ce.remember)),S(!0)},[f,ie,i.length,O]),j.useEffect(()=>{i.length===0&&O&&S(!1)},[i.length,O]);const de=f!=="all"||ie.length>0;j.useEffect(()=>{W(1)},[f,ie,W]),j.useEffect(()=>{if(D==="all"){M!==1&&W(1);return}const te=Number(D)||1,ge=Math.max(1,Math.ceil(fe.length/te));M>ge&&W(ge)},[fe.length,D,M,W]);const Te=(te,ge)=>{ge||u(_e=>_e.includes(te)?_e.filter(Pe=>Pe!==te):[..._e,te])},xe=te=>{const ge=C;if(typeof window<"u")try{if(ge){const _e={action:te,remember:!0};window.sessionStorage.setItem(oc,JSON.stringify(_e)),ee.current=_e}else window.sessionStorage.removeItem(oc),ee.current={action:te,remember:!1}}catch(_e){console.error("⚠️ Konnte Auswahl-Einstellung nicht speichern:",_e),ee.current={action:te,remember:!1}}else ee.current={action:te,remember:!1};d(ge),w(ge),te==="clear"&&u([]),S(!1)},be=()=>{if(typeof window<"u")try{window.sessionStorage.removeItem(oc)}catch(te){console.error("⚠️ Konnte gespeicherte Auswahl-Einstellung nicht löschen:",te)}ee.current={action:"keep",remember:!1},d(!1),w(!1),de&&i.length>0&&S(!0)},Se=()=>{u([]),S(!1)},je=te=>{u(ge=>ge.filter(_e=>_e!==te))},qe=async te=>{const ge=H.current.get(te),_e=ge==null?void 0:ge.redeployPhase;if(!(_e===ht.STARTED||_e===ht.QUEUED)){u(Pe=>Pe.filter(Ce=>Ce!==te)),t(Pe=>Pe.map(Ce=>Ce.Id===te?{...Ce,redeployPhase:ht.STARTED,redeploying:!0,redeployQueued:!1}:Ce));try{await at.put(`/api/stacks/${te}/redeploy`)}catch(Pe){if(console.error("❌ Fehler beim Redeploy:",Pe),t(Ce=>Ce.map(we=>we.Id===te?{...we,redeployPhase:null,redeploying:!1,redeployQueued:!1}:we)),!Pe.response){const Ce=H.current.get(te),we=Ce!=null&&Ce.Name?`${Ce.Name} (ID: ${te})`:`Stack ${te}`,Ie=Pe.message||"Unbekannter Fehler";l({variant:"error",title:"Redeploy fehlgeschlagen",description:`${we} – ${Ie}`})}}}},nt=async()=>{var _e,Pe;if(!pe.length)return;const te=pe.map(Ce=>Ce.Id),ge=new Set(te.map(Ce=>String(Ce)));t(Ce=>Ce.map(we=>{const Ie=String(we.Id);return ge.has(Ie)?{...we,redeployPhase:ht.QUEUED,redeploying:!0,redeployQueued:!0}:we}));try{de?await at.put("/api/stacks/redeploy-selection",{stackIds:te}):await at.put("/api/stacks/redeploy-all"),u(Ce=>Ce.filter(we=>!ge.has(String(we))))}catch(Ce){console.error("❌ Fehler beim Redeploy ALL:",Ce),t(Ie=>Ie.map(Ue=>{const Ze=String(Ue.Id);return ge.has(Ze)?{...Ue,redeployPhase:null,redeploying:!1,redeployQueued:!1}:Ue}));const we=((Pe=(_e=Ce.response)==null?void 0:_e.data)==null?void 0:Pe.error)||Ce.message||"Unbekannter Fehler";l({variant:"error",title:"Redeploy ALL fehlgeschlagen",description:we})}},ut=async()=>{var _e,Pe;if(!i.length)return;const te=i.filter(Ce=>{const we=e.find(Ue=>Ue.Id===Ce);if(!we||we.updateStatus==="✅"||we.redeployDisabled)return!1;const Ie=we.redeployPhase;return!(Ie===ht.STARTED||Ie===ht.QUEUED)});if(!te.length){u([]);return}const ge=new Set(te);t(Ce=>Ce.map(we=>ge.has(we.Id)?{...we,redeployPhase:ht.QUEUED,redeploying:!0,redeployQueued:!0}:we));try{await at.put("/api/stacks/redeploy-selection",{stackIds:te}),u(Ce=>Ce.filter(we=>!ge.has(we)))}catch(Ce){console.error("❌ Fehler beim Redeploy Auswahl:",Ce),t(Ie=>Ie.map(Ue=>ge.has(Ue.Id)?{...Ue,redeployPhase:null,redeploying:!1,redeployQueued:!1}:Ue));const we=((Pe=(_e=Ce.response)==null?void 0:_e.data)==null?void 0:Pe.error)||Ce.message||"Unbekannter Fehler";l({variant:"error",title:"Redeploy Auswahl fehlgeschlagen",description:we})}},Ye=i.length>0,rt=pe.length>0,Je=Ye?`Redeploy Auswahl (${i.length})`:"Redeploy Alle",Ve=N||(Ye?O||i.length===0||i.every(te=>{const ge=e.find(Pe=>Pe.Id===te);if(!ge||ge.updateStatus==="✅"||ge.redeployDisabled)return!0;const _e=ge.redeployPhase;return _e===ht.STARTED||_e===ht.QUEUED}):!rt),me=()=>{if(N){l({variant:"warning",title:"Wartungsmodus aktiv",description:"Redeploy-Aktionen sind während des Wartungsmodus deaktiviert."});return}Ye?ut():nt()};return T.jsxs("div",{className:"mt-12 mb-8 flex flex-col gap-12",children:[(y||P)&&T.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:T.jsxs("div",{className:"flex flex-col gap-1",children:[T.jsxs("span",{children:["Wartungsmodus aktiv",E?` – ${E}`:P?" – Portainer-Update läuft":"","."]}),P&&T.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",R]})]})}),T.jsxs(Q.Card,{children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"p-4 pt-2 pb-2",children:!r&&!o?T.jsx(Q.Typography,{variant:"h6",color:"white",children:T.jsx("span",{className:"flex items-center gap-2",children:T.jsx("span",{children:"Filter und Optionen"})})}):T.jsx(Q.Typography,{variant:"h6",color:"white",children:T.jsx("span",{className:"flex items-center gap-2",children:T.jsx("span",{children:"Lade Stacks"})})})}),T.jsxs(Q.CardBody,{children:[r?T.jsxs("p",{className:"flex py-6 text-center text-sm font-medium text-gray-400",children:[T.jsx(Q.Spinner,{className:"mr-2 h-4 w-4 flex"}),"Lade Stacks..."]}):o?T.jsx("p",{className:"py-6 text-sm font-medium text-red-400",children:o}):T.jsxs("div",{className:"gap-4",children:[T.jsx("div",{className:"w-full",children:T.jsxs(Q.ButtonGroup,{fullWidth:!0,children:[T.jsx(Q.Button,{onClick:()=>g("all"),children:"Alle"}),T.jsx(Q.Button,{onClick:()=>g("current"),children:"Aktuell"}),T.jsx(Q.Button,{onClick:()=>g("outdated"),children:"Veraltet"})]})}),T.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between mt-8",children:[T.jsx("div",{className:"md:flex-1",children:T.jsx(Q.Input,{value:b,onChange:te=>_(te.target.value),variant:"static",placeholder:"Name oder ID"})}),T.jsx("div",{className:"md:mt-0 mt-8 md:flex-1",children:T.jsx(Q.Select,{variant:"static",label:"Einträge pro Seite",onChange:z,value:D,children:L.map(({value:te,label:ge})=>T.jsx(Q.Option,{value:te,onClick:()=>Y(te),children:ge},te))})})]}),T.jsx("div",{className:"flex items-center justify-end gap-3 mt-5",children:m&&T.jsx("button",{onClick:be,className:"block antialiased font-sans text-sm leading-normal text-inherit text-xs font-medium text-warmAmberGlow-500 underline underline-offset-2 transition hover:text-warmAmberGlow-600",children:"Gespeicherte Entscheidung löschen"})})]}),O&&T.jsx("div",{className:"flex flex-col mt-5",children:T.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-arcticBlue-800 bg-arcticBlue-900/90 px-4 py-3 text-arcticBlue-100 md:flex-row md:items-center md:justify-between",children:[T.jsxs("div",{className:"space-y-2 block antialiased font-sans text-sm font-light leading-normal text-inherit",children:[T.jsxs("p",{children:[i.length===1?"1 Stack ist weiterhin ausgewählt.":`${i.length} Stacks sind weiterhin ausgewählt.`," ","Soll die Auswahl entfernt werden?"]}),T.jsxs("label",{className:"flex items-center gap-2",children:[T.jsx("input",{type:"checkbox",checked:C,onChange:te=>w(te.target.checked),className:"h-4 w-4 rounded border border-arcticBlue-400 bg-arcticBlue-900 text-arcticBlue-400 focus:ring-arcticBlue-300"}),T.jsx("span",{className:"text-xs",children:"Einstellung merken (bis Browser geschlossen wird)"})]})]}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx(Q.Button,{onClick:()=>xe("keep"),className:"rounded-md border border-arcticBlue-600 bg-arcticBlue-700 px-4 py-2 font-sans font-bold text-center uppercase transition-all hover:bg-arcticBlue-800",children:"Auswahl behalten"}),T.jsx(Q.Button,{onClick:()=>xe("clear"),className:"rounded-md border border-sunsetCoral-500 bg-sunsetCoral-600 px-4 py-2 font-sans font-bold text-center uppercase transition-all hover:bg-sunsetCoral-600",children:"Auswahl entfernen"})]})]})}),T.jsxs("div",{id:"collect",className:"mt-8 flex flex-col gap-4 md:flex-row md:items-start md:gap-6",children:[i.length>0&&T.jsx("div",{className:"w-full md:order-first order-last md:w-3/4",children:T.jsxs("div",{className:"flex flex-col gap-3 text-sm text-gray-300",children:[T.jsx("div",{className:"flex flex-wrap items-center gap-2",children:i.map(te=>{const ge=oe.get(te),_e=(ge==null?void 0:ge.Name)||`Stack ${te}`;return T.jsxs("button",{type:"button",onClick:()=>je(te),className:"inline-flex items-center gap-2 rounded-full bg-lavenderSmoke-600/80 px-2 py-0.5 text-white transition hover:bg-lavenderSmoke-600/90 focus:outline-none focus:ring-2 focus:ring-lavenderSmoke-400 cursor-pointer",children:[T.jsx("span",{children:_e}),T.jsx("span",{className:"text-xs font-semibold text-lavenderSmoke-200",children:"x"})]},te)})}),T.jsx("button",{type:"button",onClick:Se,className:"md:order-last self-start mt-1 text-xs font-medium text-gray-400 underline underline-offset-2 transition hover:text-gray-200",children:"Auswahl aufheben"})]})}),T.jsx("div",{className:"w-full md:w-1/4 md:ml-auto",children:T.jsx(Q.Button,{className:"w-full bg-arcticBlue-500 hover:bg-arcticBlue-600",onClick:me,disabled:Ve,children:Je})})]})]})]}),T.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:se.map(te=>{const ge=te.redeployPhase,_e=ge===ht.QUEUED,Pe=ge===ht.STARTED,Ce=_e||Pe,we=i.includes(te.Id),Ie=te.updateStatus==="✅",Ue=!!te.redeployDisabled,Ze=!Ce&&!Ie&&!Ue;return T.jsx(Q.Card,{children:T.jsxs(Q.CardBody,{className:`flex w-full text-stormGrey-500 items-center justify-between gap-4 rounded-xl shadow-lg transition border ${we?"border-purple-500 ring-1 ring-purple-500/40":"border-transparent"} ${!Ze||Ce?"opacity-75 bg-stormGrey-200/20":""}`,children:[T.jsxs("div",{className:"flex items-center space-x-4",id:"left",children:[T.jsx("input",{type:"checkbox",checked:we,onChange:()=>Te(te.Id,!Ze),className:`h-5 w-5 text-purple-500 focus:ring-purple-400 border-gray-600 bg-gray-900 rounded ${Ze?"":"opacity-40 cursor-not-allowed"}`,disabled:!Ze}),T.jsx("div",{className:`w-12 h-12 flex items-center justify-center rounded-full ${te.updateStatus==="✅"?"bg-mossGreen-600":te.updateStatus==="⚠️"?"bg-warmAmberGlow-400":"bg-sunsetCoral-500"}`}),T.jsxs("div",{children:[T.jsx("p",{className:"text-lg antialiased font-sans font-semibold leading-normal text-inherit",children:te.Name}),T.jsxs("p",{className:"text-sm antialiased font-sans font-light leading-normal text-inherit",children:["ID: ",te.Id]}),te.duplicateName&&T.jsx("p",{className:"text-xs text-amber-700",children:"⚠️ Doppelter Name erkannt"})]})]}),T.jsx("div",{className:"ml-auto flex flex-col items-end gap-1 text-sm",id:"right",children:Pe?T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"antialiased font-sans font-light leading-normal text-xs uppercase tracking-wide text-warmAmberGlow-600",children:"Redeploy"}),T.jsx("span",{className:"text-warmAmberGlow-500",children:"läuft…"})]}):_e?T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"antialiased font-sans font-light leading-normal text-xs uppercase tracking-wide text-warmAmberGlow-600",children:"Redeploy"}),T.jsx("span",{className:"text-warmAmberGlow-500",children:"in Warteliste…"})]}):Ue?T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"antialiased font-sans font-light leading-normal text-xs uppercase tracking-wide text-stormGrey-500",children:"System"}),T.jsx("span",{className:"text-gray-300",children:"Redeploy deaktiviert"})]}):Ie?T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"antialiased font-sans font-light leading-normal text-xs uppercase tracking-wide text-stormGrey-500",children:"Status"}),T.jsx("span",{className:"text-mossGreen-600",children:"Aktuell"})]}):T.jsx(Q.Button,{onClick:()=>qe(te.Id),disabled:Ce,className:"disabled:opacity-50 disabled:cursor-not-allowed",children:"Redeploy"})})]})},te.Id)})}),T.jsx(jf,{disabled:r||!!o})]})}const NB={idle:"Bereit",running:"Läuft",success:"Erfolgreich",error:"Fehlgeschlagen"},es={idle:"bg-stormGrey-700 text-gray-200",running:"bg-arcticBlue-600 text-white",success:"bg-mossGreen-600 text-white",error:"bg-sunsetCoral-600 text-white"},jB={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},RB={info:"text-arcticBlue-700",success:"text-mossGreen-700",warning:"text-warmAmberGlow-700",error:"text-sunsetCoral-700",stdout:"text-stormGrey-700",stderr:"text-warmAmberGlow-700",debug:"text-lavenderSmoke-700"},AB=e=>{if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString("de-DE",{hour:"2-digit",minute:"2-digit",second:"2-digit"})},Ma=e=>{if(!e&&e!==0)return"-";const r=(n=>{if(n instanceof Date)return n;if(typeof n=="number"){const o=n>1e12?n:n*1e3;return new Date(o)}if(typeof n=="string"){const o=Number(n);if(!Number.isNaN(o)){const a=o>1e12?o:o*1e3;return new Date(a)}return new Date(n)}return null})(e);return!r||Number.isNaN(r.getTime())?String(e):r.toLocaleString("de-DE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})},kx=e=>e===1?"Git":e===2?"Compose":e??"-",c0=()=>({host:"",port:"22",username:"",password:"",extraSshArgs:""});function MB(){var Xn,Ea,Rl;const{showToast:e}=El(),{maintenance:t,update:r,script:n,ssh:o,loading:a,error:i,setMaintenanceMode:u,triggerUpdate:f,saveScript:g,resetScript:b,saveSshConfig:_,deleteSshConfig:O,testSshConnection:S,fetchSuperuserStatus:C,fetchSetupStatus:w,deleteSetupEndpoint:m,deleteSetupServer:d,updateSetupApiKey:l,removeSuperuserAccount:c}=pi(),s=!!(t!=null&&t.active),h=t==null?void 0:t.message,v=(Xn=t==null?void 0:t.extra)==null?void 0:Xn.type,y=!!(r!=null&&r.running),[E,P]=j.useState(""),[N,R]=j.useState(!1),[M,D]=j.useState(!1),[L,W]=j.useState(""),[U,Y]=j.useState(!1),[$,z]=j.useState(()=>c0()),[H,G]=j.useState(!1),[X,ie]=j.useState(!1),[fe,pe]=j.useState(!1),[oe,se]=j.useState(!1),[ee,ae]=j.useState(!1),[ue,de]=j.useState(null);j.useEffect(()=>{if(!n)return;const he=n.custom??n.default??n.effective??"";P(he)},[n]),j.useEffect(()=>{if(!o){z(c0()),G(!1),ie(!1),de(null);return}z({host:o.host??"",port:String(o.port??"22"),username:o.username??"",password:"",extraSshArgs:Array.isArray(o.extraSshArgs)?o.extraSshArgs.join(` `):""}),G(!!o.passwordStored),ie(!1),de(null)},[o]);const Te=j.useMemo(()=>n?n.source==="custom"&&typeof n.custom=="string"?n.custom:n.default??n.effective??"":"",[n]),xe=n?E!==Te:!1,be=(n==null?void 0:n.source)==="custom"?"Benutzerdefiniert":"Standard",[Se,je]=j.useState(!0),[qe,nt]=j.useState(!1),[ut,Ye]=j.useState(null),[rt,Je]=j.useState(""),[Ve,me]=j.useState(!1),[te,ge]=j.useState(null),[_e,Pe]=j.useState(!0),[Ce,we]=j.useState(""),[Ie,Ue]=j.useState({}),[Ze,Bt]=j.useState(null),[et,Xt]=j.useState(null),[qt,Et]=j.useState(null),[tr,Jt]=j.useState([]),[Nt,Nr]=j.useState(!0),[bt,Gt]=j.useState(""),[On,Gn]=j.useState(!1),[fo,Kr]=j.useState(null),[Kn,wr]=j.useState(null),Yr=j.useRef(null),[pt,po]=j.useState(null),[Z,Oe]=j.useState(!0),[Re,_t]=j.useState(""),[jt,vt]=j.useState(!1),[Ct,cr]=j.useState(null),lt=j.useRef(null),xr=j.useCallback(async({silent:he=!1}={})=>{var Ne,Ae;je(!0),Je("");try{const Me=await C(),Ke=!!(Me!=null&&Me.exists);nt(Ke),Ye(Ke?Me.user??null:null)}catch(Me){const Ke=((Ae=(Ne=Me.response)==null?void 0:Ne.data)==null?void 0:Ae.error)||Me.message||"Superuser-Status konnte nicht geladen werden";nt(!1),Ye(null),Je(Ke),he||e({variant:"error",title:"Statusabfrage fehlgeschlagen",description:Ke})}finally{je(!1)}},[C,e]),Zt=j.useCallback(async({silent:he=!1}={})=>{var Ne,Ae;he||Pe(!0),we("");try{const Me=await w();ge(Me),Ue({})}catch(Me){const Ke=((Ae=(Ne=Me.response)==null?void 0:Ne.data)==null?void 0:Ae.error)||Me.message||"Setup-Daten konnten nicht geladen werden";we(Ke),he||e({variant:"error",title:"Setup-Daten",description:Ke})}finally{Pe(!1)}},[w,e]),ar=j.useCallback(async({silent:he=!1}={})=>{if(lt.current)return lt.current;const Ne=(async()=>{var Ae,Me;he?vt(!0):Oe(!0),_t("");try{const Tt=(await at.get("/api/maintenance/portainer-status")).data??{};po(Tt),cr(new Date)}catch(Ke){const Tt=((Me=(Ae=Ke.response)==null?void 0:Ae.data)==null?void 0:Me.error)||Ke.message||"Fehler beim Prüfen des Portainer-Status";_t(Tt),e({variant:"error",title:"Statusaktualisierung fehlgeschlagen",description:Tt})}finally{he?vt(!1):Oe(!1),lt.current=null}})();return lt.current=Ne,Ne},[e]),Fr=j.useCallback(async({silent:he=!1}={})=>{if(s||y){Jt([]),Gt("Wartungsmodus aktiv – Duplikat-Verwaltung ist vorübergehend deaktiviert."),Nr(!1),Gn(!1);return}if(Yr.current)return Yr.current;const Ne=(async()=>{var Ae,Me,Ke;he?Gn(!0):Nr(!0),Gt("");try{const wt=(await at.get("/api/maintenance/duplicates")).data,Yt=Array.isArray(wt)?wt:(wt==null?void 0:wt.items)??[];Jt(Yt),wr(new Date)}catch(Tt){if(((Ae=Tt.response)==null?void 0:Ae.status)===423){const wt="Wartungsmodus aktiv – Duplikat-Verwaltung ist vorübergehend deaktiviert.";Jt([]),Gt(wt),e({variant:"warning",title:"Duplikat-Verwaltung gesperrt",description:wt})}else{const wt=((Ke=(Me=Tt.response)==null?void 0:Me.data)==null?void 0:Ke.error)||Tt.message||"Fehler beim Laden der Wartungsdaten";Gt(wt),e({variant:"error",title:"Duplikate konnten nicht geladen werden",description:wt})}}finally{he?Gn(!1):Nr(!1),Yr.current=null}})();return Yr.current=Ne,Ne},[s,y,e]);j.useEffect(()=>{xr({silent:!0})},[xr]),j.useEffect(()=>{Zt()},[Zt]),j.useEffect(()=>{ar()},[ar]),j.useEffect(()=>{Fr()},[Fr]);const Pn=j.useMemo(()=>{var he;return((he=te==null?void 0:te.servers)==null?void 0:he.items)??[]},[te]),Qr=j.useMemo(()=>{var he;return((he=te==null?void 0:te.endpoints)==null?void 0:he.items)??[]},[te]),Sa=j.useMemo(()=>{var Ne;const he=((Ne=te==null?void 0:te.apiKeys)==null?void 0:Ne.items)??[];return new Map(he.map(Ae=>[Ae.serverId,Ae]))},[te]),Ta=j.useMemo(()=>!!(te!=null&&te.setupComplete),[te]),Yn=j.useMemo(()=>{const he=Array.isArray(tr)?tr.length:0,Ne=Array.isArray(tr)?tr.reduce((Ae,Me)=>{var Ke;return Ae+(((Ke=Me==null?void 0:Me.duplicates)==null?void 0:Ke.length)||0)},0):0;return{groups:he,duplicateCount:Ne}},[tr]),Xr=j.useCallback((he,Ne)=>{z(Ae=>({...Ae,[he]:Ne})),he==="password"&&G(!1)},[]),Qn=j.useMemo(()=>{const he={host:$.host.trim(),port:Number.parseInt($.port,10)||22,username:$.username.trim(),extraSshArgs:($.extraSshArgs||"").split(/\r?\n/).map(Ae=>Ae.trim()).filter(Boolean)},Ne=$.password??"";return Ne?he.password=Ne:H||(he.password=""),he},[$,H]),hi=j.useCallback(async()=>{var he,Ne;if(n)try{R(!0),await g(E),e({variant:"success",title:"Skript gespeichert",description:"Das benutzerdefinierte Portainer-Update-Skript wurde aktualisiert."})}catch(Ae){const Me=((Ne=(he=Ae.response)==null?void 0:he.data)==null?void 0:Ne.error)||Ae.message||"Skript konnte nicht gespeichert werden";e({variant:"error",title:"Speichern fehlgeschlagen",description:Me})}finally{R(!1)}},[g,E,n,e]),ho=j.useCallback(async()=>{var he,Ne;try{R(!0),await b(),e({variant:"info",title:"Standardskript wiederhergestellt",description:"Es wird wieder das Standard-Update-Skript verwendet."})}catch(Ae){const Me=((Ne=(he=Ae.response)==null?void 0:he.data)==null?void 0:Ne.error)||Ae.message||"Standardskript konnte nicht wiederhergestellt werden";e({variant:"error",title:"Zurücksetzen fehlgeschlagen",description:Me})}finally{R(!1)}},[b,e]),Do=j.useCallback(async()=>{var he,Ne;try{pe(!0),await _(Qn),de(null),ie(!1),e({variant:"success",title:"SSH-Konfiguration gespeichert",description:"Verbindungseinstellungen wurden aktualisiert."})}catch(Ae){const Me=((Ne=(he=Ae.response)==null?void 0:he.data)==null?void 0:Ne.error)||Ae.message||"SSH-Konfiguration konnte nicht gespeichert werden";e({variant:"error",title:"Speichern fehlgeschlagen",description:Me})}finally{pe(!1)}},[Qn,_,e]),Lo=j.useCallback(async()=>{var he,Ne;try{se(!0);const Ae=await S(Qn);de({success:!0,timestamp:new Date,details:Ae==null?void 0:Ae.result}),e({variant:"success",title:"SSH-Verbindung erfolgreich",description:"Verbindung zum Portainer-Host wurde hergestellt."})}catch(Ae){const Me=((Ne=(he=Ae.response)==null?void 0:he.data)==null?void 0:Ne.error)||Ae.message||"SSH-Verbindung fehlgeschlagen";de({success:!1,timestamp:new Date,error:Me}),e({variant:"error",title:"SSH-Test fehlgeschlagen",description:Me})}finally{se(!1)}},[Qn,S,e]),Oa=j.useCallback(async()=>{var he,Ne;try{ae(!0),await O(),z(c0()),G(!1),ie(!1),de(null),e({variant:"info",title:"SSH-Konfiguration gelöscht",description:"Die Verbindungseinstellungen wurden zurückgesetzt."})}catch(Ae){const Me=((Ne=(he=Ae.response)==null?void 0:he.data)==null?void 0:Ne.error)||Ae.message||"SSH-Konfiguration konnte nicht gelöscht werden";e({variant:"error",title:"Löschen fehlgeschlagen",description:Me})}finally{ae(!1)}},[O,e]),Nl=j.useCallback(async()=>{var he,Ne,Ae;if(!(Ve||Se||!qe)&&!(typeof window<"u"&&!window.confirm(`Superuser und zugehörige Gruppe wirklich löschen? Dies setzt die Superuser-Einrichtung zurück.`)))try{me(!0);const Me=await c(),Ke=Number((Me==null?void 0:Me.usersRemoved)??0);e({variant:"success",title:"Superuser gelöscht",description:Ke>1?`${Ke} Konten aus der Superuser-Gruppe wurden entfernt.`:"Superuser-Konto wurde entfernt."}),await xr({silent:!0})}catch(Me){if(((he=Me.response)==null?void 0:he.status)===404)await xr({silent:!0}),e({variant:"info",title:"Kein Superuser vorhanden",description:"Es ist kein Superuser mehr vorhanden."});else{const Tt=((Ae=(Ne=Me.response)==null?void 0:Ne.data)==null?void 0:Ae.error)||Me.message||"Superuser konnte nicht gelöscht werden";e({variant:"error",title:"Löschen fehlgeschlagen",description:Tt})}}finally{me(!1)}},[Ve,Se,qe,c,xr,e]),jl=j.useCallback(async he=>{var Ke,Tt;if(qt===he)return;const Ne=Qr.find(wt=>wt.id===he);if(!Ne)return;const Ae=Ne.name||`Endpoint ${Ne.external_id}`,Me=`Endpoint "${Ae}" wirklich löschen?${Ne.is_default?` Dieser Endpoint ist aktuell als Standard markiert.`:""}`;if(!(typeof window<"u"&&!window.confirm(Me))){Et(he);try{await m(he),e({variant:"success",title:"Endpoint gelöscht",description:`Endpoint "${Ae}" wurde entfernt.`}),await Zt({silent:!0})}catch(wt){const Yt=((Tt=(Ke=wt.response)==null?void 0:Ke.data)==null?void 0:Tt.error)||wt.message||"Endpoint konnte nicht gelöscht werden.";e({variant:"error",title:"Endpoint löschen fehlgeschlagen",description:Yt})}finally{Et(null)}}},[m,qt,Zt,Qr,e]),Pa=j.useCallback(async he=>{var Tt,wt;if(et===he)return;const Ne=Pn.find(Yt=>Yt.id===he);if(!Ne)return;const Ae=Qr.filter(Yt=>Yt.server_id===he),Me=Ne.name||Ne.url||`Server ${he}`,Ke=[`Server "${Me}" wirklich löschen?`,Ae.length?`Dabei werden ${Ae.length} zugeordnete Endpoint(s) entfernt.`:null,"Das System benötigt anschließend erneut einen gültigen Server/Endpoint im Setup."].filter(Boolean).join(` `);if(!(typeof window<"u"&&!window.confirm(Ke))){Xt(he);try{await d(he),e({variant:"success",title:"Server gelöscht",description:`Server "${Me}" wurde entfernt.`}),await Zt({silent:!0})}catch(Yt){const _r=((wt=(Tt=Yt.response)==null?void 0:Tt.data)==null?void 0:wt.error)||Yt.message||"Server konnte nicht gelöscht werden.";e({variant:"error",title:"Server löschen fehlgeschlagen",description:_r})}finally{Xt(null)}}},[d,Zt,et,Qr,Pn,e]),go=j.useCallback((he,Ne)=>{Ue(Ae=>({...Ae,[he]:Ne}))},[]),Pt=j.useCallback(async he=>{var Ae,Me;const Ne=(Ie[he]??"").trim();if(!Ne){e({variant:"warning",title:"API-Key fehlt",description:"Bitte gib einen API-Key ein."});return}if(Ze!==he){Bt(he);try{await l(he,Ne),e({variant:"success",title:"API-Key aktualisiert",description:"Der API-Key wurde gespeichert."}),Ue(Ke=>({...Ke,[he]:""})),await Zt({silent:!0})}catch(Ke){const Tt=((Me=(Ae=Ke.response)==null?void 0:Ae.data)==null?void 0:Me.error)||Ke.message||"API-Key konnte nicht aktualisiert werden.";e({variant:"error",title:"Aktualisierung fehlgeschlagen",description:Tt})}finally{Bt(null)}}},[Ie,Ze,Zt,e,l]),Kt=j.useCallback(async he=>{var Ne,Ae;if(!(a||U)&&he!==s){if(y){e({variant:"warning",title:"Aktion nicht möglich",description:"Während eines laufenden Updates kann der Wartungsmodus nicht geändert werden."});return}Y(!0);try{const Me=he&&!!v,Ke={active:he};Me&&h?Ke.message=h:Ke.message=null,await u(Ke),e({variant:he?"info":"success",title:he?"Wartungsmodus aktiviert":"Wartungsmodus deaktiviert",description:he?"Benutzer sehen jetzt die Wartungsseite.":"StackPulse steht wieder zur Verfügung."})}catch(Me){const Ke=((Ae=(Ne=Me.response)==null?void 0:Ne.data)==null?void 0:Ae.error)||Me.message||"Wartungsmodus konnte nicht geändert werden";e({variant:"error",title:"Änderung fehlgeschlagen",description:Ke})}finally{Y(!1)}}},[a,U,s,y,u,h,v,e]),Rt=j.useCallback(async()=>{var Ne,Ae;if(s||y){e({variant:"warning",title:"Update nicht möglich",description:"Während eines aktiven Wartungsmodus kann kein weiteres Update gestartet werden."});return}const he=(pt==null?void 0:pt.latestVersion)??(pt==null?void 0:pt.currentVersion)??"unbekannt";if(!(typeof window<"u"&&!window.confirm(`Portainer-Update starten? Zielversion: ${he}. Während des Updates befindet sich StackPulse im Wartungsmodus. Fortfahren?`)))try{W(""),D(!0),await f(),e({variant:"info",title:"Update gestartet",description:"Das Portainer-Update wurde gestartet."})}catch(Me){const Ke=((Ae=(Ne=Me.response)==null?void 0:Ne.data)==null?void 0:Ae.error)||Me.message||"Portainer-Update konnte nicht gestartet werden";W(Ke),e({variant:"error",title:"Update fehlgeschlagen",description:Ke})}finally{D(!1)}},[s,y,pt,f,e]),cn=j.useCallback(async he=>{var Ke,Tt,wt,Yt;if(!he)return;if(s||y){e({variant:"warning",title:"Aktion nicht möglich",description:"Während des Wartungsmodus sind Bereinigungen deaktiviert."});return}const Ne=(Ke=he.canonical)==null?void 0:Ke.Id;if(!Ne)return;const Ae=(he.duplicates||[]).map(_r=>_r.Id).filter(Boolean);if(!Ae.length)return;const Me=((Tt=he.canonical)==null?void 0:Tt.Name)||he.name||`Stack ${Ne}`;if(!(typeof window<"u"&&!window.confirm(`Bereinigung für "${Me}" starten? Es werden ${Ae.length} Duplikate entfernt: ${Ae.join(", ")}`))){Kr(String(Ne));try{const mo=(await at.post("/api/maintenance/duplicates/cleanup",{canonicalId:Ne,duplicateIds:Ae})).data??{};if(mo.success===!1)throw new Error(mo.error||"Bereinigung fehlgeschlagen");const Al=Array.isArray(mo.results)?mo.results.filter(Na=>Na.status==="deleted").map(Na=>Na.id):Ae;e({variant:"success",title:"Bereinigung abgeschlossen",description:`${Me} – entfernte IDs: ${Al.join(", ")}`}),await Fr({silent:!0})}catch(_r){const mo=((Yt=(wt=_r.response)==null?void 0:wt.data)==null?void 0:Yt.error)||_r.message||"Bereinigung fehlgeschlagen";e({variant:"error",title:"Bereinigung fehlgeschlagen",description:mo})}finally{Kr(null)}}},[Fr,s,e,y]);t!=null&&t.activatedAt&&Ma(t.activatedAt),t!=null&&t.updatedAt&&Ma(t.updatedAt);const jr=s||y,dn=(r==null?void 0:r.status)??(y?"running":"idle"),ka=NB[dn]??dn,gi=es[dn]??es.idle,mi=r!=null&&r.stage?jB[r.stage]??r.stage:"–",bi=(r==null?void 0:r.logs)??[],Rf=(r==null?void 0:r.targetVersion)??"-",Af=(r==null?void 0:r.resultVersion)??"-",Mf=r!=null&&r.startedAt?Ma(r.startedAt):"-",If=r!=null&&r.finishedAt?Ma(r.finishedAt):"-",vu=(r==null?void 0:r.message)??(y?"Update läuft…":""),yu=y||N||a;return T.jsxs("div",{className:"mt-12 mb-8 flex flex-col gap-12",children:[(s||y)&&T.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:T.jsxs("div",{className:"flex flex-col gap-1",children:[T.jsxs("span",{children:["Wartungsmodus aktiv",h?` – ${h}`:y?" – Portainer-Update läuft":"","."]}),y&&T.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",mi]})]})}),T.jsxs(Q.Card,{children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:T.jsx(Q.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:T.jsx("span",{children:"Wartungsmodus"})})}),T.jsxs(Q.CardBody,{className:"flex flex-col gap-4 p-4",children:[T.jsxs("div",{className:"flex items-start justify-between gap-4",children:[T.jsx("div",{className:"space-y-1",children:T.jsx("p",{className:"text-sm antialiased font-sans text-sm font-light leading-normal text-inherit",children:"Schaltet StackPulse für Benutzer in den Wartungsmodus."})}),T.jsx(Q.Switch,{checked:s,disabled:U||a||y,onChange:he=>Kt(he.target.checked),ripple:!1,color:"amber"})]}),U&&T.jsx("p",{className:"text-xs text-stormGrey-500",children:"Wartungsmodus wird aktualisiert…"})]})]}),T.jsxs(Q.Card,{children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:T.jsx(Q.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:T.jsx("span",{children:"Server & Endpoints"})})}),T.jsxs(Q.CardBody,{className:"flex flex-col gap-4 p-4",children:[_e&&T.jsx("p",{className:"text-sm text-stormGrey-500",children:"Daten werden geladen…"}),!_e&&Ce&&T.jsx(Alert,{color:"red",className:"border border-red-200 bg-red-50 text-red-700",children:Ce}),!_e&&!Ce&&T.jsxs("div",{className:"flex flex-col gap-6",children:[T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx(Q.Typography,{variant:"small",color:"blue-gray",className:"font-semibold uppercase",children:"Server"}),T.jsxs(Q.Typography,{variant:"small",color:"blue-gray",children:[Pn.length," vorhanden"]})]}),Pn.length===0?T.jsx("p",{className:"text-sm text-stormGrey-500",children:"Es sind derzeit keine Server hinterlegt."}):T.jsx("div",{className:"flex flex-col gap-3",children:Pn.map(he=>{const Ne=Sa.get(he.id)||null,Ae=!!(Ne!=null&&Ne.hasKey),Me=Ne!=null&&Ne.updatedAt?new Date(Ne.updatedAt).toLocaleString("de-DE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):null;return T.jsxs("div",{className:"flex flex-col gap-3 rounded-md border border-blue-gray-100 p-3 md:flex-row md:items-start md:justify-between",children:[T.jsxs("div",{className:"flex flex-col gap-1",children:[T.jsx("p",{className:"text-sm font-medium text-stormGrey-900",children:he.name||"Ohne Namen"}),T.jsx("p",{className:"text-xs text-stormGrey-500 break-all",children:he.url}),T.jsxs("p",{className:"text-xs text-stormGrey-500",children:["API-Key: ",Ae?"vorhanden":"nicht hinterlegt",Me?` (aktualisiert am ${Me})`:""]})]}),T.jsxs("div",{className:"flex w-full flex-col gap-2 md:max-w-xs",children:[T.jsx(Q.Input,{type:"password",label:"Neuer API-Key",value:Ie[he.id]??"",onChange:Ke=>go(he.id,Ke.target.value),disabled:_e||Ze===he.id}),T.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[T.jsx(Q.Button,{variant:"text",color:"red",size:"sm",onClick:()=>Pa(he.id),disabled:_e||et===he.id||qt!==null||Ze===he.id,children:et===he.id?"Lösche…":"Löschen"}),T.jsx(Q.Button,{color:"blue",size:"sm",onClick:()=>Pt(he.id),disabled:_e||Ze===he.id,children:Ze===he.id?"Speichere…":"API-Key speichern"})]})]})]},he.id)})})]}),T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx(Q.Typography,{variant:"small",color:"blue-gray",className:"font-semibold uppercase",children:"Endpoints"}),T.jsxs(Q.Typography,{variant:"small",color:"blue-gray",children:[Qr.length," vorhanden"]})]}),Qr.length===0?T.jsx("p",{className:"text-sm text-stormGrey-500",children:"Es sind derzeit keine Endpoints hinterlegt."}):T.jsx("div",{className:"flex flex-col gap-3",children:Qr.map(he=>T.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-blue-gray-100 p-3 md:flex-row md:items-center md:justify-between",children:[T.jsxs("div",{children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("p",{className:"text-sm font-medium text-stormGrey-900",children:he.name||`Endpoint ${he.external_id}`}),he.is_default?T.jsx("span",{className:"rounded-full bg-arcticBlue-100 px-2 py-0.5 text-[10px] font-semibold text-arcticBlue-700",children:"Standard"}):null]}),T.jsxs("p",{className:"text-xs text-stormGrey-500",children:["ID: ",he.external_id," · Server: ",he.server_name||he.server_url]})]}),T.jsx("div",{className:"flex items-center gap-2",children:T.jsx(Q.Button,{variant:"text",color:"red",size:"sm",onClick:()=>jl(he.id),disabled:_e||qt===he.id||et!==null,children:qt===he.id?"Lösche…":"Löschen"})})]},he.id))})]}),!Ta&&T.jsx(Alert,{color:"amber",className:"border border-amber-200 bg-amber-50 text-amber-800",children:"Das Setup ist aktuell unvollständig. Bitte öffne den Setup-Bereich, um Server, Endpoint und API-Key erneut festzulegen."}),T.jsx("div",{className:"flex items-center justify-end",children:T.jsx(Q.Button,{variant:"outlined",color:"gray",size:"sm",onClick:()=>Zt(),disabled:_e,children:"Aktualisieren"})})]})]})]}),T.jsxs(Q.Card,{children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:T.jsx(Q.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:T.jsx("span",{children:"Superuser"})})}),T.jsxs(Q.CardBody,{className:"flex flex-col gap-4 p-4",children:[T.jsxs("div",{className:"space-y-2",children:[Se&&T.jsx("p",{className:"text-sm text-stormGrey-500",children:"Status wird geladen…"}),!Se&&rt&&T.jsx("p",{className:"text-sm text-sunsetCoral-600",children:rt}),!Se&&!rt&&qe&&T.jsxs("div",{className:"space-y-1",children:[T.jsx("p",{className:"text-sm",children:"Superuser ist angelegt."}),T.jsxs("p",{className:"text-xs text-stormGrey-500",children:["Benutzername: ",T.jsx("span",{className:"font-medium text-stormGrey-900",children:(ut==null?void 0:ut.username)??"unbekannt"}),ut!=null&&ut.email?` - ${ut.email}`:""]})]}),!Se&&!rt&&!qe&&T.jsx("p",{className:"text-sm",children:"Es ist kein Superuser vorhanden."})]}),T.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[T.jsx(Q.Button,{variant:"outlined",color:"gray",onClick:()=>xr(),disabled:Se||Ve,className:"w-full sm:w-auto",children:"Status aktualisieren"}),T.jsx(Q.Button,{color:"red",onClick:Nl,disabled:Se||Ve||!qe,className:"w-full sm:w-auto",children:Ve?"Wird gelöscht…":"Superuser löschen"})]}),T.jsx("p",{className:"text-xs text-stormGrey-500",children:"Entfernt das Superuser-Konto samt zugehöriger Gruppe. Danach kann der Erstbenutzer bei Bedarf erneut angelegt werden."})]})]}),T.jsxs(Q.Card,{children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:T.jsx(Q.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:T.jsx("span",{children:"Portainer"})})}),T.jsxs(Q.CardBody,{className:"flex flex-col gap-4 p-4 pt-0",children:[T.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[T.jsxs("div",{children:[T.jsx("h2",{className:"block antialiased font-sans text-lg font-semibold",children:"Portainer Status"}),T.jsx("p",{className:"block antialiased font-sans text-sm font-light leading-normal text-inherit",children:Z?"Status wird geprüft…":Re||(y?"Portainer wird aktuell aktualisiert.":(pt==null?void 0:pt.updateAvailable)===!0?"Es ist ein Update für Portainer verfügbar.":"Portainer ist auf dem aktuellen Stand.")}),Ct&&!Z&&T.jsxs("p",{className:"mt-1 text-xs text-stormGrey-500 block antialiased font-sans",children:["Stand: ",Ct.toLocaleString("de-DE",{hour:"2-digit",minute:"2-digit",second:"2-digit"})]})]}),T.jsx("div",{className:"flex items-center gap-3",children:T.jsx(Q.Button,{onClick:()=>ar({silent:!1}),disabled:Z||jt,className:"w-full",children:"Status aktualisieren"})})]}),T.jsx("div",{className:"flex flex-col gap-4 mt-5 space-y-4 block antialiased font-sans text-sm font-light leading-normal text-inherit",children:!Z&&!Re&&pt&&T.jsxs("div",{className:"",children:[T.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[T.jsx("span",{children:"Installierte Version"}),T.jsx("span",{className:"font-medium",children:pt.currentVersion??"Unbekannt"})]}),T.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[T.jsx("span",{children:"Neueste Version"}),T.jsx("span",{className:"font-medium",children:pt.latestVersion??"Unbekannt"})]}),T.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[T.jsx("span",{children:"Status"}),T.jsx("span",{className:`rounded-full px-3 py-0.5 text-xs font-semibold ${pt.updateAvailable===!0?es.error:pt.updateAvailable===!1?es.success:es.idle}`,children:pt.updateAvailable===!0?"Update verfügbar":pt.updateAvailable===!1?"Aktuell":"Unbekannt"})]}),pt.edition&&T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{className:"text-stormGrey-400",children:"Edition"}),T.jsx("span",{className:"font-medium",children:pt.edition})]}),pt.build&&T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{className:"text-stormGrey-400",children:"Build"}),T.jsx("span",{className:"font-medium",children:pt.build})]}),((Ea=pt.errors)==null?void 0:Ea.latestVersion)&&T.jsxs("div",{className:"rounded-md mt-8 border bg-sunsetCoral-600 text-white px-3 py-2 text-xs",children:["Neueste Version konnte nicht ermittelt werden: ",pt.errors.latestVersion]}),((Rl=pt.errors)==null?void 0:Rl.container)&&T.jsxs("div",{className:"rounded-md mt-8 border bg-sunsetCoral-600 text-white px-3 py-2 text-xs",children:["Container-Details konnten nicht ermittelt werden: ",pt.errors.container]})]})}),T.jsxs("div",{className:"mt-6 grid gap-6 lg:grid-cols-2 xl:grid-cols-3",children:[T.jsxs("div",{className:"rounded-md border border-gray-700/20 p-4",children:[T.jsx("div",{className:"flex items-center justify-between",children:T.jsx("h3",{className:"text-sm font-semibold",children:"SSH-Verbindung"})}),T.jsxs("div",{className:"mt-3 grid gap-3 text-sm",children:[T.jsxs("label",{className:"grid gap-1",children:[T.jsx("span",{className:"text-xs uppercase tracking-wide",children:"Host"}),T.jsx("input",{type:"text",value:$.host,onChange:he=>Xr("host",he.target.value),disabled:fe||oe||ee||y,className:"w-full rounded-md border border-gray-700 bg-gray-950/70 px-3 py-2 text-sm focus:border-purple-500 focus:outline-none"})]}),T.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[T.jsxs("label",{className:"grid gap-1",children:[T.jsx("span",{className:"text-xs uppercase tracking-wide ",children:"Port"}),T.jsx("input",{type:"number",min:"1",value:$.port,onChange:he=>Xr("port",he.target.value),disabled:fe||oe||ee||y,className:"w-full rounded-md border border-gray-700 bg-gray-950/70 px-3 py-2 text-sm focus:border-purple-500 focus:outline-none"})]}),T.jsxs("label",{className:"grid gap-1",children:[T.jsx("span",{className:"text-xs uppercase tracking-wide ",children:"Benutzer"}),T.jsx("input",{type:"text",value:$.username,onChange:he=>Xr("username",he.target.value),disabled:fe||oe||ee||y,className:"w-full rounded-md border border-gray-700 bg-gray-950/70 px-3 py-2 text-sm focus:border-purple-500 focus:outline-none"})]})]}),T.jsxs("div",{className:"grid gap-1",children:[T.jsxs("div",{className:"flex items-center justify-between text-xs uppercase tracking-wide ",children:[T.jsx("label",{htmlFor:"maintenance-ssh-password",className:"cursor-pointer",children:"Passwort"}),T.jsx("button",{type:"button",onClick:()=>ie(he=>!he),disabled:fe||oe||ee||y,className:"text-[11px] font-medium text-blue-500 transition hover:text-blue-800 disabled:opacity-50",children:X?"Verbergen":"Anzeigen"})]}),T.jsx("input",{id:"maintenance-ssh-password",type:X?"text":"password",value:$.password,onChange:he=>Xr("password",he.target.value),disabled:fe||oe||ee||y,className:"w-full rounded-md border border-gray-700 bg-gray-950/70 px-3 py-2 text-sm focus:border-purple-500 focus:outline-none",placeholder:"Passwort für den SSH-Benutzer",autoComplete:"off",spellCheck:!1}),H&&!$.password&&T.jsx("span",{className:"text-[11px] ",children:"Ein Passwort ist gespeichert. Neuer Inhalt ersetzt es oder lösche die Konfiguration unten."})]}),T.jsxs("label",{className:"grid gap-1",children:[T.jsx("span",{className:"text-xs uppercase tracking-wide ",children:"Weitere SSH-Argumente"}),T.jsx("textarea",{rows:3,value:$.extraSshArgs,onChange:he=>Xr("extraSshArgs",he.target.value),disabled:fe||oe||ee||y,className:"w-full rounded-md border border-gray-700 bg-gray-950/70 px-3 py-2 font-mono text-[11px] focus:border-purple-500 focus:outline-none",placeholder:"je Zeile ein Argument (optional)"})]})]}),T.jsxs("div",{className:"mt-4 grid gap-2",children:[T.jsx(Q.Button,{onClick:Do,disabled:fe||oe||ee||y,className:"mt-3 w-full",children:fe?"Speichern…":"SSH-Konfiguration speichern"}),T.jsx(Q.Button,{onClick:Lo,disabled:fe||oe||ee||y,className:"w-full bg-arcticBlue-500 hover:bg-arcticBlue-600",children:oe?"Test läuft…":"Verbindung testen"}),T.jsx(Q.Button,{onClick:Oa,disabled:fe||oe||ee||y,className:"w-full hover:bg-sunsetCoral-600 bg-sunsetCoral-500",children:ee?"Löschen…":"SSH-Einstellungen löschen"})]}),ue&&T.jsx("p",{className:`mt-3 text-xs ${ue.success?"text-mossGreen-600":"text-sunsetCoral-500"}`,children:ue.success?"SSH-Verbindung erfolgreich.":`SSH-Verbindung fehlgeschlagen: ${ue.error}`})]}),T.jsxs("div",{className:"rounded-md border border-gray-700/20 p-4",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("h3",{className:"text-sm font-semibold",children:"Update-Skript"}),T.jsxs("span",{className:"text-xs",children:["Quelle: ",be]})]}),T.jsx("textarea",{value:E,onChange:he=>P(he.target.value),rows:10,disabled:N||y,className:"mt-3 w-full rounded-md border border-gray-700/20 px-3 py-2 font-mono text-xs focus:border-purple-500 focus:outline-none"}),T.jsxs("div",{className:"mt-3 grid gap-2",children:[T.jsx(Q.Button,{onClick:hi,disabled:!xe||N||y,className:"mt-3 w-full",children:"Speichern"}),T.jsx(Q.Button,{color:"purple",onClick:ho,disabled:!n||n.source!=="custom"||N||y,className:"w-full hover:bg-sunsetCoral-600 bg-sunsetCoral-500",children:"Standard wiederherstellen"})]}),(n==null?void 0:n.customUpdatedAt)&&T.jsxs("p",{className:"mt-2 text-xs text-stormGrey-500",children:["Zuletzt geändert: ",Ma(n.customUpdatedAt)]})]}),T.jsxs("div",{className:"rounded-md border border-gray-700/20 p-4",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("h3",{className:"text-sm font-semibold",children:"Update-Status"}),T.jsx("span",{className:`rounded-full px-3 py-0.5 text-xs font-semibold ${gi}`,children:ka})]}),T.jsxs("div",{className:"mt-3 grid gap-2 text-xs",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{children:"Phase"}),T.jsx("span",{className:"font-medium",children:mi})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{children:"Ziel-Version"}),T.jsx("span",{className:"font-medium",children:Rf})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{children:"Installierte Version"}),T.jsx("span",{className:"font-medium",children:Af})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{children:"Gestartet"}),T.jsx("span",{children:Mf})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{children:"Beendet"}),T.jsx("span",{children:If})]}),vu&&T.jsx("div",{className:"rounded-md border border-mossGreen-700 bg-mossGreen-800 px-3 py-2 text-xs text-white",children:vu}),(r==null?void 0:r.error)&&T.jsx("div",{className:"rounded-md border border-sunsetCoral-500/60 bg-sunsetCoral-900/40 px-3 py-2 text-xs text-white",children:r.error}),L&&T.jsx("div",{className:"rounded-md border border-sunsetCoral-500/60 bg-sunsetCoral-900/40 px-3 py-2 text-xs text-white",children:L})]}),T.jsx("div",{className:"mt-3 h-40 overflow-y-auto rounded-md border border-gray-700/20 bg-gray-950/70 p-3 font-mono text-[11px] leading-relaxed",children:bi.length===0?T.jsx("p",{className:"text-stormGrey-500",children:"Noch keine Protokolle vorhanden."}):bi.map((he,Ne)=>T.jsxs("div",{className:"mb-2 last:mb-0",children:[T.jsxs("span",{className:"text-gray-500",children:["[",AB(he.timestamp),"]"]})," ",T.jsx("span",{className:(RB[he.level]??"text-stormGrey-300")+" whitespace-normal break-words",style:{overflowWrap:"anywhere",wordBreak:"normal"},children:he.message})]},`${he.timestamp}-${Ne}`))}),T.jsx(Q.Button,{onClick:Rt,disabled:yu||M,className:"mt-3 w-full",children:M?"Update wird gestartet…":"Portainer aktualisieren"})]})]})]})]}),T.jsxs(Q.Card,{children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:T.jsx(Q.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:T.jsx("span",{children:"Doppelte Stacks"})})}),T.jsxs(Q.CardBody,{className:"flex flex-col gap-4 p-4",children:[T.jsx("div",{className:"rounded-lg border border-warmAmberGlow-600 bg-warmAmberGlow-700 px-4 py-3 text-sm text-white",children:"Das Entfernen von deppelten Stacks ist noch nicht getestet. Bitte nicht in Produktivumgebungen einsetzen."}),T.jsxs("div",{className:"flex items-start justify-between gap-4",children:[T.jsxs("div",{className:"space-y-1",children:[T.jsx("p",{className:"text-sm antialiased font-sans text-sm font-light leading-normal text-inherit",children:jr?"Wartungsmodus aktiv – Duplikat-Verwaltung ist vorübergehend deaktiviert.":Nt?"Analyse läuft…":Yn.groups===0?"Keine Duplikate gefunden":`${Yn.groups} Stack-Namen mit insgesamt ${Yn.duplicateCount} Duplikaten gefunden`}),Kn&&!Nt&&!jr&&T.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:["Stand: ",Kn.toLocaleString("de-DE",{hour:"2-digit",minute:"2-digit",second:"2-digit"})]})]}),T.jsx(Q.Button,{onClick:()=>Fr({silent:!1}),disabled:jr||Nt||On||fo!==null,className:"",children:"Aktualisieren"}),bt&&!jr&&T.jsx("div",{className:"rounded-lg border border-sunsetCoral-500/60 bg-sunsetCoral-900/40 px-4 py-3 text-sm text-white",children:bt})]}),Nt?T.jsx("div",{className:"flex flex-col gap-4 p-4",children:"Daten werden geladen…"}):Yn.groups===0||jr?T.jsx("div",{className:"rounded-xl border-mossGreen-500/80 bg-mossGreen-900/90 text-mossGreen-100 p-8 text-center text-sm text-white",children:jr?"Wartungsmodus aktiv – Duplikat-Verwaltung ist vorübergehend deaktiviert.":"Es wurden keine doppelten Stacks gefunden."}):T.jsx("div",{className:"space-y-5",children:tr.map(he=>{var Ke,Tt,wt,Yt;const Ne=(Ke=he==null?void 0:he.canonical)==null?void 0:Ke.Id,Ae=(he==null?void 0:he.duplicates)||[],Me=fo===String(Ne);return T.jsxs("div",{className:"rounded-xl border border-gray-700 bg-gray-800/70 p-6 shadow",children:[T.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[T.jsxs("div",{className:"space-y-1",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("h3",{className:"text-lg font-semibold text-white",children:he.name}),T.jsxs("span",{className:"rounded-full bg-amber-500/20 px-3 py-0.5 text-xs font-medium text-amber-200",children:[Ae.length," Duplikat",Ae.length===1?"":"e"]})]}),T.jsxs("p",{className:"text-sm text-gray-300",children:["Behaltener Stack: ID ",Ne," (Endpoint ",((Tt=he==null?void 0:he.canonical)==null?void 0:Tt.EndpointId)??"-",")"]}),T.jsxs("p",{className:"text-xs text-gray-500",children:["Typ: ",kx((wt=he==null?void 0:he.canonical)==null?void 0:wt.Type)," • Erstellt: ",Ma((Yt=he==null?void 0:he.canonical)==null?void 0:Yt.Created)]})]}),T.jsx("button",{type:"button",onClick:()=>cn(he),disabled:jr||Me||On||Nt,className:"self-start rounded-lg bg-sunsetCoral-500 px-4 py-2 text-sm font-semibold text-white transition hover:bg-sunsetCoral-600 disabled:opacity-50",children:Me?"Bereinigung läuft…":`Bereinigen (${Ae.length})`})]}),T.jsx("div",{className:"mt-5 grid gap-3",children:Ae.map(_r=>T.jsx("div",{className:"rounded-lg border border-sunsetCoral-500/40 bg-sunsetCoral-900/20 p-4 text-sm text-white",children:T.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[T.jsxs("span",{className:"font-semibold text-white",children:["ID: ",_r.Id]}),T.jsxs("span",{children:["Endpoint: ",_r.EndpointId??"-"]}),T.jsxs("span",{children:["Typ: ",kx(_r.Type)]}),T.jsxs("span",{children:["Erstellt: ",Ma(_r.Created)]})]})},_r.Id))})]},Ne||he.name)})})]})]})]})}const IB={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},Fa=lo.forwardRef(({value:e,onClick:t,onKeyDown:r,...n},o)=>{const{setOpen:a}=Q.useSelect(),i=j.useCallback(()=>{(typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame:b=>setTimeout(b,0))(()=>{a(!0)})},[a]),u=j.useCallback(g=>{typeof t=="function"&&t(g),i()},[t,i]),f=j.useCallback(g=>{typeof r=="function"&&r(g),(g.key==="Enter"||g.key===" ")&&i()},[r,i]);return T.jsx(Q.Option,{...n,value:e,ref:o,onClick:u,onKeyDown:f})});Fa.displayName="StickyOption";const DB={success:"text-mossGreen-500",warning:"text-warmAmberGlow-500",error:"text-sunsetCoral-500",started:"text-arcticBlue-500",running:"text-arcticBlue-500",info:"text-arcticBlue-500",queued:"text-indigo-500"},LB=e=>{if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString("de-DE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})},Ex=e=>{if(e)return e.replace("T"," ")},Nx="eventLogFilters",to="__all__",FB="- Alle -",zB=e=>!!(e.categories&&e.categories.length||e.eventTypes&&e.eventTypes.length||e.actions&&e.actions.length||e.statuses&&e.statuses.length||e.entityTypes&&e.entityTypes.length||e.contextTypes&&e.contextTypes.length||e.entityId&&e.entityId.trim()||e.contextId&&e.contextId.trim()||e.search&&e.search.trim()||e.from&&e.from.trim()||e.to&&e.to.trim()),BB=e=>{if(e==null)return"-";if(typeof e=="object")try{return JSON.stringify(e)}catch{return"[Objekt]"}return String(e)},VB=e=>{if(!e||typeof e!="object")return"";const t=Object.entries(e);return t.length?t.map(([r,n])=>`${r}: ${BB(n)}`).join(" • "):""};function UB(){const[e,t]=j.useState([]),[r,n]=j.useState(!0),[o,a]=j.useState(""),[i,u]=j.useState(!1),[f,g]=j.useState([]),[b,_]=j.useState([]),[O,S]=j.useState([]),[C,w]=j.useState([]),[m,d]=j.useState([]),[l,c]=j.useState([]),[s,h]=j.useState([]),[v,y]=j.useState([]),[E,P]=j.useState([]),[N,R]=j.useState([]),[M,D]=j.useState([]),[L,W]=j.useState([]),[U,Y]=j.useState(""),[$,z]=j.useState(""),[H,G]=j.useState(""),[X,ie]=j.useState(""),[fe,pe]=j.useState(""),[oe,se]=j.useState(!1),[ee,ae]=j.useState(!1),[ue,de]=j.useState(!1),[Te,xe]=j.useState(0),{maintenance:be,update:Se}=pi(),je=!!(be!=null&&be.active),qe=be==null?void 0:be.message,nt=!!(Se!=null&&Se.running),ut=Se!=null&&Se.stage?IB[Se.stage]??Se.stage:"–",{page:Ye,perPage:rt,perPageOptions:Je,setPage:Ve,setPerPage:me,setTotals:te,handlePerPageChange:ge,validPerPageValues:_e,resetPagination:Pe}=bu(),Ce=j.useCallback(()=>{},[]);j.useEffect(()=>()=>Pe(),[Pe]);const we=j.useCallback(Z=>{const Oe=Array.isArray(Z)?Z:(Z==null?void 0:Z.items)??[],Re=new Set,_t=new Set,jt=new Set,vt=new Set,Ct=new Set,cr=new Set;Oe.forEach(lt=>{lt.category&&Re.add(lt.category),lt.eventType&&_t.add(lt.eventType),lt.action&&jt.add(lt.action),lt.status&&vt.add(lt.status),lt.entityType&&Ct.add(lt.entityType),lt.contextType&&cr.add(lt.contextType)}),g(Array.from(Re).sort()),_(Array.from(_t).sort()),S(Array.from(jt).sort()),w(Array.from(vt).sort()),d(Array.from(Ct).sort()),c(Array.from(cr).sort()),de(!0)},[]);j.useEffect(()=>{ue&&h(Z=>{const Oe=Z.filter(Re=>f.includes(Re));return Oe.length===Z.length?Z:Oe})},[ue,f]),j.useEffect(()=>{ue&&y(Z=>{const Oe=Z.filter(Re=>b.includes(Re));return Oe.length===Z.length?Z:Oe})},[ue,b]),j.useEffect(()=>{ue&&P(Z=>{const Oe=Z.filter(Re=>O.includes(Re));return Oe.length===Z.length?Z:Oe})},[ue,O]),j.useEffect(()=>{ue&&R(Z=>{const Oe=Z.filter(Re=>C.includes(Re));return Oe.length===Z.length?Z:Oe})},[ue,C]),j.useEffect(()=>{ue&&D(Z=>{const Oe=Z.filter(Re=>m.includes(Re));return Oe.length===Z.length?Z:Oe})},[ue,m]),j.useEffect(()=>{ue&&W(Z=>{const Oe=Z.filter(Re=>l.includes(Re));return Oe.length===Z.length?Z:Oe})},[ue,l]),j.useEffect(()=>{if(typeof window>"u"){ae(!0);return}try{const Z=window.localStorage.getItem(Nx);if(Z){const Oe=JSON.parse(Z),Re=(Oe==null?void 0:Oe.filters)??Oe??{},_t=(Oe==null?void 0:Oe.pagination)??{};h(Re.categories||[]),y(Re.eventTypes||[]),P(Re.actions||[]),R(Re.statuses||[]),D(Re.entityTypes||[]),W(Re.contextTypes||[]),Y(Re.entityId||""),z(Re.contextId||""),G(Re.search||""),ie(Re.from||""),pe(Re.to||""),se(zB(Re));const jt=_t.perPage;if(jt!==void 0){const Ct=String(jt);_e.has(Ct)&&me(Ct,{resetPage:!1})}const vt=_t.page;typeof vt=="number"&&vt>0&&Ve(vt)}}catch(Z){console.error("❌ Fehler beim Laden der gespeicherten Log-Filter:",Z)}finally{ae(!0)}},[Ve,me,_e]);const Ie=j.useCallback(()=>{const Z={};s.length&&(Z.categories=s.join(",")),v.length&&(Z.eventTypes=v.join(",")),E.length&&(Z.actions=E.join(",")),N.length&&(Z.statuses=N.join(",")),M.length&&(Z.entityTypes=M.join(",")),L.length&&(Z.contextTypes=L.join(",")),U.trim()&&(Z.entityId=U.trim()),$.trim()&&(Z.contextId=$.trim()),H.trim()&&(Z.search=H.trim());const Oe=Ex(X);Oe&&(Z.from=Oe);const Re=Ex(fe);return Re&&(Z.to=Re),Z},[s,v,E,N,M,L,U,$,H,X,fe]);j.useEffect(()=>{if(!ee)return;let Z=!1;return at.get("/api/logs",{params:{perPage:"all",page:1}}).then(Oe=>{Z||we(Oe.data)}).catch(Oe=>{Z||console.error("⚠️ Konnte Filteroptionen nicht aktualisieren:",Oe)}),()=>{Z=!0}},[ee,we,Te]);const Ue=j.useMemo(()=>({categories:s,eventTypes:v,actions:E,statuses:N,entityTypes:M,contextTypes:L,entityId:U,contextId:$,search:H,from:X,to:fe}),[s,v,E,N,M,L,U,$,H,X,fe]);j.useEffect(()=>{if(!ee)return;const Z={...Ie()};rt==="all"?(Z.perPage="all",Z.page=1):(Z.perPage=rt,Z.page=Ye);let Oe=!1;return n(!0),a(""),at.get("/api/logs",{params:Z}).then(Re=>{if(Oe)return;const _t=Re.data||{},jt=Array.isArray(_t)?_t:_t.items??[],vt=Array.isArray(_t)?jt.length:_t.total??jt.length;if(t(jt),te(vt,jt.length),rt==="all")Ye!==1&&Ve(1);else{const Ct=Math.max(1,Math.ceil((vt||0)/Number(rt))),cr=Math.min(Math.max(Ye,1),Ct);cr!==Ye&&Ve(cr)}}).catch(Re=>{Oe||(console.error("❌ Fehler beim Laden der Logs:",Re),a("Fehler beim Laden der Logs"))}).finally(()=>{Oe||n(!1)}),()=>{Oe=!0}},[ee,Ie,we,Te,rt,Ye,te]),j.useEffect(()=>{if(ee&&!(typeof window>"u"))try{window.localStorage.setItem(Nx,JSON.stringify({filters:Ue,pagination:{perPage:rt,page:Ye}}))}catch(Z){console.error("⚠️ Konnte Filter nicht speichern:",Z)}},[ee,Ue,rt,Ye]);const Ze=j.useCallback(Z=>Oe=>{var jt;if(typeof Oe=="string"){const vt=Oe;if(vt==="")return;Z(Ct=>vt===to?[]:Ct.includes(vt)?Ct.filter(cr=>cr!==vt):[...Ct,vt]),Ve(1);return}const Re=(jt=Oe==null?void 0:Oe.target)==null?void 0:jt.selectedOptions;if(!Re)return;const _t=Array.from(Re).map(vt=>vt.value);_t.includes(to)?Z([]):Z(_t),Ve(1)},[Ve]),Bt=j.useMemo(()=>Ze(h),[Ze]),et=j.useMemo(()=>Ze(y),[Ze]),Xt=j.useMemo(()=>Ze(P),[Ze]),qt=j.useMemo(()=>Ze(R),[Ze]),Et=j.useMemo(()=>Ze(D),[Ze]),tr=j.useMemo(()=>Ze(W),[Ze]),Jt=(Z,Oe)=>{Z(Re=>Re.filter(_t=>_t!==Oe)),Ve(1)},Nt=()=>{h([]),y([]),P([]),R([]),D([]),W([]),Y(""),z(""),G(""),ie(""),pe(""),se(!1),Ve(1)},Nr=()=>{se(Z=>!Z)},bt=j.useCallback(Z=>[{value:to,label:FB},...Z.filter(Oe=>Oe!==to).map(Oe=>({value:Oe,label:Oe}))],[]),Gt=j.useMemo(()=>bt(f),[bt,f]),On=j.useMemo(()=>bt(b),[bt,b]),Gn=j.useMemo(()=>bt(O),[bt,O]),fo=j.useMemo(()=>bt(C),[bt,C]),Kr=j.useMemo(()=>bt(m),[bt,m]),Kn=j.useMemo(()=>bt(l),[bt,l]),wr=j.useMemo(()=>{let Z=0;return s.length&&(Z+=s.length),v.length&&(Z+=v.length),E.length&&(Z+=E.length),N.length&&(Z+=N.length),M.length&&(Z+=M.length),L.length&&(Z+=L.length),U.trim()&&(Z+=1),$.trim()&&(Z+=1),H.trim()&&(Z+=1),X&&(Z+=1),fe&&(Z+=1),Z},[s,v,E,N,M,L,U,$,H,X,fe]),Yr=async Z=>{if(window.confirm("Diesen Log-Eintrag dauerhaft löschen?")){u(!0),a("");try{await at.delete(`/api/logs/${Z}`),xe(Oe=>Oe+1)}catch(Oe){console.error("❌ Fehler beim Löschen des Logs:",Oe),a("Fehler beim Löschen des Logs")}finally{u(!1)}}},pt=async()=>{if(e.length&&window.confirm("Alle angezeigten Logs (entsprechend Filter) löschen?")){u(!0),a("");try{const Z={...Ie(),ids:e.map(Oe=>Oe.id).join(",")};await at.delete("/api/logs",{params:Z}),xe(Oe=>Oe+1)}catch(Z){console.error("❌ Fehler beim Löschen der gefilterten Logs:",Z),a("Fehler beim Löschen der gefilterten Logs")}finally{u(!1)}}},po=async Z=>{u(!0),a("");try{const Oe=await at.get("/api/logs/export",{params:{...Ie(),format:Z},responseType:"blob"}),Re=Oe.headers["content-type"]||(Z==="sql"?"application/sql":"text/plain"),jt=(Oe.headers["content-disposition"]||"").match(/filename="?([^";]+)"?/i),vt=(jt==null?void 0:jt[1])||`event-logs.${Z}`,Ct=new Blob([Oe.data],{type:Re}),cr=window.URL.createObjectURL(Ct),lt=document.createElement("a");lt.href=cr,lt.download=vt,document.body.appendChild(lt),lt.click(),lt.remove(),window.URL.revokeObjectURL(cr)}catch(Oe){console.error("❌ Fehler beim Export der Logs:",Oe),a("Fehler beim Export der Logs")}finally{u(!1)}};return lo.useState(!1),T.jsxs("div",{className:"mt-12 mb-8",children:[(je||nt)&&T.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:T.jsxs("div",{className:"flex flex-col gap-1",children:[T.jsxs("span",{children:["Wartungsmodus aktiv",qe?` – ${qe}`:nt?" – Portainer-Update läuft":"","."]}),nt&&T.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",ut]})]})}),T.jsxs(Q.Card,{children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:T.jsx(Q.Typography,{variant:"h6",color:"white",children:T.jsxs("button",{onClick:Nr,className:"flex w-full items-center justify-between",children:[T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx("span",{children:"Logs"}),wr>0&&T.jsxs("span",{className:"rounded-full bg-blue-gray-500/80 px-2 py-0.5 text-xs text-white",children:[wr," aktiv"]})]}),T.jsx("span",{className:"text-xs uppercase tracking-wide text-gray-400",children:oe?"Filter ausblenden":"Filter anzeigen"})]})})}),T.jsxs(Q.CardBody,{className:"pt-0",children:[oe&&T.jsxs("div",{className:"mb-8",children:[T.jsxs("div",{className:"flex flex-wrap gap-2",children:[T.jsx(Q.Button,{onClick:()=>po("txt"),disabled:i||r,className:"w-full md:flex-1",children:"Export TXT"}),T.jsx(Q.Button,{onClick:()=>po("sql"),disabled:i||r,className:"w-full md:flex-1",children:"Export SQL"}),T.jsx(Q.Button,{onClick:pt,disabled:i||r||e.length===0,className:"w-full md:flex-1 bg-sunsetCoral-500 hover:bg-sunsetCoral-600",children:"Angezeigte löschen"})]}),T.jsxs("div",{className:"grid gap-6 mt-10",children:[T.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[T.jsxs("div",{className:"grid gap-3",children:[T.jsx(Q.Select,{multiple:!0,onChange:Ce,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Kategorien",children:Gt.map(({value:Z,label:Oe})=>T.jsx(Fa,{value:Z,onClick:()=>Bt(Z),onKeyDown:Re=>{(Re.key==="Enter"||Re.key===" ")&&(Re.preventDefault(),Bt(Z))},className:`text-black-600 ${Z===to?"font-semibold text-black-800":""}`,children:Oe},Z))}),T.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:s.length===0?T.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Kategorien"}):T.jsx("span",{children:s.map(Z=>T.jsx("button",{type:"button",onClick:()=>Jt(h,Z),className:"rounded-full bg-lavenderSmoke-600/80 px-2 py-0.5 text-white transition hover:bg-lavenderSmoke-600/90 focus:outline-none focus:ring-2 focus:ring-lavenderSmoke-400 cursor-pointer",title:"Filter entfernen",children:Z},Z))})})]}),T.jsxs("div",{className:"grid gap-3",children:[T.jsx(Q.Select,{multiple:!0,onChange:Ce,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Event-Typen",children:On.map(({value:Z,label:Oe})=>T.jsx(Fa,{value:Z,onClick:()=>et(Z),onKeyDown:Re=>{(Re.key==="Enter"||Re.key===" ")&&(Re.preventDefault(),et(Z))},className:`text-black-600 ${Z===to?"font-semibold text-black-800":""}`,children:Oe},Z))}),T.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:v.length===0?T.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Event-Typen"}):T.jsx("span",{children:v.map(Z=>T.jsx("button",{type:"button",onClick:()=>Jt(y,Z),className:"rounded-full bg-citrusPunch-600/80 px-2 py-0.5 text-white transition hover:bg-citrusPunch-600/90 focus:outline-none focus:ring-2 focus:ring-citrusPunch-400 cursor-pointer",title:"Filter entfernen",children:Z},Z))})})]})]}),T.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[T.jsxs("div",{className:"grid gap-3",children:[T.jsx(Q.Select,{multiple:!0,onChange:Ce,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Aktionen",children:Gn.map(({value:Z,label:Oe})=>T.jsx(Fa,{value:Z,onClick:()=>Xt(Z),onKeyDown:Re=>{(Re.key==="Enter"||Re.key===" ")&&(Re.preventDefault(),Xt(Z))},className:`text-black-600 ${Z===to?"font-semibold text-black-800":""}`,children:Oe},Z))}),T.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:E.length===0?T.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Aktionen"}):T.jsx("span",{children:E.map(Z=>T.jsx("button",{type:"button",onClick:()=>Jt(P,Z),className:"rounded-full bg-emeraldMist-500/80 px-2 py-0.5 text-white transition hover:bg-emeraldMist-500/90 focus:outline-none focus:ring-2 focus:ring-emeraldMist-400 cursor-pointer",title:"Filter entfernen",children:Z},Z))})})]}),T.jsxs("div",{className:"grid gap-3",children:[T.jsx(Q.Select,{multiple:!0,onChange:Ce,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Status",children:fo.map(({value:Z,label:Oe})=>T.jsx(Fa,{value:Z,onClick:()=>qt(Z),onKeyDown:Re=>{(Re.key==="Enter"||Re.key===" ")&&(Re.preventDefault(),qt(Z))},className:`text-black-600 ${Z===to?"font-semibold text-black-800":""}`,children:Oe},Z))}),T.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:N.length===0?T.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Status"}):T.jsx("span",{children:N.map(Z=>T.jsx("button",{type:"button",onClick:()=>Jt(R,Z),className:"rounded-full bg-copperRust-600/80 px-2 py-0.5 text-white transition hover:bg-copperRust-600/90 focus:outline-none focus:ring-2 focus:ring-copperRust-400 cursor-pointer",title:"Filter entfernen",children:Z},Z))})})]})]}),T.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[T.jsxs("div",{className:"grid gap-3",children:[T.jsx(Q.Select,{multiple:!0,onChange:Ce,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Entitäts-Typen",children:Kr.map(({value:Z,label:Oe})=>T.jsx(Fa,{value:Z,onClick:()=>Et(Z),onKeyDown:Re=>{(Re.key==="Enter"||Re.key===" ")&&(Re.preventDefault(),Et(Z))},className:`text-black-600 ${Z===to?"font-semibold text-black-800":""}`,children:Oe},Z))}),T.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:M.length===0?T.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Entitäten"}):T.jsx("span",{children:M.map(Z=>T.jsx("button",{type:"button",onClick:()=>Jt(D,Z),className:"rounded-full bg-indigo-600/80 px-2 py-0.5 text-white transition hover:bg-indigo-600/90 focus:outline-none focus:ring-2 focus:ring-indigo-400 cursor-pointer",title:"Filter entfernen",children:Z},Z))})})]}),T.jsxs("div",{className:"grid gap-3",children:[T.jsx(Q.Select,{multiple:!0,onChange:Ce,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Kontext",children:Kn.map(({value:Z,label:Oe})=>T.jsx(Fa,{value:Z,onClick:()=>tr(Z),onKeyDown:Re=>{(Re.key==="Enter"||Re.key===" ")&&(Re.preventDefault(),tr(Z))},className:`text-black-600 ${Z===to?"font-semibold text-black-800":""}`,children:Oe},Z))}),T.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:L.length===0?T.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Kontexte"}):T.jsx("span",{children:L.map(Z=>T.jsx("button",{type:"button",onClick:()=>Jt(W,Z),className:"rounded-full bg-sunsetCoral-600/80 px-2 py-0.5 text-white transition hover:bg-sunsetCoral-600/90 focus:outline-none focus:ring-2 focus:ring-sunsetCoral-400 cursor-pointer",title:"Filter entfernen",children:Z},Z))})})]})]}),T.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[T.jsx("div",{className:"md:flex-1",children:T.jsx(Q.Input,{value:U,onChange:Z=>{Y(Z.target.value),Ve(1)},variant:"static",label:"Entitäts-ID",placeholder:"z. B. Stack-ID"})}),T.jsx("div",{className:"md:flex-1",children:T.jsx(Q.Input,{value:$,onChange:Z=>{z(Z.target.value),Ve(1)},variant:"static",label:"Kontext-ID",placeholder:"z. B. Endpoint-ID"})})]}),T.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[T.jsx("div",{className:"md:flex-1",children:T.jsx(Q.Input,{value:H,onChange:Z=>{G(Z.target.value),Ve(1)},variant:"static",label:"Suche (Nachricht & Details)",placeholder:"Freitext"})}),T.jsx("div",{className:"md:mt-0 mt-8 md:flex-1",children:T.jsx(Q.Select,{variant:"static",label:"Einträge pro Seite",onChange:Ce,value:rt,children:Je.map(({value:Z,label:Oe})=>T.jsx(Q.Option,{value:Z,onClick:()=>ge(Z),children:Oe},Z))})})]}),T.jsxs("div",{className:"flex flex-col md:flex-row flex-wrap gap-4",children:[T.jsx("div",{className:"flex-1 min-w-[200px]",children:T.jsx(Q.Input,{type:"datetime-local",variant:"static",label:"Von",value:X,onChange:Z=>{ie(Z.target.value),Ve(1)},className:"w-full"})}),T.jsx("div",{className:"flex-1 min-w-[200px]",children:T.jsx(Q.Input,{type:"datetime-local",variant:"static",label:"Bis",value:fe,onChange:Z=>{pe(Z.target.value),Ve(1)},className:"w-full"})}),T.jsx("div",{className:"flex-1 min-w-[180px]",children:T.jsx(Q.Button,{onClick:Nt,disabled:i||r,className:"w-full",children:"Zurücksetzen"})})]})]})]}),T.jsx("div",{className:"overflow-x-auto rounded-lg border border-blue-gray-50",children:T.jsxs("table",{className:"w-full min-w-[860px] table-auto text-left",children:[T.jsx("thead",{children:T.jsx("tr",{className:"bg-blue-gray-50/50 text-xs uppercase tracking-wide text-stormGrey-400",children:["Zeitpunkt","Kategorie","Status","Entität","Kontext","Nachricht","Details","Aktionen"].map(Z=>T.jsx("th",{className:"px-6 py-4 font-semibold",children:Z},Z))})}),T.jsx("tbody",{children:r?T.jsx("tr",{children:T.jsx("td",{colSpan:8,className:"px-6 py-8 text-center text-stormGrey-400",children:"Logs werden geladen ..."})}):e.length===0?T.jsx("tr",{children:T.jsx("td",{colSpan:8,className:"px-6 py-8 text-center text-stormGrey-400",children:"Keine Logs gefunden."})}):e.map((Z,Oe)=>{const Re=DB[Z.status]||"text-blue-300",_t=Oe===e.length-1?"":"border-b border-blue-gray-50",jt=Z.category||"-",vt=Z.entityName||Z.entityId||"-",Ct=[];Z.entityName&&Z.entityId?Ct.push(`ID: ${Z.entityId}`):!Z.entityName&&Z.entityId&&Ct.push(`ID: ${Z.entityId}`),Z.entityType&&Ct.push(Z.entityType);const cr=Z.contextLabel||Z.contextType||(Z.contextId?`#${Z.contextId}`:"-"),lt=[];Z.contextType&<.push(Z.contextType),Z.contextId&<.push(`#${Z.contextId}`);const xr=VB(Z.metadata),Zt=[];if(Z.actorName||Z.actorId){const ar=Z.actorName?Z.actorName:`#${Z.actorId}`,Fr=Z.actorName&&Z.actorId?` (#${Z.actorId})`:"";Zt.push(`Akteur: ${ar}${Fr}`)}return Z.source&&Zt.push(`Quelle: ${Z.source}`),xr&&Zt.push(xr),Zt.length||Zt.push("-"),T.jsxs("tr",{className:`text-sm text-stormGrey-700 ${_t}`,children:[T.jsx("td",{className:"px-6 py-4 align-top",children:T.jsx(Q.Typography,{variant:"small",className:"block text-xs font-medium text-stormGrey-600",children:LB(Z.timestamp)})}),T.jsx("td",{className:"px-6 py-4 align-top",children:T.jsxs("div",{className:"flex flex-col gap-2",children:[T.jsx("span",{className:"font-medium",children:jt}),T.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-stormGrey-400",children:[Z.eventType&&T.jsx("span",{className:"rounded-full bg-citrusPunch-600/80 px-2 py-0.5 text-white",children:Z.eventType}),Z.action&&T.jsx("span",{className:"rounded-full bg-emeraldMist-500/80 px-2 py-0.5 text-white",children:Z.action})]})]})}),T.jsxs("td",{className:"px-6 py-4 align-top",children:[T.jsx(Q.Typography,{variant:"small",className:`font-semibold ${Re}`,children:Z.status||"-"}),Z.severity&&T.jsx(Q.Typography,{variant:"small",className:"text-xs text-stormGrey-400",children:Z.severity})]}),T.jsx("td",{className:"px-6 py-4 align-top",children:T.jsxs("div",{className:"flex flex-col gap-1",children:[T.jsx("span",{className:"font-medium break-words",children:vt}),Ct.length>0&&T.jsx("div",{className:"flex flex-col text-xs text-stormGrey-400",children:Ct.map(ar=>T.jsx("span",{className:"break-words",children:ar},ar))})]})}),T.jsx("td",{className:"px-6 py-4 align-top",children:T.jsxs("div",{className:"flex flex-col gap-1",children:[T.jsx("span",{className:"font-medium break-words",children:cr}),lt.length>0&&T.jsx("div",{className:"flex flex-col text-xs text-stormGrey-400",children:lt.map(ar=>T.jsx("span",{className:"break-words",children:ar},ar))})]})}),T.jsx("td",{className:"px-6 py-4 align-top",children:T.jsx(Q.Typography,{variant:"small",className:"break-words",children:Z.message||"-"})}),T.jsx("td",{className:"px-6 py-4 align-top",children:T.jsx("div",{className:"flex flex-col gap-1 text-xs text-stormGrey-500",children:Zt.map((ar,Fr)=>T.jsx("span",{className:"break-words",children:ar},Fr))})}),T.jsx("td",{className:"px-6 py-4 align-top",children:T.jsx(Q.Typography,{variant:"small",children:T.jsx("button",{onClick:()=>Yr(Z.id),disabled:i,className:"rounded-md border border-sunsetCoral-600 px-3 py-1 text-xs text-sunsetCoral-800 transition hover:bg-sunsetCoral-600/20 disabled:opacity-60",children:"Löschen"})})})]},Z.id)})})]})}),T.jsxs("div",{className:"mt-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[T.jsx(Q.Typography,{variant:"small",color:"gray",children:""}),T.jsx(jf,{disabled:r&&e.length===0})]})]})]})]})}const WB=e=>Array.isArray(e)?e.map(t=>{if(t&&typeof t=="object"){const r=Number(t.id),n=typeof t.name=="string"?t.name:"";return n?{id:Number.isFinite(r)?r:null,name:n}:null}if(typeof t=="string"){const r=t.trim();return r?{id:null,name:r}:null}return null}).filter(Boolean):[];function HB(){const[e,t]=j.useState([]),[r,n]=j.useState(!1),[o,a]=j.useState(""),[i,u]=j.useState(""),[f,g]=j.useState([]),[b,_]=j.useState(!1),[O,S]=j.useState(""),[C,w]=j.useState(""),[m,d]=j.useState(""),[l,c]=j.useState(""),[s,h]=j.useState(""),[v,y]=j.useState(""),[E,P]=j.useState(!1),[N,R]=j.useState(null),[M,D]=j.useState(null),{showToast:L}=El(),{maintenance:W}=pi(),U=!!(W!=null&&W.active),Y=ii(),$=j.useCallback(()=>{},[]),{page:z,perPage:H,perPageOptions:G,perPageIsAll:X,handlePerPageChange:ie,setPage:fe,setTotals:pe,resetPagination:oe}=bu();j.useEffect(()=>()=>oe(),[oe]);const se=j.useCallback(async()=>{var me,te,ge;n(!0),a("");try{const _e=await at.get("/api/users"),Ce=(Array.isArray((me=_e.data)==null?void 0:me.items)?_e.data.items:[]).map(we=>({id:we.id,username:we.username||"",email:we.email||"",isActive:!!we.isActive,avatarColor:typeof we.avatarColor=="string"?we.avatarColor.trim():null,lastLogin:we.lastLogin||null,createdAt:we.createdAt||null,updatedAt:we.updatedAt||null,groups:WB(we.groups)})).sort((we,Ie)=>we.username.localeCompare(Ie.username,"de-DE"));t(Ce)}catch(_e){const Pe=((ge=(te=_e.response)==null?void 0:te.data)==null?void 0:ge.error)||_e.message||"Unbekannter Fehler";a(Pe),L({variant:"error",title:"Benutzer konnten nicht geladen werden",description:Pe})}finally{n(!1)}},[L]),ee=j.useCallback(async()=>{var me,te,ge;_(!0),S("");try{const _e=await at.get("/api/groups"),Ce=(Array.isArray((me=_e.data)==null?void 0:me.items)?_e.data.items:[]).map(we=>({id:Number(we.id),name:we.name||""})).filter(we=>Number.isFinite(we.id)&&we.id>0&&we.name).filter(we=>we.name.toLowerCase()!=="superuser").sort((we,Ie)=>we.name.localeCompare(Ie.name,"de-DE"));g(Ce)}catch(_e){const Pe=((ge=(te=_e.response)==null?void 0:te.data)==null?void 0:ge.error)||_e.message||"Benutzergruppen konnten nicht geladen werden.";S(Pe),L({variant:"error",title:"Benutzergruppen",description:Pe})}finally{_(!1)}},[L]);j.useEffect(()=>{se()},[se]),j.useEffect(()=>{ee()},[ee]),j.useCallback(()=>{se(),ee()},[se,ee]);const ae=j.useCallback(me=>{u(me.target.value)},[]);j.useCallback(()=>{u("")},[]),j.useEffect(()=>{z!==1&&fe(1)},[i,z,fe]);const ue=j.useMemo(()=>{const me=i.trim().toLowerCase();return me?e.filter(te=>[te.username,te.email,...te.groups.map(_e=>_e.name)].map(_e=>String(_e||"").toLowerCase()).some(_e=>_e.includes(me))):e},[e,i]),de=j.useMemo(()=>{if(X)return null;const me=Number(H);return Number.isFinite(me)&&me>0?me:null},[H,X]),Te=j.useMemo(()=>{if(X||!de)return ue;const me=(z-1)*de;return ue.slice(me,me+de)},[ue,z,X,de]),xe=ue.length,be=Te.length;j.useEffect(()=>{if(X){pe(xe,xe),z!==1&&fe(1);return}const me=Number(H);if(!Number.isFinite(me)||me<=0){pe(xe,xe);return}const te=Math.max(1,Math.ceil(xe/me));if(z>te){fe(te);return}pe(xe,be)},[xe,be,z,H,X,fe,pe]);const Se=j.useCallback(me=>{if(!me)return"–";const te=typeof me=="string"?me.replace(" ","T"):me,ge=new Date(te);return Number.isNaN(ge.getTime())?me:new Intl.DateTimeFormat("de-DE",{dateStyle:"short",timeStyle:"short"}).format(ge)},[]),je=j.useCallback(()=>{w(""),d(""),c(""),h(""),y("")},[]),qe=j.useCallback(async me=>{var Pe,Ce;if(U||!(me!=null&&me.id))return;if(Array.isArray(me==null?void 0:me.groups)?me.groups.some(we=>((we==null?void 0:we.name)||"").toLowerCase()==="superuser"):!1){L({variant:"error",title:"Löschen nicht möglich",description:"Der Superuser kann nicht gelöscht werden."});return}if(!window.confirm(`Benutzer "${me.username}" wirklich löschen?`))return;const _e=Number(me.id);if(!Number.isFinite(_e)||_e<=0){L({variant:"error",title:"Löschen fehlgeschlagen",description:"Ungültige Benutzer-ID."});return}R(_e);try{await at.delete(`/api/users/${_e}`),L({variant:"success",title:"Benutzer gelöscht",description:`Der Benutzer "${me.username}" wurde entfernt.`}),se()}catch(we){const Ie=(Ce=(Pe=we.response)==null?void 0:Pe.data)==null?void 0:Ce.error;let Ue="Der Benutzer konnte nicht gelöscht werden.";Ie==="INVALID_USER_ID"?Ue="Die Benutzer-ID ist ungültig.":Ie==="USER_NOT_FOUND"?Ue="Der Benutzer wurde bereits entfernt.":Ie==="USER_SUPERUSER_PROTECTED"&&(Ue="Der Superuser kann nicht gelöscht werden."),L({variant:"error",title:"Löschen fehlgeschlagen",description:Ue})}finally{R(null)}},[U,L,se]),nt=j.useCallback(async me=>{var Pe,Ce;if(!(me!=null&&me.id))return;if(U){L({variant:"error",title:"Aktion nicht möglich",description:"Im Wartungsmodus können keine Statusänderungen durchgeführt werden."});return}if((Array.isArray(me==null?void 0:me.groups)?me.groups.some(we=>((we==null?void 0:we.name)||"").toLowerCase()==="superuser"):!1)&&me.isActive){L({variant:"error",title:"Änderung nicht möglich",description:"Der Superuser kann nicht deaktiviert werden."});return}const ge=Number(me.id);if(!Number.isFinite(ge)||ge<=0){L({variant:"error",title:"Statusänderung fehlgeschlagen",description:"Ungültige Benutzer-ID."});return}const _e=!me.isActive;D(ge);try{await at.put(`/api/users/${ge}/active`,{isActive:_e}),se(),L({variant:"success",title:"Status aktualisiert",description:`Der Benutzer wurde ${_e?"aktiviert":"deaktiviert"}.`})}catch(we){const Ie=(Ce=(Pe=we.response)==null?void 0:Pe.data)==null?void 0:Ce.error;let Ue="Der Benutzerstatus konnte nicht geändert werden.";Ie==="INVALID_USER_ID"?Ue="Die Benutzer-ID ist ungültig.":Ie==="USER_NOT_FOUND"?Ue="Der Benutzer wurde nicht gefunden.":Ie==="USER_SUPERUSER_PROTECTED"&&(Ue="Der Superuser kann nicht deaktiviert werden."),L({variant:"error",title:"Statusänderung fehlgeschlagen",description:Ue})}finally{D(null)}},[U,L,se]),ut=j.useCallback(async()=>{var ge,_e,Pe,Ce;if(U)return;const me=C.trim();if(!me){y("Benutzername ist erforderlich.");return}const te=typeof l=="string"?l.trim():"";if(te.length<8){y("Passwort muss mindestens 8 Zeichen enthalten.");return}if(!s){y("Bitte eine globale Rolle auswählen.");return}P(!0),y("");try{const we={username:me,password:te,groupId:Number(s)},Ie=m.trim();Ie&&(we.email=Ie);const Ue=await at.post("/api/users",we);je(),se(),L({variant:"success",title:"Benutzer angelegt",description:`Der Benutzer "${((_e=(ge=Ue.data)==null?void 0:ge.item)==null?void 0:_e.username)??me}" wurde erstellt.`})}catch(we){const Ie=(Ce=(Pe=we.response)==null?void 0:Pe.data)==null?void 0:Ce.error;let Ue="Benutzer konnte nicht angelegt werden.";switch(Ie){case"USERNAME_REQUIRED":Ue="Benutzername ist erforderlich.";break;case"INVALID_EMAIL":Ue="Bitte eine gültige E-Mail-Adresse angeben.";break;case"INVALID_PASSWORD":case"PASSWORD_TOO_SHORT":Ue="Passwort muss mindestens 8 Zeichen enthalten.";break;case"INVALID_GROUP_ID":case"GROUP_NOT_FOUND":Ue="Bitte eine gültige globale Rolle auswählen.";break;case"USERNAME_TAKEN":Ue="Benutzername wird bereits verwendet.";break;case"EMAIL_TAKEN":Ue="E-Mail-Adresse wird bereits verwendet.";break}y(Ue),L({variant:"error",title:"Erstellen fehlgeschlagen",description:Ue})}finally{P(!1)}},[U,C,m,l,s,L,je,se]),Ye=f.length>0,rt=U||E||b||!Ye,Je=U||E||b||!Ye,Ve=j.useCallback(me=>{if(me&&me.props&&me.props.children)return me.props.children;if(!s)return"Bitte auswählen";const te=f.find(ge=>String(ge.id)===s);return te?te.name:"Bitte auswählen"},[f,s]);return T.jsx("div",{className:"mt-12",children:T.jsxs(Q.Card,{children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:T.jsx(Q.Typography,{variant:"h6",color:"white",children:T.jsx("span",{children:"Benutzerverwaltung"})})}),T.jsxs(Q.CardBody,{className:"pt-0",children:[U&&T.jsx("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:"Wartungsmodus aktiv – Änderungen sind deaktiviert. Die Liste kann dennoch angezeigt werden."}),T.jsxs("div",{className:"mb-8 rounded-lg border border-blue-gray-100 bg-white p-4 shadow-sm",children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mb-2",children:"Neuen Benutzer anlegen"}),Ye?T.jsxs(T.Fragment,{children:[T.jsx(Q.Typography,{variant:"small",className:"text-sm text-stormGrey-500 mb-4",children:"Benutzername, Passwort (mindestens 8 Zeichen) und eine globale Rolle sind Pflichtfelder."}),v&&T.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:v}),O&&T.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:O}),T.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[T.jsx(Q.Input,{label:"Benutzername",value:C,onChange:me=>w(me.target.value),disabled:U||E,crossOrigin:""}),T.jsx(Q.Input,{label:"E-Mail (optional)",value:m,onChange:me=>d(me.target.value),disabled:U||E,crossOrigin:""}),T.jsx(Q.Input,{type:"password",label:"Passwort",value:l,onChange:me=>c(me.target.value),disabled:U||E,crossOrigin:""}),T.jsxs(Q.Select,{label:"Globale Rolle",variant:"outlined",value:s,onChange:h,disabled:Je,selected:Ve,children:[T.jsx(Q.Option,{value:"",children:"Bitte auswählen"}),f.map(me=>T.jsx(Q.Option,{value:String(me.id),children:me.name},me.id))]})]}),T.jsx("div",{className:"mt-4 text-sm text-stormGrey-500",children:b?"Benutzergruppen werden geladen ...":""}),T.jsxs("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[T.jsx(Q.Button,{color:"green",onClick:ut,disabled:rt,children:E?"Speichert ...":"Benutzer anlegen"}),T.jsx(Q.Button,{variant:"text",color:"blue-gray",onClick:je,disabled:E,children:"Formular zurücksetzen"})]})]}):T.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:"Es existiert keine verfügbare Benutzergruppe. Bitte lege zuerst eine Gruppe an."})]}),T.jsx("div",{className:"mb-8",children:T.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between mt-8",children:[T.jsx("div",{className:"md:flex-1",children:T.jsx(Q.Input,{label:"Suchen nach Name, E-Mail oder Gruppe",value:i,onChange:ae,disabled:r&&!e.length,crossOrigin:""})}),T.jsx("div",{className:"md:mt-0 mt-8 md:flex-1",children:T.jsx(Q.Select,{variant:"static",label:"Einträge pro Seite",onChange:$,value:H,children:G.map(({value:me,label:te})=>T.jsx(Q.Option,{value:me,children:te},me))})})]})}),o&&T.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:o}),T.jsx("div",{className:"overflow-x-auto rounded-lg border border-blue-gray-50",children:T.jsxs("table",{className:"w-full min-w-[720px] table-auto text-left",children:[T.jsx("thead",{children:T.jsxs("tr",{className:"bg-blue-gray-50/50 text-xs uppercase tracking-wide text-stormGrey-400",children:[T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Benutzername"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"E-Mail"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Gruppen"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Status"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Letzte Anmeldung"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Erstellt am"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Aktionen"})]})}),T.jsx("tbody",{children:r&&e.length===0?T.jsx("tr",{children:T.jsx("td",{colSpan:7,className:"px-6 py-8 text-center text-blue-gray-400",children:"Benutzerdaten werden geladen ..."})}):Te.length===0?T.jsx("tr",{children:T.jsx("td",{colSpan:7,className:"px-6 py-8 text-center text-blue-gray-400",children:"Keine Benutzer gefunden."})}):Te.map((me,te)=>{const ge=te===Te.length-1?"":"border-b border-blue-gray-50",_e=Array.isArray(me==null?void 0:me.groups)?me.groups.some(Pe=>((Pe==null?void 0:Pe.name)||"").toLowerCase()==="superuser"):!1;return T.jsxs("tr",{className:`text-sm text-stormGrey-700 ${ge}`,children:[T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",className:"font-medium text-stormGrey-900",children:me.username||"–"})}),T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",children:me.email||"–"})}),T.jsx("td",{className:"px-6 py-4",children:me.groups.length>0?T.jsx("div",{className:"flex flex-wrap gap-2",children:me.groups.map(Pe=>T.jsx(Q.Chip,{value:Pe.name,size:"sm",color:"blue-gray",variant:"ghost"},Pe.id??Pe.name))}):T.jsx("span",{className:"text-stormGrey-400",children:"–"})}),T.jsx("td",{className:"px-6 py-4",children:T.jsx("button",{type:"button",className:`inline-flex items-center rounded-full px-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 ${U?"cursor-not-allowed":"cursor-pointer"}`,onClick:()=>nt(me),disabled:U||M===me.id||Array.isArray(me.groups)&&me.groups.some(Pe=>((Pe==null?void 0:Pe.name)||"").toLowerCase()==="superuser"&&me.isActive),children:T.jsx(Q.Chip,{value:M===me.id?"Wechselt ...":me.isActive?"Aktiv":"Deaktiviert",size:"sm",color:me.isActive?"green":"red",variant:"ghost",className:"pointer-events-none"})})}),T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:Se(me.lastLogin)})}),T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:Se(me.createdAt)})}),T.jsx("td",{className:"px-6 py-4",children:T.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-2",children:[T.jsx(Q.Button,{size:"sm",variant:"outlined",color:"blue-gray",onClick:()=>Y(`/dashboard/users/${me.id}`),children:"Details"}),T.jsx(Q.Button,{size:"sm",variant:"text",color:"red",onClick:()=>qe(me),disabled:U||N===me.id||_e,children:_e?"":N===me.id?"Löscht ...":"Löschen"})]})})]},me.id)})})]})}),T.jsxs("div",{className:"mt-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[T.jsx(Q.Typography,{variant:"small",color:"gray",children:""}),T.jsx(jf,{disabled:r&&e.length===0})]})]})]})})}function $B(){const[e,t]=j.useState([]),[r,n]=j.useState(!1),[o,a]=j.useState(""),[i,u]=j.useState(""),[f,g]=j.useState(""),[b,_]=j.useState(""),[O,S]=j.useState(""),[C,w]=j.useState(!1),[m,d]=j.useState(null),{showToast:l}=El(),{maintenance:c}=pi(),s=!!(c!=null&&c.active),h=ii(),{page:v,perPage:y,perPageOptions:E,perPageIsAll:P,handlePerPageChange:N,setPage:R,setTotals:M,resetPagination:D}=bu();j.useEffect(()=>()=>D(),[D]);const L=j.useCallback(()=>{},[]),W=j.useCallback(async()=>{var se,ee,ae;n(!0),a("");try{const ue=await at.get("/api/groups"),Te=(Array.isArray((se=ue.data)==null?void 0:se.items)?ue.data.items:[]).map(xe=>({id:xe.id,name:xe.name||"",description:xe.description||"",avatarColor:xe.avatarColor||null,memberCount:Number(xe.memberCount)||0,members:Array.isArray(xe.members)?xe.members.map(be=>({id:be.id,username:be.username||""})).filter(be=>be.username):[],createdAt:xe.createdAt||null,updatedAt:xe.updatedAt||null})).sort((xe,be)=>xe.name.localeCompare(be.name,"de-DE"));t(Te)}catch(ue){const de=((ae=(ee=ue.response)==null?void 0:ee.data)==null?void 0:ae.error)||ue.message||"Unbekannter Fehler";a(de),l({variant:"error",title:"Benutzergruppen konnten nicht geladen werden",description:de})}finally{n(!1)}},[l]);j.useEffect(()=>{W()},[W]),j.useCallback(()=>{W()},[W]);const U=j.useCallback(se=>{u(se.target.value)},[]);j.useCallback(()=>{u("")},[]),j.useEffect(()=>{v!==1&&R(1)},[i,v,R]);const Y=j.useMemo(()=>{const se=i.trim().toLowerCase();return se?e.filter(ee=>[ee.name,ee.description,...ee.members.map(ue=>ue.username)].map(ue=>String(ue||"").toLowerCase()).some(ue=>ue.includes(se))):e},[e,i]),$=j.useMemo(()=>{if(P)return null;const se=Number(y);return Number.isFinite(se)&&se>0?se:null},[y,P]),z=j.useMemo(()=>{if(P||!$)return Y;const se=(v-1)*$;return Y.slice(se,se+$)},[Y,v,P,$]),H=Y.length,G=z.length;j.useEffect(()=>{if(P){M(H,H),v!==1&&R(1);return}const se=Number(y);if(!Number.isFinite(se)||se<=0){M(H,H);return}const ee=Math.max(1,Math.ceil(H/se));if(v>ee){R(ee);return}M(H,G)},[H,G,v,y,P,R,M]);const X=j.useCallback(se=>{if(!se)return"–";const ee=typeof se=="string"?se.replace(" ","T"):se,ae=new Date(ee);return Number.isNaN(ae.getTime())?se:new Intl.DateTimeFormat("de-DE",{dateStyle:"short",timeStyle:"short"}).format(ae)},[]),ie=j.useCallback(()=>{g(""),_(""),S("")},[]),fe=j.useCallback(async()=>{var ee,ae,ue,de;if(s)return;const se=f.trim();if(!se){S("Gruppenname ist erforderlich.");return}w(!0),S("");try{const Te={name:se},xe=b.trim();xe&&(Te.description=xe);const be=await at.post("/api/groups",Te);l({variant:"success",title:"Gruppe angelegt",description:`Die Benutzergruppe "${((ae=(ee=be.data)==null?void 0:ee.item)==null?void 0:ae.name)??se}" wurde erstellt.`}),ie(),W()}catch(Te){const xe=(de=(ue=Te.response)==null?void 0:ue.data)==null?void 0:de.error;let be="Benutzergruppe konnte nicht angelegt werden.";xe==="GROUP_NAME_REQUIRED"?be="Gruppenname ist erforderlich.":xe==="GROUP_NAME_TAKEN"&&(be="Der Gruppenname wird bereits verwendet."),S(be),l({variant:"error",title:"Erstellen fehlgeschlagen",description:be})}finally{w(!1)}},[s,f,b,l,ie,W]),pe=s||C,oe=j.useCallback(async se=>{var Te,xe;if(s||!(se!=null&&se.id))return;if(((se==null?void 0:se.name)||"").toLowerCase()==="superuser"){l({variant:"error",title:"Löschen nicht möglich",description:"Die Superuser-Gruppe kann nicht gelöscht werden."});return}if((Number(se.memberCount)||0)>0){l({variant:"error",title:"Löschen nicht möglich",description:"Die Gruppe enthält noch Benutzer. Bitte entfernen Sie diese zuerst."});return}if(!window.confirm(`Benutzergruppe "${se.name}" wirklich löschen?`))return;const de=Number(se.id);if(!Number.isFinite(de)||de<=0){l({variant:"error",title:"Löschen fehlgeschlagen",description:"Ungültige Gruppen-ID."});return}d(de);try{await at.delete(`/api/groups/${de}`),l({variant:"success",title:"Gruppe gelöscht",description:`Die Benutzergruppe "${se.name}" wurde entfernt.`}),W()}catch(be){const Se=(xe=(Te=be.response)==null?void 0:Te.data)==null?void 0:xe.error;let je="Die Benutzergruppe konnte nicht gelöscht werden.";Se==="INVALID_GROUP_ID"?je="Die Gruppen-ID ist ungültig.":Se==="GROUP_NOT_FOUND"?je="Die Benutzergruppe wurde bereits entfernt.":Se==="GROUP_HAS_MEMBERS"?je="Die Gruppe enthält noch Benutzer. Bitte entfernen Sie diese zuerst.":Se==="GROUP_SUPERUSER_PROTECTED"&&(je="Die Superuser-Gruppe kann nicht gelöscht werden."),l({variant:"error",title:"Löschen fehlgeschlagen",description:je})}finally{d(null)}},[s,l,W]);return T.jsx("div",{className:"mt-12",children:T.jsxs(Q.Card,{className:"border border-blue-gray-100 shadow-sm",children:[T.jsx(Q.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:T.jsx(Q.Typography,{variant:"h6",color:"white",children:T.jsx("span",{children:"Benutzergruppen"})})}),T.jsxs(Q.CardBody,{className:"pt-0",children:[s&&T.jsx("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:"Wartungsmodus aktiv – Änderungen sind deaktiviert. Die Liste kann dennoch angezeigt werden."}),T.jsxs("div",{className:"mb-8 rounded-lg border border-blue-gray-100 bg-white p-4 shadow-sm",children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mb-2",children:"Neue Benutzergruppe anlegen"}),T.jsx(Q.Typography,{variant:"small",className:"text-sm text-stormGrey-500 mb-4",children:"Der Gruppenname ist Pflicht, die Beschreibung optional."}),O&&T.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:O}),T.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[T.jsx(Q.Input,{label:"Gruppenname",value:f,onChange:se=>g(se.target.value),disabled:pe,crossOrigin:""}),T.jsx(Q.Input,{label:"Beschreibung (optional)",value:b,onChange:se=>_(se.target.value),disabled:pe,crossOrigin:""})]}),T.jsxs("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[T.jsx(Q.Button,{color:"green",onClick:fe,disabled:pe,children:C?"Speichert ...":"Gruppe anlegen"}),T.jsx(Q.Button,{variant:"text",color:"blue-gray",onClick:ie,disabled:C,children:"Formular zurücksetzen"})]})]}),T.jsx("div",{className:"mb-8",children:T.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[T.jsx("div",{className:"md:flex-1",children:T.jsx(Q.Input,{label:"Suchen nach Name, E-Mail oder Gruppe",value:i,onChange:U,disabled:r&&!e.length,crossOrigin:""})}),T.jsx("div",{className:"md:mt-0 mt-8 md:flex-1",children:T.jsx(Q.Select,{variant:"static",label:"Einträge pro Seite",onChange:L,value:y,children:E.map(({value:se,label:ee})=>T.jsx(Q.Option,{value:se,children:ee},se))})})]})}),o&&T.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:o}),o&&T.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:o}),T.jsx("div",{className:"overflow-x-auto rounded-lg border border-blue-gray-50",children:T.jsxs("table",{className:"w-full min-w-[720px] table-auto text-left",children:[T.jsx("thead",{children:T.jsxs("tr",{className:"bg-blue-gray-50/50 text-xs uppercase tracking-wide text-stormGrey-400",children:[T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Gruppenname"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Beschreibung"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Mitglieder"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Erstellt am"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Zuletzt aktualisiert"}),T.jsx("th",{className:"px-6 py-4 font-semibold",children:"Aktionen"})]})}),T.jsx("tbody",{children:r&&e.length===0?T.jsx("tr",{children:T.jsx("td",{colSpan:6,className:"px-6 py-8 text-center text-stormGrey-400",children:"Gruppen werden geladen ..."})}):z.length===0?T.jsx("tr",{children:T.jsx("td",{colSpan:6,className:"px-6 py-8 text-center text-stormGrey-400",children:"Keine Gruppen gefunden."})}):z.map((se,ee)=>{const ae=ee===z.length-1?"":"border-b border-blue-gray-50",ue=((se==null?void 0:se.name)||"").toLowerCase()==="superuser";return T.jsxs("tr",{className:`text-sm text-stormGrey-700 ${ae}`,children:[T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",className:"font-medium text-stormGrey-900",children:se.name||"–"})}),T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",children:se.description?se.description:T.jsx("span",{className:"text-stormGrey-400",children:"–"})})}),T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:se.memberCount.toLocaleString("de-DE")})}),T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:X(se.createdAt)})}),T.jsx("td",{className:"px-6 py-4",children:T.jsx(Q.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:X(se.updatedAt)})}),T.jsx("td",{className:"px-6 py-4",children:T.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-2",children:[T.jsx(Q.Button,{size:"sm",variant:"outlined",color:"blue-gray",onClick:()=>h(`/dashboard/usergroups/${se.id}`),children:"Details"}),T.jsx(Q.Button,{size:"sm",variant:"text",color:"red",onClick:()=>oe(se),disabled:s||m===se.id||Number(se.memberCount)>0||ue,children:ue?"":m===se.id?"Löscht ...":"Löschen"})]})})]},se.id)})})]})}),T.jsxs("div",{className:"mt-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[T.jsx(Q.Typography,{variant:"small",color:"gray",children:!r&&e.length===0?"Noch keine Gruppen angelegt.":`${H.toLocaleString("de-DE")} Gruppen gefunden`}),T.jsx(jf,{disabled:r&&e.length===0})]})]})]})})}const dl={chart:{toolbar:{show:!1}},title:{show:""},dataLabels:{enabled:!1},xaxis:{axisTicks:{show:!1},axisBorder:{show:!1},labels:{style:{colors:"#37474f",fontSize:"13px",fontFamily:"inherit",fontWeight:300}}},yaxis:{labels:{style:{colors:"#37474f",fontSize:"13px",fontFamily:"inherit",fontWeight:300}}},grid:{show:!0,borderColor:"#dddddd",strokeDashArray:5,xaxis:{lines:{show:!0}},padding:{top:5,right:20}},fill:{opacity:.8},tooltip:{theme:"dark"}};({...dl,xaxis:{...dl.xaxis}});({...dl,xaxis:{...dl.xaxis}});({...dl,xaxis:{...dl.xaxis}});const qB=[{title:"account",options:[{checked:!0,label:"Email me when someone follows me"},{checked:!1,label:"Email me when someone answers on my post"},{checked:!0,label:"Email me when someone mentions me"}]},{title:"application",options:[{checked:!1,label:"New launches and projects"},{checked:!0,label:"Monthly product updates"},{checked:!1,label:"Subscribe to newsletter"}]}],Fk=["bg-arcticBlue-600","bg-copperRust-500","bg-sunsetCoral-600","bg-mintTea-400","bg-lavenderSmoke-500","bg-emeraldMist-500","bg-roseQuartz-500","bg-auroraTeal-500","bg-citrusPunch-500","bg-mossGreen-400"],GB=e=>Array.isArray(e)?e.map(t=>{if(t&&typeof t=="object"){const r=Number(t.id),n=typeof t.name=="string"?t.name:"";return n?{id:Number.isFinite(r)?r:null,name:n}:null}if(typeof t=="string"){const r=t.trim();return r?{id:null,name:r}:null}return null}).filter(Boolean):[],jx=e=>({id:(e==null?void 0:e.id)??null,username:(e==null?void 0:e.username)||"",email:(e==null?void 0:e.email)||"",isActive:!!(e!=null&&e.isActive),avatarColor:(e==null?void 0:e.avatarColor)||null,lastLogin:(e==null?void 0:e.lastLogin)||null,createdAt:(e==null?void 0:e.createdAt)||null,updatedAt:(e==null?void 0:e.updatedAt)||null,groups:GB(e==null?void 0:e.groups)}),KB=e=>{if(!e||!Array.isArray(e.groups)||e.groups.length===0)return null;const t=e.groups.map(r=>Number(r.id)).find(r=>Number.isFinite(r)&&r>0);return Number.isFinite(t)?t:null},Go=e=>{if(!e)return{username:"",email:"",password:"",groupId:null,avatarColor:""};const t=KB(e);return{username:e.username||"",email:e.email||"",password:"",groupId:Number.isFinite(t)?t:null,avatarColor:e.avatarColor||""}};function YB(){const{userId:e}=C5(),{showToast:t}=El(),{maintenance:r}=pi(),[n,o]=j.useState(null),[a,i]=j.useState(Go(null)),u=j.useRef(Go(null)),[f,g]=j.useState(!1),[b,_]=j.useState(""),[O,S]=j.useState(!1),[C,w]=j.useState([]),[m,d]=j.useState(!1),[l,c]=j.useState(""),[s,h]=j.useState(!1),[v,y]=j.useState(""),E=!!(r!=null&&r.active),P=j.useMemo(()=>Array.isArray(n==null?void 0:n.groups)?n.groups.some(ee=>((ee==null?void 0:ee.name)||"").toLowerCase()==="superuser"):!1,[n]),N=j.useMemo(()=>{const ee=Number(e);return Number.isFinite(ee)?ee:null},[e]),R=j.useCallback(async()=>{var ee,ae,ue,de;if(!N){_("Ungültige Benutzer-ID."),o(null),i(Go(null)),u.current=Go(null),S(!0);return}g(!0),_("");try{const Te=await at.get(`/api/users/${N}`),xe=jx((ee=Te.data)==null?void 0:ee.item);if(!xe.id)throw new Error("USER_NOT_FOUND");o(xe);const be=Go(xe);u.current={...be},i(be),y("")}catch(Te){const xe=(ue=(ae=Te.response)==null?void 0:ae.data)==null?void 0:ue.error;let be="Benutzerdetails konnten nicht geladen werden.";xe==="USER_NOT_FOUND"?be="Der angeforderte Benutzer wurde nicht gefunden.":xe==="INVALID_USER_ID"?be="Die angegebene Benutzer-ID ist ungültig.":((de=Te.response)==null?void 0:de.status)===404&&(be="Der angeforderte Benutzer existiert nicht."),o(null),u.current=Go(null),i(Go(null)),_(be),t({variant:"error",title:"Fehler beim Laden",description:be})}finally{g(!1),S(!0)}},[N,t]),M=j.useCallback(async()=>{var ee,ae,ue;d(!0),c("");try{const de=await at.get("/api/groups"),xe=(Array.isArray((ee=de.data)==null?void 0:ee.items)?de.data.items:[]).map(be=>({id:Number(be.id),name:be.name||"",description:be.description||"",memberCount:Number.isFinite(Number(be.memberCount))?Number(be.memberCount):0})).filter(be=>Number.isFinite(be.id)&&be.id>0&&be.name).sort((be,Se)=>be.name.localeCompare(Se.name,"de-DE"));w(xe)}catch(de){const Te=((ue=(ae=de.response)==null?void 0:ae.data)==null?void 0:ue.error)||de.message||"Benutzergruppen konnten nicht geladen werden.";c(Te),t({variant:"error",title:"Benutzergruppen",description:Te})}finally{d(!1)}},[t]);j.useEffect(()=>{R()},[R]),j.useEffect(()=>{M()},[M]);const D=j.useMemo(()=>{if(!O||!n)return!1;const ee=u.current;if(!ee)return!1;const ae=ee.username||"",ue=a.username||"",de=ee.email||"",Te=a.email||"",xe=Number.isFinite(ee.groupId)?Number(ee.groupId):null,be=Number.isFinite(a.groupId)?Number(a.groupId):null,Se=ee.avatarColor||"",je=a.avatarColor||"",qe=!!(a.password&&a.password.trim().length>0);return ae!==ue||de!==Te||!P&&xe!==be||Se!==je||qe},[a,O,n,P]),L=j.useCallback(ee=>{var ae;return(ae=ee==null?void 0:ee.props)!=null&&ae.children?ee.props.children:a.avatarColor?a.avatarColor:"Standardfarbe"},[a.avatarColor]),W=j.useCallback(ee=>{const{value:ae}=ee.target;i(ue=>({...ue,username:ae}))},[]),U=j.useCallback(ee=>{const{value:ae}=ee.target;i(ue=>({...ue,email:ae}))},[]),Y=j.useCallback(ee=>{const{value:ae}=ee.target;i(ue=>({...ue,password:ae}))},[]),$=j.useCallback(ee=>{if(!ee){i(ue=>({...ue,groupId:null}));return}const ae=Number(ee);i(ue=>({...ue,groupId:Number.isFinite(ae)&&ae>0?ae:null}))},[]),z=j.useCallback(ee=>{i(ae=>({...ae,avatarColor:ee||""}))},[]),H=j.useCallback(async()=>{var ee,ae,ue,de;if(!(!n||!D)){h(!0),y("");try{const Te={username:a.username,email:a.email,password:a.password,avatarColor:a.avatarColor};P||(Te.groupId=a.groupId);const xe=await at.put(`/api/users/${n.id}`,Te),be=jx(((ee=xe.data)==null?void 0:ee.item)||((ae=xe.data)==null?void 0:ae.user));o(be);const Se=Go(be);u.current={...Se},i(Se),c(""),t({variant:"success",title:"Benutzer gespeichert",description:"Die Änderungen wurden erfolgreich gespeichert."})}catch(Te){const xe=(de=(ue=Te.response)==null?void 0:ue.data)==null?void 0:de.error;let be="Die Benutzerdaten konnten nicht gespeichert werden.";xe==="USERNAME_REQUIRED"?be="Bitte einen Benutzernamen angeben.":xe==="USERNAME_TAKEN"?be="Der Benutzername wird bereits verwendet.":xe==="INVALID_EMAIL"?be="Bitte eine gültige E-Mail-Adresse eingeben.":xe==="EMAIL_TAKEN"?be="Die E-Mail-Adresse wird bereits verwendet.":xe==="INVALID_PASSWORD"?be="Das Passwort ist ungültig.":xe==="PASSWORD_TOO_SHORT"?be="Das Passwort muss mindestens 8 Zeichen enthalten.":xe==="INVALID_AVATAR_COLOR"?be="Bitte eine gültige Avatar-Farbe auswählen.":xe==="GROUP_NOT_FOUND"&&(be="Die ausgewählte Benutzergruppe existiert nicht mehr.",c(be)),y(be),t({variant:"error",title:"Speichern fehlgeschlagen",description:be})}finally{h(!1)}}},[n,D,a,t,P]),G=j.useMemo(()=>{const ee=(a.username||a.email||"").trim();return ee?ee.charAt(0).toUpperCase():"?"},[a.username,a.email]),X=j.useMemo(()=>a.avatarColor?a.avatarColor:(n==null?void 0:n.avatarColor)||"",[a.avatarColor,n]),ie=j.useMemo(()=>Array.isArray(C)?C.filter(ee=>((ee==null?void 0:ee.name)||"").toLowerCase()!=="superuser"):[],[C]);j.useEffect(()=>{if(P)return;const ee=a.groupId?Number(a.groupId):null;ie.some(ue=>Number(ue.id)===ee)||i(ue=>({...ue,groupId:null}))},[ie,a.groupId,P]);const fe=E||s||!n||m,pe=E||s||!n,oe=E||s||!n,se=a.groupId?String(a.groupId):"";return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"relative mt-8 h-72 w-full overflow-hidden rounded-xl bg-[url('/img/background-image.png')] bg-cover\\tbg-center",children:T.jsx("div",{className:"absolute inset-0 h-full w-full bg-gray-900/75"})}),T.jsx(Q.Card,{className:"mx-3 -mt-16 mb-6 lg:mx-4 border border-blue-gray-100",children:T.jsxs(Q.CardBody,{className:"p-4",children:[T.jsxs("div",{className:"mb-10 flex flex-wrap items-center justify-between gap-6",children:[T.jsxs("div",{className:"flex items-center gap-6",children:[T.jsx("div",{className:`text-black flex h-[74px] w-[74px] items-center justify-center rounded-xl text-3xl font-semibold uppercase shadow-lg shadow-blue-gray-500/40 ${X}`,"aria-label":a.username||"Benutzeravatar",children:G}),T.jsxs("div",{children:[T.jsx(Q.Typography,{variant:"h5",color:"blue-gray",children:a.username||"–"}),T.jsx(Q.Typography,{className:"text-xs font-semibold tracking-wide text-stormGrey-400",children:a.email||"–"})]})]}),D&&T.jsx(Q.Button,{color:"green",className:"normal-case",onClick:H,disabled:E||s,children:s?"Speichert ...":"Änderungen speichern"})]}),f&&!n&&T.jsxs("div",{className:"mb-6 flex items-center gap-3 rounded-lg border border-blue-gray-50 bg-blue-gray-50/50 px-4 py-3 text-sm text-blue-gray-500",children:[T.jsx(Q.Spinner,{className:"h-4 w-4"}),T.jsx("span",{children:"Benutzerdaten werden geladen ..."})]}),b&&!f&&T.jsx("div",{className:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:b}),v&&!f&&T.jsx("div",{className:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:v}),T.jsxs("div",{className:"grid-cols-1 mb-12 grid gap-12 px-4 lg:grid-cols-2 xl:grid-cols-3",children:[T.jsxs("div",{children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mb-4",children:"Allgemeine Einstellungen"}),T.jsxs("div",{className:"mb-6",children:[T.jsx(Q.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Benutzername"}),T.jsx(Q.Input,{value:a.username,onChange:W,placeholder:"Benutzername",disabled:oe,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),T.jsxs("div",{className:"mb-6",children:[T.jsx(Q.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"E-Mail-Adresse"}),T.jsx(Q.Input,{type:"email",value:a.email,onChange:U,placeholder:"benutzer@example.com",disabled:oe,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),T.jsxs("div",{className:"mb-6",children:[T.jsx(Q.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Neues Passwort"}),T.jsx(Q.Input,{type:"password",value:a.password,onChange:Y,placeholder:"Passwort setzen",disabled:oe,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}}),T.jsx(Q.Typography,{className:"mt-1 text-xs text-blue-gray-400",children:"Das Passwort wird nur geändert, wenn ein neuer Wert eingetragen wird."})]}),T.jsxs("div",{className:"mb-6",children:[T.jsx(Q.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Globale Rolle"}),E&&T.jsx("div",{className:"mb-3 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:"Wartungsmodus aktiv – Änderungen sind deaktiviert."}),l&&!P&&T.jsx("div",{className:"mb-3 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:l}),P?T.jsx(Q.Typography,{className:"block text-xs font-semibold uppercase text-blue-gray-500",children:"Die Rolle für den Superuser kann nicht geändert werden."}):m&&C.length===0?T.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-blue-gray-50 bg-blue-gray-50/50 px-4 py-3 text-sm text-blue-gray-500",children:[T.jsx(Q.Spinner,{className:"h-4 w-4"}),T.jsx("span",{children:"Benutzergruppen werden geladen ..."})]}):ie.length===0?T.jsx(Q.Typography,{className:"block text-xs font-semibold uppercase text-blue-gray-500",children:"Es sind keine weiteren Benutzergruppen vorhanden. Bitte lege zunächst eine neue Gruppe an."}):T.jsx(Q.Select,{label:"Benutzergruppe wählen",value:se,onChange:$,disabled:fe,variant:"outlined",children:ie.map(ee=>T.jsx(Q.Option,{value:String(ee.id),children:ee.name},ee.id))})]}),T.jsxs("div",{className:"mb-6",children:[T.jsx(Q.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Avatar-Farbe"}),T.jsxs(Q.Select,{label:"Avatar-Farbe auswählen",variant:"outlined",value:a.avatarColor,onChange:z,disabled:pe,selected:L,children:[T.jsx(Q.Option,{value:"",children:T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx("span",{className:"h-4 w-4 rounded border border-blue-gray-100"}),T.jsx("span",{className:"text-xs",children:"Keine"})]})}),Fk.map(ee=>T.jsx(Q.Option,{value:ee,children:T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx("span",{className:`h-4 w-4 rounded border border-blue-gray-100 ${ee}`}),T.jsx("span",{className:"text-xs",children:ee})]})},ee))]})]})]}),T.jsxs("div",{children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mb-3",children:"Platform Settings"}),T.jsx("div",{className:"flex flex-col gap-12",children:qB.map(({title:ee,options:ae})=>T.jsxs("div",{children:[T.jsx(Q.Typography,{className:"mb-4 block text-xs font-semibold uppercase text-blue-gray-500",children:ee}),T.jsx("div",{className:"flex flex-col gap-6",children:ae.map(({checked:ue,label:de})=>T.jsx(Q.Switch,{id:de,label:de,defaultChecked:ue,labelProps:{className:"text-sm font-normal text-blue-gray-500"}},de))})]},ee))})]})]})]})})]})}const Rx=e=>({id:(e==null?void 0:e.id)??null,name:(e==null?void 0:e.name)||"",description:(e==null?void 0:e.description)||"",avatarColor:(e==null?void 0:e.avatarColor)||null,createdAt:(e==null?void 0:e.createdAt)||null,updatedAt:(e==null?void 0:e.updatedAt)||null,memberCount:Number.isFinite(Number(e==null?void 0:e.memberCount))?Number(e.memberCount):0,members:Array.isArray(e==null?void 0:e.members)?e.members.map(t=>({id:(t==null?void 0:t.id)??null,username:(t==null?void 0:t.username)||""})).filter(t=>t.username):[]}),Ko=e=>e?{name:e.name||"",description:e.description||"",avatarColor:e.avatarColor||""}:{name:"",description:"",avatarColor:""};function QB(){const{groupId:e}=C5(),{showToast:t}=El(),{maintenance:r}=pi(),[n,o]=j.useState(null),[a,i]=j.useState(Ko(null)),u=j.useRef(Ko(null)),[f,g]=j.useState(!1),[b,_]=j.useState(""),[O,S]=j.useState(!1),[C,w]=j.useState(!1),[m,d]=j.useState(""),l=!!(r!=null&&r.active),c=j.useMemo(()=>((n==null?void 0:n.name)||"").toLowerCase()==="superuser",[n]),s=j.useMemo(()=>{const U=Number(e);return Number.isFinite(U)?U:null},[e]),h=j.useCallback(async()=>{var U,Y,$,z;if(!s){_("Ungültige Gruppen-ID."),o(null),i(Ko(null)),u.current=Ko(null),S(!0);return}g(!0),_("");try{const H=await at.get(`/api/groups/${s}`),G=Rx((U=H.data)==null?void 0:U.item);if(!G.id)throw new Error("GROUP_NOT_FOUND");o(G);const X=Ko(G);u.current={...X},i(X),d("")}catch(H){const G=($=(Y=H.response)==null?void 0:Y.data)==null?void 0:$.error;let X="Gruppendetails konnten nicht geladen werden.";G==="GROUP_NOT_FOUND"?X="Die angeforderte Benutzergruppe wurde nicht gefunden.":G==="INVALID_GROUP_ID"?X="Die angegebene Gruppen-ID ist ungültig.":((z=H.response)==null?void 0:z.status)===404&&(X="Die angeforderte Benutzergruppe existiert nicht."),o(null),u.current=Ko(null),i(Ko(null)),_(X),t({variant:"error",title:"Fehler beim Laden",description:X})}finally{g(!1),S(!0)}},[s,t]);j.useEffect(()=>{h()},[h]);const v=j.useMemo(()=>{if(!O||!n)return!1;const U=u.current;if(!U)return!1;const Y=U.name||"",$=a.name||"",z=U.description||"",H=a.description||"",G=U.avatarColor||"",X=a.avatarColor||"";return Y!==$||z!==H||G!==X},[a,O,n]),y=j.useCallback(U=>{const{value:Y}=U.target;i($=>({...$,name:Y}))},[]),E=j.useCallback(U=>{const{value:Y}=U.target;i($=>({...$,description:Y}))},[]),P=j.useCallback(U=>{i(Y=>({...Y,avatarColor:U||""}))},[]),N=j.useCallback(async()=>{var U,Y,$,z;if(!(!n||!v)){w(!0),d("");try{const H={avatarColor:a.avatarColor};c||(H.name=a.name,H.description=a.description);const G=await at.put(`/api/groups/${n.id}`,H),X=Rx(((U=G.data)==null?void 0:U.item)||((Y=G.data)==null?void 0:Y.group));o(X);const ie=Ko(X);u.current={...ie},i(ie),t({variant:"success",title:"Gruppe gespeichert",description:"Die Änderungen wurden erfolgreich gespeichert."})}catch(H){const G=(z=($=H.response)==null?void 0:$.data)==null?void 0:z.error;let X="Die Gruppe konnte nicht gespeichert werden.";G==="GROUP_NAME_REQUIRED"?X="Bitte einen Gruppennamen angeben.":G==="GROUP_NAME_TAKEN"?X="Der Gruppenname wird bereits verwendet.":G==="INVALID_AVATAR_COLOR"?X="Bitte eine gültige Avatar-Farbe auswählen.":G==="GROUP_NOT_FOUND"?X="Die Benutzergruppe wurde nicht gefunden.":G==="GROUP_SUPERUSER_PROTECTED"&&(X="Für die Superuser-Gruppe kann nur die Avatar-Farbe angepasst werden."),d(X),t({variant:"error",title:"Speichern fehlgeschlagen",description:X})}finally{w(!1)}}},[n,v,a,t,c]),R=j.useMemo(()=>{const U=(a.name||a.description||"").trim();return U?U.charAt(0).toUpperCase():"?"},[a.name,a.description]),M=j.useMemo(()=>a.avatarColor?a.avatarColor:(n==null?void 0:n.avatarColor)||"",[a.avatarColor,n]),D=l||C||!n,L=l||C||!n||c,W=a.avatarColor||"";return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"relative mt-8 h-72 w-full overflow-hidden rounded-xl bg-[url('/img/background-image.png')] bg-cover\\tbg-center",children:T.jsx("div",{className:"absolute inset-0 h-full w-full bg-gray-900/75"})}),T.jsx(Q.Card,{className:"mx-3 -mt-16 mb-6 lg:mx-4 border border-blue-gray-100",children:T.jsxs(Q.CardBody,{className:"p-4",children:[T.jsxs("div",{className:"mb-10 flex flex-wrap items-center justify-between gap-6",children:[T.jsxs("div",{className:"flex items-center gap-6",children:[T.jsx("div",{className:`text-black flex h-[74px] w-[74px] items-center justify-center rounded-xl text-3xl font-semibold uppercase shadow-lg shadow-blue-gray-500/40 ${M}`,"aria-label":a.name||"Gruppenavatar",children:R}),T.jsxs("div",{children:[T.jsx(Q.Typography,{variant:"h5",color:"blue-gray",children:a.name||"–"}),T.jsxs(Q.Typography,{className:"text-xs font-semibold tracking-wide text-stormGrey-400",children:["Gruppen-ID: ",(n==null?void 0:n.id)??"–"]})]})]}),v&&T.jsx(Q.Button,{color:"green",className:"normal-case",onClick:N,disabled:l||C,children:C?"Speichert ...":"Änderungen speichern"})]}),f&&!n&&T.jsxs("div",{className:"mb-6 flex items-center gap-3 rounded-lg border border-blue-gray-50 bg-blue-gray-50/50 px-4 py-3 text-sm text-blue-gray-500",children:[T.jsx(Q.Spinner,{className:"h-4 w-4"}),T.jsx("span",{children:"Gruppendaten werden geladen ..."})]}),b&&!f&&T.jsx("div",{className:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:b}),m&&!f&&T.jsx("div",{className:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:m}),T.jsxs("div",{className:"grid-cols-1 mb-12 grid gap-12 px-4 lg:grid-cols-2 xl:grid-cols-3",children:[T.jsxs("div",{children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mb-4",children:"Gruppendaten"}),(l||c)&&T.jsx("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:l?"Wartungsmodus aktiv – Änderungen sind deaktiviert.":"Systemgruppe – Name und Beschreibung sind geschützt."}),T.jsxs("div",{className:"mb-6",children:[T.jsx(Q.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Gruppenname"}),T.jsx(Q.Input,{value:a.name,onChange:y,placeholder:"Gruppenname",disabled:L,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),T.jsxs("div",{className:"mb-6",children:[T.jsx(Q.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Beschreibung"}),T.jsx(Q.Input,{value:a.description,onChange:E,placeholder:"Beschreibung der Gruppe",disabled:L,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),T.jsxs("div",{className:"mb-6",children:[T.jsx(Q.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Avatar-Farbe"}),T.jsxs(Q.Select,{label:"Avatar-Farbe auswählen",variant:"outlined",value:W,onChange:P,disabled:D,selected:U=>{var Y;return(Y=U==null?void 0:U.props)!=null&&Y.children?U.props.children:a.avatarColor?a.avatarColor:"Standardfarbe"},children:[T.jsx(Q.Option,{value:"",children:T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx("span",{className:"h-4 w-4 rounded border border-blue-gray-100"}),T.jsx("span",{className:"text-xs",children:"Keine"})]})}),Fk.map(U=>T.jsx(Q.Option,{value:U,children:T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx("span",{className:`h-4 w-4 rounded border border-blue-gray-100 ${U}`}),T.jsx("span",{className:"text-xs",children:U})]})},U))]})]})]}),T.jsxs("div",{children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mb-4",children:"Mitglieder"}),!n||n.members.length===0?T.jsx(Q.Typography,{className:"text-sm text-stormGrey-500",children:"Aktuell sind keine Benutzer dieser Gruppe zugeordnet."}):T.jsx("div",{className:"flex flex-wrap gap-2",children:n.members.map(U=>T.jsx(Q.Chip,{value:U.username,size:"sm",color:"blue-gray",variant:"ghost"},`${n.id}-${U.id}-${U.username}`))}),T.jsx("div",{className:"mt-6 text-xs text-stormGrey-400",children:T.jsxs("p",{children:["Mitglieder insgesamt: ",(n==null?void 0:n.memberCount)??0]})})]})]})]})})]})}const XB="/assets/pattern-68ea7609.png";function JB(){const e=ii(),[t,r]=j.useState(""),[n,o]=j.useState(""),[a,i]=j.useState(!1),[u,f]=j.useState(null),[g,b]=j.useState(!1);j.useEffect(()=>{let O=!0;const S=new AbortController;return(async()=>{try{const w=await fetch("/api/setup/status",{credentials:"include",signal:S.signal});if(w.ok&&!(await w.json()).setupComplete&&O){e("/setup",{replace:!0});return}const m=await fetch("/api/auth/session",{credentials:"include",signal:S.signal});if(m.ok){const d=await m.json();if(d!=null&&d.user&&O){e("/dashboard/stacks",{replace:!0});return}}}catch(w){w.name!=="AbortError"&&console.error("⚠️ [Auth] Initiale Prüfung fehlgeschlagen:",w)}finally{O&&b(!0)}})(),()=>{O=!1,S.abort()}},[e]);const _=j.useCallback(async O=>{if(O.preventDefault(),a)return;f(null);const S=t.trim(),C=n.trim();if(!S||!C){f("Bitte fülle beide Felder aus.");return}i(!0);try{const w=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({identifier:S,password:C})}),m=await w.json().catch(()=>({}));if(!w.ok){if(w.status===401||m.error==="INVALID_CREDENTIALS")f("Ungültige Zugangsdaten.");else if(m.error==="MISSING_CREDENTIALS")f("Bitte fülle beide Felder aus.");else if(m.error==="SETUP_REQUIRED"||m.error==="SUPERUSER_REQUIRED"){e("/setup",{replace:!0});return}else m.error==="USER_INACTIVE"?f("Dieses Konto ist deaktiviert. Bitte wende dich an einen Administrator."):f("Anmeldung fehlgeschlagen. Bitte versuche es erneut.");return}e("/dashboard/stacks",{replace:!0})}catch(w){console.error("⚠️ [Auth] Anmeldung fehlgeschlagen:",w),f("Netzwerkfehler – bitte erneut versuchen.")}finally{i(!1)}},[t,n,a,e]);return g?T.jsxs("section",{className:"m-8 flex gap-4",children:[T.jsxs("div",{className:"w-full lg:w-3/5 mt-24",children:[T.jsxs("div",{className:"text-center",children:[T.jsx(Q.Typography,{variant:"h2",className:"font-bold mb-4",children:"Anmelden"}),T.jsx(Q.Typography,{variant:"paragraph",color:"blue-gray",className:"text-lg font-normal",children:"Gib deine E-Mail oder deinen Benutzernamen sowie dein Passwort ein, um dich anzumelden."})]}),T.jsxs("form",{className:"mt-8 mb-2 mx-auto w-80 max-w-screen-lg lg:w-1/2",onSubmit:_,children:[T.jsxs("div",{className:"mb-1 flex flex-col gap-6",children:[T.jsx(Q.Typography,{variant:"small",color:"blue-gray",className:"-mb-3 font-medium",children:"E-Mail oder Benutzername"}),T.jsx(Q.Input,{size:"lg",placeholder:"E-Mail oder Benutzername",value:t,onChange:O=>r(O.target.value),required:!0,autoFocus:!0,disabled:a,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}}),T.jsx(Q.Typography,{variant:"small",color:"blue-gray",className:"-mb-3 font-medium",children:"Passwort"}),T.jsx(Q.Input,{type:"password",size:"lg",placeholder:"********",value:n,onChange:O=>o(O.target.value),required:!0,disabled:a,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),u&&T.jsx(Q.Alert,{color:"red",className:"mt-2 border border-red-200 bg-red-50 text-red-700",children:u}),T.jsx(Q.Button,{type:"submit",className:"mt-6",fullWidth:!0,disabled:a,children:a?"Anmeldung läuft ...":"Anmelden"})]})]}),T.jsx("div",{className:"w-2/5 h-full hidden lg:block",children:T.jsx("img",{src:XB,className:"h-full w-full object-cover rounded-3xl"})})]}):T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:T.jsx("span",{className:"text-blue-gray-500",children:"Pruefe Anmeldestatus ..."})})}function ZB(){return T.jsxs("section",{className:"m-8 flex",children:[T.jsx("div",{className:"w-2/5 h-full hidden lg:block",children:T.jsx("img",{src:"/img/pattern.png",className:"h-full w-full object-cover rounded-3xl"})}),T.jsxs("div",{className:"w-full lg:w-3/5 flex flex-col items-center justify-center",children:[T.jsxs("div",{className:"text-center",children:[T.jsx(Q.Typography,{variant:"h2",className:"font-bold mb-4",children:"Join Us Today"}),T.jsx(Q.Typography,{variant:"paragraph",color:"blue-gray",className:"text-lg font-normal",children:"Enter your email and password to register."})]}),T.jsxs("form",{className:"mt-8 mb-2 mx-auto w-80 max-w-screen-lg lg:w-1/2",children:[T.jsxs("div",{className:"mb-1 flex flex-col gap-6",children:[T.jsx(Q.Typography,{variant:"small",color:"blue-gray",className:"-mb-3 font-medium",children:"Your email"}),T.jsx(Q.Input,{size:"lg",placeholder:"name@mail.com",className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),T.jsx(Q.Checkbox,{label:T.jsxs(Q.Typography,{variant:"small",color:"gray",className:"flex items-center justify-start font-medium",children:["I agree the ",T.jsx("a",{href:"#",className:"font-normal text-black transition-colors hover:text-gray-900 underline",children:"Terms and Conditions"})]}),containerProps:{className:"-ml-2.5"}}),T.jsx(Q.Button,{className:"mt-6",fullWidth:!0,children:"Register Now"}),T.jsxs("div",{className:"space-y-4 mt-8",children:[T.jsxs(Q.Button,{size:"lg",color:"white",className:"flex items-center gap-2 justify-center shadow-md",fullWidth:!0,children:[T.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[T.jsxs("g",{clipPath:"url(#clip0_1156_824)",children:[T.jsx("path",{d:"M16.3442 8.18429C16.3442 7.64047 16.3001 7.09371 16.206 6.55872H8.66016V9.63937H12.9813C12.802 10.6329 12.2258 11.5119 11.3822 12.0704V14.0693H13.9602C15.4741 12.6759 16.3442 10.6182 16.3442 8.18429Z",fill:"#4285F4"}),T.jsx("path",{d:"M8.65974 16.0006C10.8174 16.0006 12.637 15.2922 13.9627 14.0693L11.3847 12.0704C10.6675 12.5584 9.7415 12.8347 8.66268 12.8347C6.5756 12.8347 4.80598 11.4266 4.17104 9.53357H1.51074V11.5942C2.86882 14.2956 5.63494 16.0006 8.65974 16.0006Z",fill:"#34A853"}),T.jsx("path",{d:"M4.16852 9.53356C3.83341 8.53999 3.83341 7.46411 4.16852 6.47054V4.40991H1.51116C0.376489 6.67043 0.376489 9.33367 1.51116 11.5942L4.16852 9.53356Z",fill:"#FBBC04"}),T.jsx("path",{d:"M8.65974 3.16644C9.80029 3.1488 10.9026 3.57798 11.7286 4.36578L14.0127 2.08174C12.5664 0.72367 10.6469 -0.0229773 8.65974 0.000539111C5.63494 0.000539111 2.86882 1.70548 1.51074 4.40987L4.1681 6.4705C4.8001 4.57449 6.57266 3.16644 8.65974 3.16644Z",fill:"#EA4335"})]}),T.jsx("defs",{children:T.jsx("clipPath",{id:"clip0_1156_824",children:T.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.5)"})})})]}),T.jsx("span",{children:"Sign in With Google"})]}),T.jsxs(Q.Button,{size:"lg",color:"white",className:"flex items-center gap-2 justify-center shadow-md",fullWidth:!0,children:[T.jsx("img",{src:"/img/twitter-logo.svg",height:24,width:24,alt:""}),T.jsx("span",{children:"Sign in With Twitter"})]})]}),T.jsxs(Q.Typography,{variant:"paragraph",className:"text-center text-blue-gray-500 font-medium mt-4",children:["Already have an account?",T.jsx(P5,{to:"/auth/sign-in",className:"text-gray-900 ml-1",children:"Sign in"})]})]})]})]})}const Ia={className:"w-5 h-5 text-inherit"},Hh=[{layout:"dashboard",pages:[{icon:T.jsx(QI,{...Ia}),name:"stacks",path:"/stacks",element:T.jsx(EB,{})},{icon:T.jsx(a4,{...Ia}),name:"wartung",path:"/maintenance",element:T.jsx(MB,{})},{icon:T.jsx(VI,{...Ia}),name:"logs",path:"/logs",element:T.jsx(UB,{})},{icon:T.jsx(r4,{...Ia}),name:"benutzer",path:"/users",element:T.jsx(HB,{})},{icon:T.jsx(ZI,{...Ia}),name:"rechtegruppen",path:"/usergroups",element:T.jsx($B,{})}]},{title:"auth pages",layout:"auth",pages:[{icon:T.jsx(GI,{...Ia}),name:"sign in",path:"/sign-in",element:T.jsx(JB,{})},{icon:T.jsx(HI,{...Ia}),name:"sign up",path:"/sign-up",element:T.jsx(ZB,{})}]}];function zk(){const[e,t]=Pf(),{sidenavType:r}=e,n=_a(),o=ii(),[a,i]=j.useState(!1),[u,f]=j.useState(!0),[g,b]=j.useState(!1),[_,O]=j.useState(!1),S=j.useCallback(async()=>{i(!1);try{const w=await fetch("/api/setup/status",{credentials:"include"});if(!w.ok)throw new Error("STATUS_REQUEST_FAILED");const m=await w.json();f(!m.setupComplete)}catch(w){console.error("⚠️ [Setup] Statusprüfung fehlgeschlagen:",w),f(!0)}finally{i(!0)}},[]),C=j.useCallback(async()=>{b(!1);try{const w=await fetch("/api/auth/session",{credentials:"include"});if(w.status===403){f(!0),O(!1);return}if(!w.ok){O(!1);return}const m=await w.json();O(!!(m!=null&&m.user))}catch(w){console.error("⚠️ [Auth] Sessionprüfung fehlgeschlagen:",w),O(!1)}finally{b(!0)}},[f,O,b]);return j.useEffect(()=>{S()},[S]),j.useEffect(()=>{!a||u||C()},[a,u,C]),j.useEffect(()=>{if(a){if(u){n.pathname!=="/setup"&&o("/setup",{replace:!0});return}if(g){if(!_){n.pathname!=="/auth/sign-in"&&o("/auth/sign-in",{replace:!0});return}(n.pathname==="/setup"||n.pathname.startsWith("/auth/"))&&o("/dashboard/stacks",{replace:!0})}}},[a,u,g,_,n.pathname,o]),a?u?T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:T.jsx("span",{className:"text-blue-gray-500",children:"Setup erforderlich ..."})}):g?_?T.jsxs("div",{className:"min-h-screen bg-blue-gray-50/50",children:[T.jsx(kf,{routes:Hh,brandImg:r==="dark"?"/img/logo-ct.png":"/img/logo-ct-dark.png"}),T.jsxs("div",{className:"p-4 xl:ml-80",children:[T.jsx(yk,{}),T.jsx(wk,{}),T.jsx(Q.IconButton,{size:"lg",color:"white",className:"fixed bottom-8 right-8 z-40 rounded-full shadow-blue-gray-900/10 xl:hidden",ripple:!1,onClick:()=>tb(t,!0),children:T.jsx(k5,{className:"h-5 w-5"})}),T.jsxs(Qg,{children:[Hh.map(({layout:w,pages:m})=>w==="dashboard"&&m.map(({path:d,element:l})=>T.jsx(_o,{exact:!0,path:d,element:l}))),T.jsx(_o,{path:"users/:userId",element:T.jsx(YB,{})}),T.jsx(_o,{path:"usergroups/:groupId",element:T.jsx(QB,{})})]}),T.jsx("div",{className:"text-blue-gray-600",children:T.jsx(xk,{})})]})]}):T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:T.jsx("span",{className:"text-blue-gray-500",children:"Weiterleitung zur Anmeldung ..."})}):T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:T.jsx("span",{className:"text-blue-gray-500",children:"Pruefe Anmeldung ..."})}):T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:T.jsx("span",{className:"text-blue-gray-500",children:"Pruefe Systemkonfiguration ..."})})}zk.displayName="/src/layout/dashboard.jsx";function Bk(){return T.jsx("div",{className:"relative min-h-screen w-full",children:T.jsx(Qg,{children:Hh.map(({layout:e,pages:t})=>e==="auth"&&t.map(({path:r,element:n})=>T.jsx(_o,{exact:!0,path:r,element:n})))})})}Bk.displayName="/src/layout/Auth.jsx";const eV={superuser:{username:"",email:"",password:""},server:{name:"",url:""},endpoint:{name:"",externalId:"",serverId:""},apiKey:""};function tV(){var xe,be,Se,je,qe,nt,ut,Ye,rt;const e=ii(),[t,r]=j.useState(null),[n,o]=j.useState(!0),[a,i]=j.useState(null),[u,f]=j.useState(eV),[g,b]=j.useState(!1),[_,O]=j.useState(null),[S,C]=j.useState(!1);j.useEffect(()=>{let Je=!0;const Ve=new AbortController;return(async()=>{o(!0),i(null);try{const te=await fetch("/api/setup/status",{signal:Ve.signal,credentials:"include"});if(!te.ok)throw new Error("STATUS_REQUEST_FAILED");const ge=await te.json();if(!Je)return;if(r(ge),ge.setupComplete){e("/auth/sign-in",{replace:!0});return}f(_e=>{var Pe,Ce,we,Ie,Ue,Ze,Bt,et,Xt,qt,Et,tr,Jt,Nt;return{superuser:{username:(Ce=(Pe=ge.envDefaults)==null?void 0:Pe.superuserUsername)!=null&&Ce.length?ge.envDefaults.superuserUsername:_e.superuser.username,email:(Ie=(we=ge.envDefaults)==null?void 0:we.superuserEmail)!=null&&Ie.length?ge.envDefaults.superuserEmail:_e.superuser.email,password:(Ze=(Ue=ge.envDefaults)==null?void 0:Ue.superuserPassword)!=null&&Ze.length?ge.envDefaults.superuserPassword:_e.superuser.password},server:{name:((Bt=ge.envDefaults)==null?void 0:Bt.serverName)||_e.server.name,url:(Xt=(et=ge.envDefaults)==null?void 0:et.serverUrl)!=null&&Xt.length?ge.envDefaults.serverUrl:_e.server.url},endpoint:{name:((qt=ge.envDefaults)==null?void 0:qt.endpointName)||_e.endpoint.name,externalId:(tr=(Et=ge.envDefaults)==null?void 0:Et.endpointExternalId)!=null&&tr.length?ge.envDefaults.endpointExternalId:_e.endpoint.externalId,serverId:_e.endpoint.serverId||""},apiKey:(Nt=(Jt=ge.envDefaults)==null?void 0:Jt.apiKeyValue)!=null&&Nt.length?ge.envDefaults.apiKeyValue:_e.apiKey}})}catch(te){if(te.name==="AbortError")return;console.error("⚠️ [Setup] Status konnte nicht geladen werden:",te),Je&&i("Setup-Status konnte nicht geladen werden. Bitte Seite aktualisieren.")}finally{Je&&o(!1)}})(),()=>{Je=!1,Ve.abort()}},[e]);const w=(t==null?void 0:t.envDefaults)||{},m=w.superuserUsername??"",d=w.superuserEmail??"",l=w.superuserPassword??"",c=w.serverUrl??"",s=w.endpointExternalId??"",h=w.apiKeyValue??"",v=!!((xe=t==null?void 0:t.requirements)!=null&&xe.superuser),y=!!((be=t==null?void 0:t.requirements)!=null&&be.server),E=!!((Se=t==null?void 0:t.requirements)!=null&&Se.endpoint),P=!!((je=t==null?void 0:t.requirements)!=null&&je.apiKey),N=!!((qe=t==null?void 0:t.apiKeys)!=null&&qe.count),R=!!(c||(nt=t==null?void 0:t.servers)!=null&&nt.envProvided),M=!!(s||(ut=t==null?void 0:t.endpoints)!=null&&ut.envProvided),D=!!(h||(Ye=t==null?void 0:t.apiKeys)!=null&&Ye.envProvided),L=y||R,W=E||M,U=P||!N||D,Y=!!m,$=!!d,z=!!l,H=!!w.serverNameFromEnv,G=!!c,X=!!w.endpointNameFromEnv,ie=!!s,fe=!!h,pe=j.useCallback((Je,Ve,{locked:me=!1}={})=>te=>{if(me)return;const ge=te.target.value;f(_e=>({..._e,[Je]:{..._e[Je],[Ve]:ge}}))},[]),oe=j.useMemo(()=>{if(!t)return[];const Je=[];if(v){const{username:Ve,email:me,password:te}=u.superuser;Ve.trim()||Je.push("Benutzername ist erforderlich."),me.trim()||Je.push("E-Mail-Adresse ist erforderlich."),te.trim()||Je.push("Passwort ist erforderlich.")}return y&&!u.server.url.trim()&&Je.push("Server-URL ist erforderlich."),E&&!u.endpoint.externalId.trim()&&Je.push("Endpoint-ID ist erforderlich."),U&&P&&!u.apiKey.trim()&&Je.push("API-Key ist erforderlich."),Je},[u,v,y,E,U,P,t]),se=j.useCallback(async Je=>{if(Je.preventDefault(),g||!t)return;if(O(null),C(!1),oe.length){O(oe.join(" "));return}const Ve={};if(v&&(Ve.superuser={username:u.superuser.username.trim(),email:u.superuser.email.trim(),password:u.superuser.password}),L){const te=u.server.name.trim(),ge=u.server.url.trim();(y||!H&&te||!G&&ge)&&(Ve.server={name:te,url:ge})}if(W){const te=u.endpoint.name.trim(),ge=u.endpoint.externalId.trim(),_e=u.endpoint.serverId?Number(u.endpoint.serverId):void 0;(E||!X&&te||!ie&&ge||_e)&&(Ve.endpoint={name:te||null,externalId:ge||null,serverId:_e})}const me=u.apiKey.trim();(U||me)&&(Ve.apiKey={value:me});try{b(!0);const te=await fetch("/api/setup/complete",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(Ve)});if(!te.ok)switch((await te.json().catch(()=>({}))).error){case"SERVER_DETAILS_REQUIRED":throw new Error("Bitte gib eine gültige Server-URL an.");case"ENDPOINT_DETAILS_REQUIRED":throw new Error("Bitte gib eine gültige Endpoint-ID an.");case"API_KEY_REQUIRED":throw new Error("Bitte gib einen gültigen API-Key an.");case"USERNAME_REQUIRED":throw new Error("Benutzername wird benötigt.");case"EMAIL_INVALID":throw new Error("Bitte gib eine gültige E-Mail-Adresse an.");case"PASSWORD_TOO_SHORT":throw new Error("Passwort muss mindestens 8 Zeichen enthalten.");case"INVALID_PASSWORD":throw new Error("Das Passwort ist ungültig.");case"API_KEY_ENCRYPT_FAILED":throw new Error("API-Key konnte nicht verschlüsselt werden. Bitte erneut versuchen.");case"SUPERUSER_EXISTS":throw new Error("Der Superuser wurde bereits angelegt.");default:throw new Error("Setup konnte nicht abgeschlossen werden. Bitte erneut versuchen.")}const ge=await te.json().catch(()=>({}));r(ge.status),C(!0),setTimeout(()=>{e("/auth/sign-in",{replace:!0})},1500)}catch(te){console.error("⚠️ [Setup] Abschluss fehlgeschlagen:",te),O(te.message||"Setup fehlgeschlagen.")}finally{b(!1)}},[u,e,v,y,E,L,W,U,t,g,oe,H,G,X,ie]);if(n)return T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:T.jsx("span",{className:"text-blue-gray-500",children:"Lade Setup-Status ..."})});if(a)return T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:T.jsx(Q.Alert,{color:"red",className:"w-full max-w-lg border border-red-200 bg-red-50 text-red-700",children:a})});if(!t)return T.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:T.jsx("span",{className:"text-blue-gray-500",children:"Keine Setup-Informationen verfügbar."})});const ee=v?T.jsxs(T.Fragment,{children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"font-semibold",children:"Superuser"}),T.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[T.jsx(Q.Input,{label:"Benutzername",required:!0,value:u.superuser.username,onChange:pe("superuser","username",{locked:Y}),disabled:g,readOnly:Y}),T.jsx(Q.Input,{label:"E-Mail-Adresse",required:!0,type:"email",value:u.superuser.email,onChange:pe("superuser","email",{locked:$}),disabled:g,readOnly:$}),T.jsx(Q.Input,{label:"Passwort",required:!0,type:"password",value:u.superuser.password,onChange:pe("superuser","password",{locked:z}),disabled:g,readOnly:z})]})]}):T.jsx(Q.Alert,{color:"green",className:"border border-green-200 bg-green-50 text-green-700",children:"Superuser ist bereits vorhanden."}),ae=L?T.jsxs(T.Fragment,{children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mt-6 font-semibold",children:"Server"}),T.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[T.jsx(Q.Input,{label:"Server-Name",value:u.server.name,onChange:pe("server","name",{locked:H}),readOnly:H,disabled:g}),T.jsx(Q.Input,{label:"Server-URL",required:y,value:u.server.url,onChange:pe("server","url",{locked:G}),readOnly:G,disabled:g})]})]}):null,ue=W?T.jsxs(T.Fragment,{children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mt-6 font-semibold",children:"Endpoint"}),T.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[T.jsx(Q.Input,{label:"Endpoint-Name",value:u.endpoint.name,onChange:pe("endpoint","name",{locked:X}),readOnly:X,disabled:g}),T.jsx(Q.Input,{label:"Endpoint-ID",required:E,value:u.endpoint.externalId,onChange:pe("endpoint","externalId",{locked:ie}),readOnly:ie,disabled:g})]})]}):null,de=U?T.jsxs(T.Fragment,{children:[T.jsx(Q.Typography,{variant:"h6",color:"blue-gray",className:"mt-6 font-semibold",children:"API-Key"}),T.jsx("div",{className:"grid grid-cols-1 gap-4",children:T.jsx(Q.Input,{label:"API-Key",required:P,type:"password",value:u.apiKey,onChange:Je=>{fe||f(Ve=>({...Ve,apiKey:Je.target.value}))},readOnly:fe,disabled:g})})]}):null,Te=!!((rt=t==null?void 0:t.superuser)!=null&&rt.envProvided||R||M||D);return T.jsx("div",{className:"flex min-h-screen w-full items-center justify-center py-10",children:T.jsxs(Q.Card,{className:"w-full max-w-lg border border-blue-gray-100 shadow-sm",children:[T.jsxs(Q.CardHeader,{floated:!1,shadow:!1,className:"mb-0 grid place-items-start gap-2 rounded-none bg-transparent p-6",children:[T.jsx(Q.Typography,{variant:"h4",color:"blue-gray",children:"System Setup"}),T.jsx(Q.Typography,{color:"gray",className:"font-normal",children:"Lege einen Superuser sowie mindestens einen Server mit Endpoint und API-Key fest, um StackPulse zu starten."})]}),T.jsx(Q.CardBody,{className:"pt-0",children:T.jsxs("form",{className:"mt-4 flex flex-col gap-6",onSubmit:se,children:[Te&&T.jsx(Q.Alert,{color:"blue",className:"border border-blue-200 bg-blue-50 text-blue-700",children:"Teile der Konfiguration stammen bereits aus den Umgebungsvariablen."}),ee,ae,ue,de,_&&T.jsx(Q.Alert,{color:"red",className:"border border-red-200 bg-red-50 text-red-700",children:_}),S&&T.jsx(Q.Alert,{color:"green",className:"border border-green-200 bg-green-50 text-green-700",children:"Setup abgeschlossen. Du wirst zum Login weitergeleitet ..."}),T.jsx(Q.Button,{type:"submit",color:"blue",disabled:g||S,children:g?"Setup läuft ...":"Setup abschließen"})]})})]})})}function rV(){return T.jsxs(Qg,{children:[T.jsx(_o,{path:"/dashboard/*",element:T.jsx(zk,{})}),T.jsx(_o,{path:"/auth/*",element:T.jsx(Bk,{})}),T.jsx(_o,{path:"/setup",element:T.jsx(tV,{})}),T.jsx(_o,{path:"*",element:T.jsx(yI,{to:"/dashboard/stacks",replace:!0})})]})}at.defaults.withCredentials=!0;y0.createRoot(document.getElementById("root")).render(T.jsx(lo.StrictMode,{children:T.jsx(PI,{children:T.jsx(wB,{children:T.jsx(vB,{children:T.jsx(CB,{children:T.jsx(Q.ThemeProvider,{children:T.jsx(eb,{children:T.jsx(rV,{})})})})})})})}));