function $j(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 t_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lu(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 r_={exports:{}},tf={},n_={exports:{}},xt={};/** * @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 uu=Symbol.for("react.element"),Hj=Symbol.for("react.portal"),qj=Symbol.for("react.fragment"),Gj=Symbol.for("react.strict_mode"),Kj=Symbol.for("react.profiler"),Yj=Symbol.for("react.provider"),Qj=Symbol.for("react.context"),Xj=Symbol.for("react.forward_ref"),Zj=Symbol.for("react.suspense"),Jj=Symbol.for("react.memo"),e2=Symbol.for("react.lazy"),uy=Symbol.iterator;function t2(e){return e===null||typeof e!="object"?null:(e=uy&&e[uy]||e["@@iterator"],typeof e=="function"?e:null)}var o_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},a_=Object.assign,i_={};function _s(e,t,r){this.props=e,this.context=t,this.refs=i_,this.updater=r||o_}_s.prototype.isReactComponent={};_s.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")};_s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function s_(){}s_.prototype=_s.prototype;function bg(e,t,r){this.props=e,this.context=t,this.refs=i_,this.updater=r||o_}var vg=bg.prototype=new s_;vg.constructor=bg;a_(vg,_s.prototype);vg.isPureReactComponent=!0;var cy=Array.isArray,l_=Object.prototype.hasOwnProperty,yg={current:null},u_={key:!0,ref:!0,__self:!0,__source:!0};function c_(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)l_.call(t,n)&&!u_.hasOwnProperty(n)&&(o[n]=t[n]);var c=arguments.length-2;if(c===1)o.children=r;else if(1t=>{const r=f2.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ro=e=>(e=e.toLowerCase(),t=>rf(t)===e),nf=e=>t=>typeof t===e,{isArray:Ss}=Array,Ml=nf("undefined");function p2(e){return e!==null&&!Ml(e)&&e.constructor!==null&&!Ml(e.constructor)&&ln(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const p_=ro("ArrayBuffer");function h2(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&p_(e.buffer),t}const g2=nf("string"),ln=nf("function"),h_=nf("number"),of=e=>e!==null&&typeof e=="object",m2=e=>e===!0||e===!1,Ec=e=>{if(rf(e)!=="object")return!1;const t=_g(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},b2=ro("Date"),v2=ro("File"),y2=ro("Blob"),x2=ro("FileList"),w2=e=>of(e)&&ln(e.pipe),_2=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ln(e.append)&&((t=rf(e))==="formdata"||t==="object"&&ln(e.toString)&&e.toString()==="[object FormData]"))},S2=ro("URLSearchParams"),[C2,T2,O2,P2]=["ReadableStream","Request","Response","Headers"].map(ro),k2=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cu(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ss(e))for(n=0,o=e.length;n0;)if(o=r[n],t===o.toLowerCase())return o;return null}const qa=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),m_=e=>!Ml(e)&&e!==qa;function Lh(){const{caseless:e}=m_(this)&&this||{},t={},r=(n,o)=>{const a=e&&g_(t,o)||o;Ec(t[a])&&Ec(n)?t[a]=Lh(t[a],n):Ec(n)?t[a]=Lh({},n):Ss(n)?t[a]=n.slice():t[a]=n};for(let n=0,o=arguments.length;n(cu(t,(o,a)=>{r&&ln(o)?e[a]=f_(o,r):e[a]=o},{allOwnKeys:n}),e),E2=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),j2=(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)},A2=(e,t,r,n)=>{let o,a,i;const c={};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))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&_g(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},R2=(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},M2=e=>{if(!e)return null;if(Ss(e))return e;let t=e.length;if(!h_(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},I2=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_g(Uint8Array)),D2=(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])}},L2=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},F2=ro("HTMLFormElement"),z2=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),fy=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),B2=ro("RegExp"),b_=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};cu(r,(o,a)=>{let i;(i=t(o,a,e))!==!1&&(n[a]=i||o)}),Object.defineProperties(e,n)},V2=e=>{b_(e,(t,r)=>{if(ln(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ln(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+"'")})}})},U2=(e,t)=>{const r={},n=o=>{o.forEach(a=>{r[a]=!0})};return Ss(e)?n(e):n(String(e).split(t)),r},W2=()=>{},$2=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Lp="abcdefghijklmnopqrstuvwxyz",py="0123456789",v_={DIGIT:py,ALPHA:Lp,ALPHA_DIGIT:Lp+Lp.toUpperCase()+py},H2=(e=16,t=v_.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function q2(e){return!!(e&&ln(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const G2=e=>{const t=new Array(10),r=(n,o)=>{if(of(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[o]=n;const a=Ss(n)?[]:{};return cu(n,(i,c)=>{const f=r(i,o+1);!Ml(f)&&(a[c]=f)}),t[o]=void 0,a}}return n};return r(e,0)},K2=ro("AsyncFunction"),Y2=e=>e&&(of(e)||ln(e))&&ln(e.then)&&ln(e.catch),y_=((e,t)=>e?setImmediate:t?((r,n)=>(qa.addEventListener("message",({source:o,data:a})=>{o===qa&&a===r&&n.length&&n.shift()()},!1),o=>{n.push(o),qa.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ln(qa.postMessage)),Q2=typeof queueMicrotask<"u"?queueMicrotask.bind(qa):typeof process<"u"&&process.nextTick||y_,_e={isArray:Ss,isArrayBuffer:p_,isBuffer:p2,isFormData:_2,isArrayBufferView:h2,isString:g2,isNumber:h_,isBoolean:m2,isObject:of,isPlainObject:Ec,isReadableStream:C2,isRequest:T2,isResponse:O2,isHeaders:P2,isUndefined:Ml,isDate:b2,isFile:v2,isBlob:y2,isRegExp:B2,isFunction:ln,isStream:w2,isURLSearchParams:S2,isTypedArray:I2,isFileList:x2,forEach:cu,merge:Lh,extend:N2,trim:k2,stripBOM:E2,inherits:j2,toFlatObject:A2,kindOf:rf,kindOfTest:ro,endsWith:R2,toArray:M2,forEachEntry:D2,matchAll:L2,isHTMLForm:F2,hasOwnProperty:fy,hasOwnProp:fy,reduceDescriptors:b_,freezeMethods:V2,toObjectSet:U2,toCamelCase:z2,noop:W2,toFiniteNumber:$2,findKey:g_,global:qa,isContextDefined:m_,ALPHABET:v_,generateString:H2,isSpecCompliantForm:q2,toJSONObject:G2,isAsyncFn:K2,isThenable:Y2,setImmediate:y_,asap:Q2};function mt(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)}_e.inherits(mt,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:_e.toJSONObject(this.config),code:this.code,status:this.status}}});const x_=mt.prototype,w_={};["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=>{w_[e]={value:e}});Object.defineProperties(mt,w_);Object.defineProperty(x_,"isAxiosError",{value:!0});mt.from=(e,t,r,n,o,a)=>{const i=Object.create(x_);return _e.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),mt.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};const X2=null;function Fh(e){return _e.isPlainObject(e)||_e.isArray(e)}function __(e){return _e.endsWith(e,"[]")?e.slice(0,-2):e}function hy(e,t,r){return e?e.concat(t).map(function(o,a){return o=__(o),!r&&a?"["+o+"]":o}).join(r?".":""):t}function Z2(e){return _e.isArray(e)&&!e.some(Fh)}const J2=_e.toFlatObject(_e,{},null,function(t){return/^is[A-Z]/.test(t)});function af(e,t,r){if(!_e.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=_e.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,m){return!_e.isUndefined(m[x])});const n=r.metaTokens,o=r.visitor||b,a=r.dots,i=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&_e.isSpecCompliantForm(t);if(!_e.isFunction(o))throw new TypeError("visitor must be a function");function g(C){if(C===null)return"";if(_e.isDate(C))return C.toISOString();if(!f&&_e.isBlob(C))throw new mt("Blob is not supported. Use a Buffer instead.");return _e.isArrayBuffer(C)||_e.isTypedArray(C)?f&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function b(C,x,m){let d=C;if(C&&!m&&typeof C=="object"){if(_e.endsWith(x,"{}"))x=n?x:x.slice(0,-2),C=JSON.stringify(C);else if(_e.isArray(C)&&Z2(C)||(_e.isFileList(C)||_e.endsWith(x,"[]"))&&(d=_e.toArray(C)))return x=__(x),d.forEach(function(u,l){!(_e.isUndefined(u)||u===null)&&t.append(i===!0?hy([x],l,a):i===null?x:x+"[]",g(u))}),!1}return Fh(C)?!0:(t.append(hy(m,x,a),g(C)),!1)}const S=[],O=Object.assign(J2,{defaultVisitor:b,convertValue:g,isVisitable:Fh});function T(C,x){if(!_e.isUndefined(C)){if(S.indexOf(C)!==-1)throw Error("Circular reference detected in "+x.join("."));S.push(C),_e.forEach(C,function(d,s){(!(_e.isUndefined(d)||d===null)&&o.call(t,d,_e.isString(s)?s.trim():s,x,O))===!0&&T(d,x?x.concat(s):[s])}),S.pop()}}if(!_e.isObject(e))throw new TypeError("data must be an object");return T(e),t}function gy(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Sg(e,t){this._pairs=[],e&&af(e,this,t)}const S_=Sg.prototype;S_.append=function(t,r){this._pairs.push([t,r])};S_.toString=function(t){const r=t?function(n){return t.call(this,n,gy)}:gy;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function eA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function C_(e,t,r){if(!t)return e;const n=r&&r.encode||eA,o=r&&r.serialize;let a;if(o?a=o(t,r):a=_e.isURLSearchParams(t)?t.toString():new Sg(t,r).toString(n),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class tA{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){_e.forEach(this.handlers,function(n){n!==null&&t(n)})}}const my=tA,T_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rA=typeof URLSearchParams<"u"?URLSearchParams:Sg,nA=typeof FormData<"u"?FormData:null,oA=typeof Blob<"u"?Blob:null,aA={isBrowser:!0,classes:{URLSearchParams:rA,FormData:nA,Blob:oA},protocols:["http","https","file","blob","url","data"]},Cg=typeof window<"u"&&typeof document<"u",zh=typeof navigator=="object"&&navigator||void 0,iA=Cg&&(!zh||["ReactNative","NativeScript","NS"].indexOf(zh.product)<0),sA=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),lA=Cg&&window.location.href||"http://localhost",uA=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Cg,hasStandardBrowserEnv:iA,hasStandardBrowserWebWorkerEnv:sA,navigator:zh,origin:lA},Symbol.toStringTag,{value:"Module"})),un={...uA,...aA};function cA(e,t){return af(e,new un.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,a){return un.isNode&&_e.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function dA(e){return _e.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fA(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n=r.length;return i=!i&&_e.isArray(o)?o.length:i,f?(_e.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!c):((!o[i]||!_e.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],a)&&_e.isArray(o[i])&&(o[i]=fA(o[i])),!c)}if(_e.isFormData(e)&&_e.isFunction(e.entries)){const r={};return _e.forEachEntry(e,(n,o)=>{t(dA(n),o,r,0)}),r}return null}function pA(e,t,r){if(_e.isString(e))try{return(t||JSON.parse)(e),_e.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Tg={transitional:T_,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,a=_e.isObject(t);if(a&&_e.isHTMLForm(t)&&(t=new FormData(t)),_e.isFormData(t))return o?JSON.stringify(O_(t)):t;if(_e.isArrayBuffer(t)||_e.isBuffer(t)||_e.isStream(t)||_e.isFile(t)||_e.isBlob(t)||_e.isReadableStream(t))return t;if(_e.isArrayBufferView(t))return t.buffer;if(_e.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return cA(t,this.formSerializer).toString();if((c=_e.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return af(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return a||o?(r.setContentType("application/json",!1),pA(t)):t}],transformResponse:[function(t){const r=this.transitional||Tg.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(_e.isResponse(t)||_e.isReadableStream(t))return t;if(t&&_e.isString(t)&&(n&&!this.responseType||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?mt.from(c,mt.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:un.classes.FormData,Blob:un.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_e.forEach(["delete","get","head","post","put","patch"],e=>{Tg.headers[e]={}});const Og=Tg,hA=_e.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"]),gA=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]&&hA[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},by=Symbol("internals");function Js(e){return e&&String(e).trim().toLowerCase()}function jc(e){return e===!1||e==null?e:_e.isArray(e)?e.map(jc):String(e)}function mA(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 bA=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Fp(e,t,r,n,o){if(_e.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!_e.isString(t)){if(_e.isString(n))return t.indexOf(n)!==-1;if(_e.isRegExp(n))return n.test(t)}}function vA(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function yA(e,t){const r=_e.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 sf{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function a(c,f,g){const b=Js(f);if(!b)throw new Error("header name must be a non-empty string");const S=_e.findKey(o,b);(!S||o[S]===void 0||g===!0||g===void 0&&o[S]!==!1)&&(o[S||f]=jc(c))}const i=(c,f)=>_e.forEach(c,(g,b)=>a(g,b,f));if(_e.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(_e.isString(t)&&(t=t.trim())&&!bA(t))i(gA(t),r);else if(_e.isHeaders(t))for(const[c,f]of t.entries())a(f,c,n);else t!=null&&a(r,t,n);return this}get(t,r){if(t=Js(t),t){const n=_e.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return mA(o);if(_e.isFunction(r))return r.call(this,o,n);if(_e.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Js(t),t){const n=_e.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Fp(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function a(i){if(i=Js(i),i){const c=_e.findKey(n,i);c&&(!r||Fp(n,n[c],c,r))&&(delete n[c],o=!0)}}return _e.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||Fp(this,this[a],a,t,!0))&&(delete this[a],o=!0)}return o}normalize(t){const r=this,n={};return _e.forEach(this,(o,a)=>{const i=_e.findKey(n,a);if(i){r[i]=jc(o),delete r[a];return}const c=t?vA(a):String(a).trim();c!==a&&delete r[a],r[c]=jc(o),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return _e.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&_e.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[by]=this[by]={accessors:{}}).accessors,o=this.prototype;function a(i){const c=Js(i);n[c]||(yA(o,i),n[c]=!0)}return _e.isArray(t)?t.forEach(a):a(t),this}}sf.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_e.reduceDescriptors(sf.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});_e.freezeMethods(sf);const Gn=sf;function zp(e,t){const r=this||Og,n=t||r,o=Gn.from(n.headers);let a=n.data;return _e.forEach(e,function(c){a=c.call(r,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function P_(e){return!!(e&&e.__CANCEL__)}function Cs(e,t,r){mt.call(this,e??"canceled",mt.ERR_CANCELED,t,r),this.name="CanceledError"}_e.inherits(Cs,mt,{__CANCEL__:!0});function k_(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new mt("Request failed with status code "+r.status,[mt.ERR_BAD_REQUEST,mt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function xA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function wA(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 S=a,O=0;for(;S!==o;)O+=r[S++],S=S%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(),S=b-r;S>=n?i(g,b):(o=g,a||(a=setTimeout(()=>{a=null,i(o)},n-S)))},()=>o&&i(o)]}const ad=(e,t,r=3)=>{let n=0;const o=wA(50,250);return _A(a=>{const i=a.loaded,c=a.lengthComputable?a.total:void 0,f=i-n,g=o(f),b=i<=c;n=i;const S={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:g||void 0,estimated:g&&c&&b?(c-i)/g:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(S)},r)},vy=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},yy=e=>(...t)=>_e.asap(()=>e(...t)),SA=un.hasStandardBrowserEnv?function(){const t=un.navigator&&/(msie|trident)/i.test(un.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 c=_e.isString(i)?o(i):i;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}(),CA=un.hasStandardBrowserEnv?{write(e,t,r,n,o,a){const i=[e+"="+encodeURIComponent(t)];_e.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),_e.isString(n)&&i.push("path="+n),_e.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 TA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function OA(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function N_(e,t){return e&&!TA(t)?OA(e,t):t}const xy=e=>e instanceof Gn?{...e}:e;function ti(e,t){t=t||{};const r={};function n(g,b,S){return _e.isPlainObject(g)&&_e.isPlainObject(b)?_e.merge.call({caseless:S},g,b):_e.isPlainObject(b)?_e.merge({},b):_e.isArray(b)?b.slice():b}function o(g,b,S){if(_e.isUndefined(b)){if(!_e.isUndefined(g))return n(void 0,g,S)}else return n(g,b,S)}function a(g,b){if(!_e.isUndefined(b))return n(void 0,b)}function i(g,b){if(_e.isUndefined(b)){if(!_e.isUndefined(g))return n(void 0,g)}else return n(void 0,b)}function c(g,b,S){if(S in t)return n(g,b);if(S 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:c,headers:(g,b)=>o(xy(g),xy(b),!0)};return _e.forEach(Object.keys(Object.assign({},e,t)),function(b){const S=f[b]||o,O=S(e[b],t[b],b);_e.isUndefined(O)&&S!==c||(r[b]=O)}),r}const E_=e=>{const t=ti({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:c}=t;t.headers=i=Gn.from(i),t.url=C_(N_(t.baseURL,t.url),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(_e.isFormData(r)){if(un.hasStandardBrowserEnv||un.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[g,...b]=f?f.split(";").map(S=>S.trim()).filter(Boolean):[];i.setContentType([g||"multipart/form-data",...b].join("; "))}}if(un.hasStandardBrowserEnv&&(n&&_e.isFunction(n)&&(n=n(t)),n||n!==!1&&SA(t.url))){const g=o&&a&&CA.read(a);g&&i.set(o,g)}return t},PA=typeof XMLHttpRequest<"u",kA=PA&&function(e){return new Promise(function(r,n){const o=E_(e);let a=o.data;const i=Gn.from(o.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:g}=o,b,S,O,T,C;function x(){T&&T(),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 u=Gn.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),h={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:u,config:e,request:m};k_(function(w){r(w),x()},function(w){n(w),x()},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 mt("Request aborted",mt.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new mt("Network Error",mt.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let l=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const h=o.transitional||T_;o.timeoutErrorMessage&&(l=o.timeoutErrorMessage),n(new mt(l,h.clarifyTimeoutError?mt.ETIMEDOUT:mt.ECONNABORTED,e,m)),m=null},a===void 0&&i.setContentType(null),"setRequestHeader"in m&&_e.forEach(i.toJSON(),function(l,h){m.setRequestHeader(h,l)}),_e.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),c&&c!=="json"&&(m.responseType=o.responseType),g&&([O,C]=ad(g,!0),m.addEventListener("progress",O)),f&&m.upload&&([S,T]=ad(f),m.upload.addEventListener("progress",S),m.upload.addEventListener("loadend",T)),(o.cancelToken||o.signal)&&(b=u=>{m&&(n(!u||u.type?new Cs(null,e,m):u),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(b),o.signal&&(o.signal.aborted?b():o.signal.addEventListener("abort",b)));const s=xA(o.url);if(s&&un.protocols.indexOf(s)===-1){n(new mt("Unsupported protocol "+s+":",mt.ERR_BAD_REQUEST,e));return}m.send(a||null)})},NA=(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 mt?g:new Cs(g instanceof Error?g.message:g))}};let a=t&&setTimeout(()=>{o(new mt(`timeout ${t} of ms exceeded`,mt.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:c}=r;return c.unsubscribe=i,[c,()=>{a&&clearTimeout(a),a=null}]},EA=NA,jA=function*(e,t){let r=e.byteLength;if(!t||r{const a=AA(e,t,o);let i=0,c,f=g=>{c||(c=!0,n&&n(g))};return new ReadableStream({async pull(g){try{const{done:b,value:S}=await a.next();if(b){f(),g.close();return}let O=S.byteLength;if(r){let T=i+=O;r(T)}g.enqueue(new Uint8Array(S))}catch(b){throw f(b),b}},cancel(g){return f(g),a.return()}},{highWaterMark:2})},lf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",j_=lf&&typeof ReadableStream=="function",Bh=lf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),A_=(e,...t)=>{try{return!!e(...t)}catch{return!1}},RA=j_&&A_(()=>{let e=!1;const t=new Request(un.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),_y=64*1024,Vh=j_&&A_(()=>_e.isReadableStream(new Response("").body)),id={stream:Vh&&(e=>e.body)};lf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!id[t]&&(id[t]=_e.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new mt(`Response type '${t}' is not supported`,mt.ERR_NOT_SUPPORT,n)})})})(new Response);const MA=async e=>{if(e==null)return 0;if(_e.isBlob(e))return e.size;if(_e.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(_e.isArrayBufferView(e)||_e.isArrayBuffer(e))return e.byteLength;if(_e.isURLSearchParams(e)&&(e=e+""),_e.isString(e))return(await Bh(e)).byteLength},IA=async(e,t)=>{const r=_e.toFiniteNumber(e.getContentLength());return r??MA(t)},DA=lf&&(async e=>{let{url:t,method:r,data:n,signal:o,cancelToken:a,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:g,headers:b,withCredentials:S="same-origin",fetchOptions:O}=E_(e);g=g?(g+"").toLowerCase():"text";let[T,C]=o||a||i?EA([o,a],i):[],x,m;const d=()=>{!x&&setTimeout(()=>{T&&T.unsubscribe()}),x=!0};let s;try{if(f&&RA&&r!=="get"&&r!=="head"&&(s=await IA(b,n))!==0){let w=new Request(t,{method:"POST",body:n,duplex:"half"}),j;if(_e.isFormData(n)&&(j=w.headers.get("content-type"))&&b.setContentType(j),w.body){const[N,k]=vy(s,ad(yy(f)));n=wy(w.body,_y,N,k,Bh)}}_e.isString(S)||(S=S?"include":"omit");const u="credentials"in Request.prototype;m=new Request(t,{...O,signal:T,method:r.toUpperCase(),headers:b.normalize().toJSON(),body:n,duplex:"half",credentials:u?S:void 0});let l=await fetch(m);const h=Vh&&(g==="stream"||g==="response");if(Vh&&(c||h)){const w={};["status","statusText","headers"].forEach(A=>{w[A]=l[A]});const j=_e.toFiniteNumber(l.headers.get("content-length")),[N,k]=c&&vy(j,ad(yy(c),!0))||[];l=new Response(wy(l.body,_y,N,()=>{k&&k(),h&&d()},Bh),w)}g=g||"text";let v=await id[_e.findKey(id,g)||"text"](l,e);return!h&&d(),C&&C(),await new Promise((w,j)=>{k_(w,j,{data:v,headers:Gn.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:m})})}catch(u){throw d(),u&&u.name==="TypeError"&&/fetch/i.test(u.message)?Object.assign(new mt("Network Error",mt.ERR_NETWORK,e,m),{cause:u.cause||u}):mt.from(u,u&&u.code,e,m)}}),Uh={http:X2,xhr:kA,fetch:DA};_e.forEach(Uh,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Sy=e=>`- ${e}`,LA=e=>_e.isFunction(e)||e===null||e===!1,R_={getAdapter:e=>{e=_e.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let a=0;a`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?a.length>1?`since : `+a.map(Sy).join(` `):" "+Sy(a[0]):"as no adapter specified";throw new mt("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n},adapters:Uh};function Bp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Cs(null,e)}function Cy(e){return Bp(e),e.headers=Gn.from(e.headers),e.data=zp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),R_.getAdapter(e.adapter||Og.adapter)(e).then(function(n){return Bp(e),n.data=zp.call(e,e.transformResponse,n),n.headers=Gn.from(n.headers),n},function(n){return P_(n)||(Bp(e),n&&n.response&&(n.response.data=zp.call(e,e.transformResponse,n.response),n.response.headers=Gn.from(n.response.headers))),Promise.reject(n)})}const M_="1.7.5",Pg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pg[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ty={};Pg.transitional=function(t,r,n){function o(a,i){return"[Axios v"+M_+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,c)=>{if(t===!1)throw new mt(o(i," has been removed"+(r?" in "+r:"")),mt.ERR_DEPRECATED);return r&&!Ty[i]&&(Ty[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,i,c):!0}};function FA(e,t,r){if(typeof e!="object")throw new mt("options must be an object",mt.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 c=e[a],f=c===void 0||i(c,a,e);if(f!==!0)throw new mt("option "+a+" must be "+f,mt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new mt("Unknown option "+a,mt.ERR_BAD_OPTION)}}const Wh={assertOptions:FA,validators:Pg},Jo=Wh.validators;class sd{constructor(t){this.defaults=t,this.interceptors={request:new my,response:new my}}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=ti(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:a}=r;n!==void 0&&Wh.assertOptions(n,{silentJSONParsing:Jo.transitional(Jo.boolean),forcedJSONParsing:Jo.transitional(Jo.boolean),clarifyTimeoutError:Jo.transitional(Jo.boolean)},!1),o!=null&&(_e.isFunction(o)?r.paramsSerializer={serialize:o}:Wh.assertOptions(o,{encode:Jo.function,serialize:Jo.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&_e.merge(a.common,a[r.method]);a&&_e.forEach(["delete","get","head","post","put","patch","common"],C=>{delete a[C]}),r.headers=Gn.concat(i,a);const c=[];let f=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(f=f&&x.synchronous,c.unshift(x.fulfilled,x.rejected))});const g=[];this.interceptors.response.forEach(function(x){g.push(x.fulfilled,x.rejected)});let b,S=0,O;if(!f){const C=[Cy.bind(this),void 0];for(C.unshift.apply(C,c),C.push.apply(C,g),O=C.length,b=Promise.resolve(r);S{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(c=>{n.subscribe(c),a=c}).then(o);return i.cancel=function(){n.unsubscribe(a)},i},t(function(a,i,c){n.reason||(n.reason=new Cs(a,i,c),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 kg(function(o){t=o}),cancel:t}}}const zA=kg;function BA(e){return function(r){return e.apply(null,r)}}function VA(e){return _e.isObject(e)&&e.isAxiosError===!0}const $h={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($h).forEach(([e,t])=>{$h[t]=e});const UA=$h;function I_(e){const t=new Ac(e),r=f_(Ac.prototype.request,t);return _e.extend(r,Ac.prototype,t,{allOwnKeys:!0}),_e.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return I_(ti(e,o))},r}const ur=I_(Og);ur.Axios=Ac;ur.CanceledError=Cs;ur.CancelToken=zA;ur.isCancel=P_;ur.VERSION=M_;ur.toFormData=af;ur.AxiosError=mt;ur.Cancel=ur.CanceledError;ur.all=function(t){return Promise.all(t)};ur.spread=BA;ur.isAxiosError=VA;ur.mergeConfig=ti;ur.AxiosHeaders=Gn;ur.formToJSON=e=>O_(_e.isHTMLForm(e)?new FormData(e):e);ur.getAdapter=R_.getAdapter;ur.HttpStatusCode=UA;ur.default=ur;const lt=ur;var Hh={},D_={exports:{}},hn={},L_={exports:{}},F_={};/** * @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(q,z){var $=q.length;q.push(z);e:for(;0<$;){var K=$-1>>>1,X=q[K];if(0>>1;Ko(de,$))eeo(Se,de)?(q[K]=Se,q[ee]=$,K=ee):(q[K]=de,q[me]=$,K=me);else if(eeo(Se,$))q[K]=Se,q[ee]=$,K=ee;else break e}}return z}function o(q,z){var $=q.sortIndex-z.sortIndex;return $!==0?$:q.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,c=i.now();e.unstable_now=function(){return i.now()-c}}var f=[],g=[],b=1,S=null,O=3,T=!1,C=!1,x=!1,m=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function u(q){for(var z=r(g);z!==null;){if(z.callback===null)n(g);else if(z.startTime<=q)n(g),z.sortIndex=z.expirationTime,t(f,z);else break;z=r(g)}}function l(q){if(x=!1,u(q),!C)if(r(f)!==null)C=!0,U(h);else{var z=r(g);z!==null&&Y(l,z.startTime-q)}}function h(q,z){C=!1,x&&(x=!1,d(j),j=-1),T=!0;var $=O;try{for(u(z),S=r(f);S!==null&&(!(S.expirationTime>z)||q&&!A());){var K=S.callback;if(typeof K=="function"){S.callback=null,O=S.priorityLevel;var X=K(S.expirationTime<=z);z=e.unstable_now(),typeof X=="function"?S.callback=X:S===r(f)&&n(f),u(z)}else n(f);S=r(f)}if(S!==null)var te=!0;else{var me=r(g);me!==null&&Y(l,me.startTime-z),te=!1}return te}finally{S=null,O=$,T=!1}}var v=!1,w=null,j=-1,N=5,k=-1;function A(){return!(e.unstable_now()-kq||125K?(q.sortIndex=$,t(g,q),r(f)===null&&q===r(g)&&(x?(d(j),j=-1):x=!0,Y(l,$-K))):(q.sortIndex=X,t(f,q),C||T||(C=!0,U(h))),q},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(q){var z=O;return function(){var $=O;O=z;try{return q.apply(this,arguments)}finally{O=$}}}})(F_);L_.exports=F_;var WA=L_.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 z_=P,fn=WA;function Re(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"),qh=Object.prototype.hasOwnProperty,$A=/^[: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]*$/,Oy={},Py={};function HA(e){return qh.call(Py,e)?!0:qh.call(Oy,e)?!1:$A.test(e)?Py[e]=!0:(Oy[e]=!0,!1)}function qA(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 GA(e,t,r,n){if(t===null||typeof t>"u"||qA(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 Vr(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 Cr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Cr[e]=new Vr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Cr[t]=new Vr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Cr[e]=new Vr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Cr[e]=new Vr(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){Cr[e]=new Vr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Cr[e]=new Vr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Cr[e]=new Vr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Cr[e]=new Vr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Cr[e]=new Vr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ng=/[\-:]([a-z])/g;function Eg(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,Eg);Cr[t]=new Vr(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,Eg);Cr[t]=new Vr(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,Eg);Cr[t]=new Vr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Cr[e]=new Vr(e,1,!1,e.toLowerCase(),null,!1,!1)});Cr.xlinkHref=new Vr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Cr[e]=new Vr(e,1,!1,e.toLowerCase(),null,!0,!0)});function jg(e,t,r,n){var o=Cr.hasOwnProperty(t)?Cr[t]:null;(o!==null?o.type!==0:n||!(2c||o[i]!==a[c]){var f=` `+o[i].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=i&&0<=c);break}}}finally{Up=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?pl(e):""}function KA(e){switch(e.tag){case 5:return pl(e.type);case 16:return pl("Lazy");case 13:return pl("Suspense");case 19:return pl("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 Qh(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 Di:return"Fragment";case Ii:return"Portal";case Gh:return"Profiler";case Ag:return"StrictMode";case Kh:return"Suspense";case Yh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U_:return(e.displayName||"Context")+".Consumer";case V_:return(e._context.displayName||"Context")+".Provider";case Rg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Mg:return t=e.displayName||null,t!==null?t:Qh(e.type)||"Memo";case aa:t=e._payload,e=e._init;try{return Qh(e(t))}catch{}}return null}function YA(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 Qh(t);case 8:return t===Ag?"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 Ca(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 QA(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 tc(e){e._valueTracker||(e._valueTracker=QA(e))}function H_(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 ld(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 Xh(e,t){var r=t.checked;return rr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ny(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ca(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 q_(e,t){t=t.checked,t!=null&&jg(e,"checked",t,!1)}function Zh(e,t){q_(e,t);var r=Ca(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")?Jh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Jh(e,t.type,Ca(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ey(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 Jh(e,t,r){(t!=="number"||ld(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var hl=Array.isArray;function Yi(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=rc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xl={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},XA=["Webkit","ms","Moz","O"];Object.keys(xl).forEach(function(e){XA.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xl[t]=xl[e]})});function Q_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xl.hasOwnProperty(e)&&xl[e]?(""+t).trim():t+"px"}function X_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=Q_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var ZA=rr({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 r0(e,t){if(t){if(ZA[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Re(62))}}function n0(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 o0=null;function Ig(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var a0=null,Qi=null,Xi=null;function Ry(e){if(e=pu(e)){if(typeof a0!="function")throw Error(Re(280));var t=e.stateNode;t&&(t=pf(t),a0(e.stateNode,e.type,t))}}function Z_(e){Qi?Xi?Xi.push(e):Xi=[e]:Qi=e}function J_(){if(Qi){var e=Qi,t=Xi;if(Xi=Qi=null,Ry(e),t)for(e=0;e>>=0,e===0?32:31-(uR(e)/cR|0)|0}var nc=64,oc=4194304;function gl(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 fd(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 c=i&~o;c!==0?n=gl(c):(a&=i,a!==0&&(n=gl(a)))}else i=r&~o,i!==0?n=gl(i):a!==0&&(n=gl(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 du(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kn(t),e[t]=r}function hR(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=_l),Uy=String.fromCharCode(32),Wy=!1;function yS(e,t){switch(e){case"keyup":return UR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Li=!1;function $R(e,t){switch(e){case"compositionend":return xS(t);case"keypress":return t.which!==32?null:(Wy=!0,Uy);case"textInput":return e=t.data,e===Uy&&Wy?null:e;default:return null}}function HR(e,t){if(Li)return e==="compositionend"||!Wg&&yS(e,t)?(e=bS(),Mc=Bg=ca=null,Li=!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=Gy(r)}}function CS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?CS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function TS(){for(var e=window,t=ld();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ld(e.document)}return t}function $g(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 eM(e){var t=TS(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&CS(r.ownerDocument.documentElement,r)){if(n!==null&&$g(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=Ky(r,a);var i=Ky(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,Fi=null,d0=null,Cl=null,f0=!1;function Yy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;f0||Fi==null||Fi!==ld(n)||(n=Fi,"selectionStart"in n&&$g(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}),Cl&&Ul(Cl,n)||(Cl=n,n=gd(d0,"onSelect"),0Vi||(e.current=v0[Vi],v0[Vi]=null,Vi--)}function Ut(e,t){Vi++,v0[Vi]=e.current,e.current=t}var Ta={},Rr=ka(Ta),Qr=ka(!1),ri=Ta;function ss(e,t){var r=e.type.contextTypes;if(!r)return Ta;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 Xr(e){return e=e.childContextTypes,e!=null}function bd(){qt(Qr),qt(Rr)}function rx(e,t,r){if(Rr.current!==Ta)throw Error(Re(168));Ut(Rr,t),Ut(Qr,r)}function MS(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(Re(108,YA(e)||"Unknown",o));return rr({},r,n)}function vd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ta,ri=Rr.current,Ut(Rr,e),Ut(Qr,Qr.current),!0}function nx(e,t,r){var n=e.stateNode;if(!n)throw Error(Re(169));r?(e=MS(e,t,ri),n.__reactInternalMemoizedMergedChildContext=e,qt(Qr),qt(Rr),Ut(Rr,e)):qt(Qr),Ut(Qr,r)}var Ao=null,hf=!1,nh=!1;function IS(e){Ao===null?Ao=[e]:Ao.push(e)}function fM(e){hf=!0,IS(e)}function Na(){if(!nh&&Ao!==null){nh=!0;var e=0,t=Dt;try{var r=Ao;for(Dt=1;e>=i,o-=i,Ro=1<<32-Kn(t)+o|r<j?(N=w,w=null):N=w.sibling;var k=O(d,w,u[j],l);if(k===null){w===null&&(w=N);break}e&&w&&k.alternate===null&&t(d,w),s=a(k,s,j),v===null?h=k:v.sibling=k,v=k,w=N}if(j===u.length)return r(d,w),Qt&&Wa(d,j),h;if(w===null){for(;jj?(N=w,w=null):N=w.sibling;var A=O(d,w,k.value,l);if(A===null){w===null&&(w=N);break}e&&w&&A.alternate===null&&t(d,w),s=a(A,s,j),v===null?h=A:v.sibling=A,v=A,w=N}if(k.done)return r(d,w),Qt&&Wa(d,j),h;if(w===null){for(;!k.done;j++,k=u.next())k=S(d,k.value,l),k!==null&&(s=a(k,s,j),v===null?h=k:v.sibling=k,v=k);return Qt&&Wa(d,j),h}for(w=n(d,w);!k.done;j++,k=u.next())k=T(w,d,j,k.value,l),k!==null&&(e&&k.alternate!==null&&w.delete(k.key===null?j:k.key),s=a(k,s,j),v===null?h=k:v.sibling=k,v=k);return e&&w.forEach(function(M){return t(d,M)}),Qt&&Wa(d,j),h}function m(d,s,u,l){if(typeof u=="object"&&u!==null&&u.type===Di&&u.key===null&&(u=u.props.children),typeof u=="object"&&u!==null){switch(u.$$typeof){case ec:e:{for(var h=u.key,v=s;v!==null;){if(v.key===h){if(h=u.type,h===Di){if(v.tag===7){r(d,v.sibling),s=o(v,u.props.children),s.return=d,d=s;break e}}else if(v.elementType===h||typeof h=="object"&&h!==null&&h.$$typeof===aa&&cx(h)===v.type){r(d,v.sibling),s=o(v,u.props),s.ref=al(d,v,u),s.return=d,d=s;break e}r(d,v);break}else t(d,v);v=v.sibling}u.type===Di?(s=Ja(u.props.children,d.mode,l,u.key),s.return=d,d=s):(l=Uc(u.type,u.key,u.props,null,d.mode,l),l.ref=al(d,s,u),l.return=d,d=l)}return i(d);case Ii:e:{for(v=u.key;s!==null;){if(s.key===v)if(s.tag===4&&s.stateNode.containerInfo===u.containerInfo&&s.stateNode.implementation===u.implementation){r(d,s.sibling),s=o(s,u.children||[]),s.return=d,d=s;break e}else{r(d,s);break}else t(d,s);s=s.sibling}s=dh(u,d.mode,l),s.return=d,d=s}return i(d);case aa:return v=u._init,m(d,s,v(u._payload),l)}if(hl(u))return C(d,s,u,l);if(el(u))return x(d,s,u,l);dc(d,u)}return typeof u=="string"&&u!==""||typeof u=="number"?(u=""+u,s!==null&&s.tag===6?(r(d,s.sibling),s=o(s,u),s.return=d,d=s):(r(d,s),s=ch(u,d.mode,l),s.return=d,d=s),i(d)):r(d,s)}return m}var us=WS(!0),$S=WS(!1),hu={},vo=ka(hu),ql=ka(hu),Gl=ka(hu);function Ya(e){if(e===hu)throw Error(Re(174));return e}function Jg(e,t){switch(Ut(Gl,t),Ut(ql,e),Ut(vo,hu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:t0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=t0(t,e)}qt(vo),Ut(vo,t)}function cs(){qt(vo),qt(ql),qt(Gl)}function HS(e){Ya(Gl.current);var t=Ya(vo.current),r=t0(t,e.type);t!==r&&(Ut(ql,e),Ut(vo,r))}function em(e){ql.current===e&&(qt(vo),qt(ql))}var Zt=ka(0);function Cd(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 oh=[];function tm(){for(var e=0;er?r:4,e(!0);var n=ah.transition;ah.transition={};try{e(!1),t()}finally{Dt=r,ah.transition=n}}function s5(){return En().memoizedState}function mM(e,t,r){var n=ya(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},l5(e))u5(t,r);else if(r=zS(e,t,r,n),r!==null){var o=zr();Yn(r,e,n,o),c5(r,t,n)}}function bM(e,t,r){var n=ya(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(l5(e))u5(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,c=a(i,r);if(o.hasEagerState=!0,o.eagerState=c,Xn(c,i)){var f=t.interleaved;f===null?(o.next=o,Xg(t)):(o.next=f.next,f.next=o),t.interleaved=o;return}}catch{}finally{}r=zS(e,t,o,n),r!==null&&(o=zr(),Yn(r,e,n,o),c5(r,t,n))}}function l5(e){var t=e.alternate;return e===er||t!==null&&t===er}function u5(e,t){Tl=Td=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function c5(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Lg(e,r)}}var Od={readContext:Nn,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useInsertionEffect:Pr,useLayoutEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useMutableSource:Pr,useSyncExternalStore:Pr,useId:Pr,unstable_isNewReconciler:!1},vM={readContext:Nn,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:Nn,useEffect:fx,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Fc(4194308,4,r5.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Fc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fc(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();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=mM.bind(null,er,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:dx,useDebugValue:im,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=dx(!1),t=e[0];return e=gM.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=er,o=ho();if(Qt){if(r===void 0)throw Error(Re(407));r=r()}else{if(r=t(),yr===null)throw Error(Re(349));oi&30||KS(n,t,r)}o.memoizedState=r;var a={value:r,getSnapshot:t};return o.queue=a,fx(QS.bind(null,n,a,e),[e]),n.flags|=2048,Ql(9,YS.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ho(),t=yr.identifierPrefix;if(Qt){var r=Mo,n=Ro;r=(n&~(1<<32-Kn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Kl++,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[go]=t,e[Hl]=n,y5(e,t,!1,!1),t.stateNode=e;e:{switch(i=n0(r,n),r){case"dialog":$t("cancel",e),$t("close",e),o=n;break;case"iframe":case"object":case"embed":$t("load",e),o=n;break;case"video":case"audio":for(o=0;ofs&&(t.flags|=128,n=!0,il(a,!1),t.lanes=4194304)}else{if(!n)if(e=Cd(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),il(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!Qt)return kr(t),null}else 2*ar()-a.renderingStartTime>fs&&r!==1073741824&&(t.flags|=128,n=!0,il(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=ar(),t.sibling=null,r=Zt.current,Ut(Zt,n?r&1|2:r&1),t):(kr(t),null);case 22:case 23:return fm(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?on&1073741824&&(kr(t),t.subtreeFlags&6&&(t.flags|=8192)):kr(t),null;case 24:return null;case 25:return null}throw Error(Re(156,t.tag))}function OM(e,t){switch(qg(t),t.tag){case 1:return Xr(t.type)&&bd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cs(),qt(Qr),qt(Rr),tm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return em(t),null;case 13:if(qt(Zt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Re(340));ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qt(Zt),null;case 4:return cs(),null;case 10:return Qg(t.type._context),null;case 22:case 23:return fm(),null;case 24:return null;default:return null}}var pc=!1,jr=!1,PM=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function Hi(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){nr(e,t,n)}else r.current=null}function E0(e,t,r){try{r()}catch(n){nr(e,t,n)}}var wx=!1;function kM(e,t){if(p0=pd,e=TS(),$g(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,c=-1,f=-1,g=0,b=0,S=e,O=null;t:for(;;){for(var T;S!==r||o!==0&&S.nodeType!==3||(c=i+o),S!==a||n!==0&&S.nodeType!==3||(f=i+n),S.nodeType===3&&(i+=S.nodeValue.length),(T=S.firstChild)!==null;)O=S,S=T;for(;;){if(S===e)break t;if(O===r&&++g===o&&(c=i),O===a&&++b===n&&(f=i),(T=S.nextSibling)!==null)break;S=O,O=S.parentNode}S=T}r=c===-1||f===-1?null:{start:c,end:f}}else r=null}r=r||{start:0,end:0}}else r=null;for(h0={focusedElem:e,selectionRange:r},pd=!1,Ke=t;Ke!==null;)if(t=Ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ke=e;else for(;Ke!==null;){t=Ke;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 x=C.memoizedProps,m=C.memoizedState,d=t.stateNode,s=d.getSnapshotBeforeUpdate(t.elementType===t.type?x:Vn(t.type,x),m);d.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var u=t.stateNode.containerInfo;u.nodeType===1?u.textContent="":u.nodeType===9&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(l){nr(t,t.return,l)}if(e=t.sibling,e!==null){e.return=t.return,Ke=e;break}Ke=t.return}return C=wx,wx=!1,C}function Ol(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&&E0(t,r,a)}o=o.next}while(o!==n)}}function bf(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 j0(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 _5(e){var t=e.alternate;t!==null&&(e.alternate=null,_5(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[go],delete t[Hl],delete t[b0],delete t[cM],delete t[dM])),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 S5(e){return e.tag===5||e.tag===3||e.tag===4}function _x(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||S5(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 A0(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=md));else if(n!==4&&(e=e.child,e!==null))for(A0(e,t,r),e=e.sibling;e!==null;)A0(e,t,r),e=e.sibling}function R0(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(R0(e,t,r),e=e.sibling;e!==null;)R0(e,t,r),e=e.sibling}var _r=null,Un=!1;function ea(e,t,r){for(r=r.child;r!==null;)C5(e,t,r),r=r.sibling}function C5(e,t,r){if(bo&&typeof bo.onCommitFiberUnmount=="function")try{bo.onCommitFiberUnmount(uf,r)}catch{}switch(r.tag){case 5:jr||Hi(r,t);case 6:var n=_r,o=Un;_r=null,ea(e,t,r),_r=n,Un=o,_r!==null&&(Un?(e=_r,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):_r.removeChild(r.stateNode));break;case 18:_r!==null&&(Un?(e=_r,r=r.stateNode,e.nodeType===8?rh(e.parentNode,r):e.nodeType===1&&rh(e,r),Bl(e)):rh(_r,r.stateNode));break;case 4:n=_r,o=Un,_r=r.stateNode.containerInfo,Un=!0,ea(e,t,r),_r=n,Un=o;break;case 0:case 11:case 14:case 15:if(!jr&&(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)&&E0(r,t,i),o=o.next}while(o!==n)}ea(e,t,r);break;case 1:if(!jr&&(Hi(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(c){nr(r,t,c)}ea(e,t,r);break;case 21:ea(e,t,r);break;case 22:r.mode&1?(jr=(n=jr)||r.memoizedState!==null,ea(e,t,r),jr=n):ea(e,t,r);break;default:ea(e,t,r)}}function Sx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new PM),t.forEach(function(n){var o=LM.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function zn(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=i),n&=~a}if(n=o,n=ar()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*EM(n/1960))-n,10e?16:e,da===null)var n=!1;else{if(e=da,da=null,Nd=0,Ot&6)throw Error(Re(331));var o=Ot;for(Ot|=4,Ke=e.current;Ke!==null;){var a=Ke,i=a.child;if(Ke.flags&16){var c=a.deletions;if(c!==null){for(var f=0;far()-cm?Za(e,0):um|=r),Zr(e,t)}function A5(e,t){t===0&&(e.mode&1?(t=oc,oc<<=1,!(oc&130023424)&&(oc=4194304)):t=1);var r=zr();e=Bo(e,t),e!==null&&(du(e,t,r),Zr(e,r))}function DM(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),A5(e,r)}function LM(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(Re(314))}n!==null&&n.delete(t),A5(e,r)}var R5;R5=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qr.current)Kr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Kr=!1,CM(e,t,r);Kr=!!(e.flags&131072)}else Kr=!1,Qt&&t.flags&1048576&&DS(t,xd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;zc(e,t),e=t.pendingProps;var o=ss(t,Rr.current);Ji(t,r),o=nm(null,t,n,e,o,r);var a=om();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,Xr(n)?(a=!0,vd(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Zg(t),o.updater=gf,t.stateNode=o,o._reactInternals=t,S0(t,n,e,r),t=O0(null,t,n,!0,a,r)):(t.tag=0,Qt&&a&&Hg(t),Fr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(zc(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=zM(n),e=Vn(n,e),o){case 0:t=T0(null,t,n,e,r);break e;case 1:t=vx(null,t,n,e,r);break e;case 11:t=mx(null,t,n,e,r);break e;case 14:t=bx(null,t,n,Vn(n.type,e),r);break e}throw Error(Re(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Vn(n,o),T0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Vn(n,o),vx(e,t,n,o,r);case 3:e:{if(m5(t),e===null)throw Error(Re(387));n=t.pendingProps,a=t.memoizedState,o=a.element,BS(e,t),Sd(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=ds(Error(Re(423)),t),t=yx(e,t,n,r,o);break e}else if(n!==o){o=ds(Error(Re(424)),t),t=yx(e,t,n,r,o);break e}else for(an=ma(t.stateNode.containerInfo.firstChild),cn=t,Qt=!0,$n=null,r=$S(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ls(),n===o){t=Vo(e,t,r);break e}Fr(e,t,n,r)}t=t.child}return t;case 5:return HS(t),e===null&&x0(t),n=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,i=o.children,g0(n,o)?i=null:a!==null&&g0(n,a)&&(t.flags|=32),g5(e,t),Fr(e,t,i,r),t.child;case 6:return e===null&&x0(t),null;case 13:return b5(e,t,r);case 4:return Jg(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=us(t,null,n,r):Fr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Vn(n,o),mx(e,t,n,o,r);case 7:return Fr(e,t,t.pendingProps,r),t.child;case 8:return Fr(e,t,t.pendingProps.children,r),t.child;case 12:return Fr(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,Ut(wd,n._currentValue),n._currentValue=i,a!==null)if(Xn(a.value,i)){if(a.children===o.children&&!Qr.current){t=Vo(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var c=a.dependencies;if(c!==null){i=a.child;for(var f=c.firstContext;f!==null;){if(f.context===n){if(a.tag===1){f=Io(-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),w0(a.return,r,t),c.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(Re(341));i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),w0(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}Fr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,Ji(t,r),o=Nn(o),n=n(o),t.flags|=1,Fr(e,t,n,r),t.child;case 14:return n=t.type,o=Vn(n,t.pendingProps),o=Vn(n.type,o),bx(e,t,n,o,r);case 15:return p5(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Vn(n,o),zc(e,t),t.tag=1,Xr(n)?(e=!0,vd(t)):e=!1,Ji(t,r),US(t,n,o),S0(t,n,o,r),O0(null,t,n,!0,e,r);case 19:return v5(e,t,r);case 22:return h5(e,t,r)}throw Error(Re(156,t.tag))};function M5(e,t){return iS(e,t)}function FM(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 Tn(e,t,r,n){return new FM(e,t,r,n)}function hm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zM(e){if(typeof e=="function")return hm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rg)return 11;if(e===Mg)return 14}return 2}function xa(e,t){var r=e.alternate;return r===null?(r=Tn(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 Uc(e,t,r,n,o,a){var i=2;if(n=e,typeof e=="function")hm(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Di:return Ja(r.children,o,a,t);case Ag:i=8,o|=8;break;case Gh:return e=Tn(12,r,t,o|2),e.elementType=Gh,e.lanes=a,e;case Kh:return e=Tn(13,r,t,o),e.elementType=Kh,e.lanes=a,e;case Yh:return e=Tn(19,r,t,o),e.elementType=Yh,e.lanes=a,e;case W_:return yf(r,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V_:i=10;break e;case U_:i=9;break e;case Rg:i=11;break e;case Mg:i=14;break e;case aa:i=16,n=null;break e}throw Error(Re(130,e==null?e:typeof e,""))}return t=Tn(i,r,t,o),t.elementType=e,t.type=n,t.lanes=a,t}function Ja(e,t,r,n){return e=Tn(7,e,n,t),e.lanes=r,e}function yf(e,t,r,n){return e=Tn(22,e,n,t),e.elementType=W_,e.lanes=r,e.stateNode={isHidden:!1},e}function ch(e,t,r){return e=Tn(6,e,null,t),e.lanes=r,e}function dh(e,t,r){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function BM(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=Hp(0),this.expirationTimes=Hp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hp(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function gm(e,t,r,n,o,a,i,c,f){return e=new BM(e,t,r,c,f),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Tn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zg(a),e}function VM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(F5)}catch(e){console.error(e)}}F5(),D_.exports=hn;var Uo=D_.exports,jx=Uo;Hh.createRoot=jx.createRoot,Hh.hydrateRoot=jx.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 Zl(){return Zl=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ym(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function GM(){return Math.random().toString(36).substr(2,8)}function Rx(e,t){return{usr:e.state,key:e.key,idx:t}}function F0(e,t,r,n){return r===void 0&&(r=null),Zl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ps(t):t,{state:r,key:t&&t.key||n||GM()})}function Ad(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 Ps(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 KM(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,c=fa.Pop,f=null,g=b();g==null&&(g=0,i.replaceState(Zl({},i.state,{idx:g}),""));function b(){return(i.state||{idx:null}).idx}function S(){c=fa.Pop;let m=b(),d=m==null?null:m-g;g=m,f&&f({action:c,location:x.location,delta:d})}function O(m,d){c=fa.Push;let s=F0(x.location,m,d);r&&r(s,m),g=b()+1;let u=Rx(s,g),l=x.createHref(s);try{i.pushState(u,"",l)}catch(h){if(h instanceof DOMException&&h.name==="DataCloneError")throw h;o.location.assign(l)}a&&f&&f({action:c,location:x.location,delta:1})}function T(m,d){c=fa.Replace;let s=F0(x.location,m,d);r&&r(s,m),g=b();let u=Rx(s,g),l=x.createHref(s);i.replaceState(u,"",l),a&&f&&f({action:c,location:x.location,delta:0})}function C(m){let d=o.location.origin!=="null"?o.location.origin:o.location.href,s=typeof m=="string"?m:Ad(m);return tr(d,"No window.location.(origin|href) available to create URL for href: "+s),new URL(s,d)}let x={get action(){return c},get location(){return e(o,i)},listen(m){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(Ax,S),f=m,()=>{o.removeEventListener(Ax,S),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:T,go(m){return i.go(m)}};return x}var Mx;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mx||(Mx={}));function YM(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?Ps(t):t,o=Jl(n.pathname||"/",r);if(o==null)return null;let a=z5(e);QM(a);let i=null;for(let c=0;i==null&&c{let f={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};f.relativePath.startsWith("/")&&(tr(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=wa([n,f.relativePath]),b=r.concat(f);a.children&&a.children.length>0&&(tr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),z5(a.children,t,b,g)),!(a.path==null&&!a.index)&&t.push({path:g,score:nI(g,a.index),routesMeta:b})};return e.forEach((a,i)=>{var c;if(a.path===""||!((c=a.path)!=null&&c.includes("?")))o(a,i);else for(let f of B5(a.path))o(a,i,f)}),t}function B5(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=B5(n.join("/")),c=[];return c.push(...i.map(f=>f===""?a:[a,f].join("/"))),o&&c.push(...i),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function QM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:oI(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const XM=/^:\w+$/,ZM=3,JM=2,eI=1,tI=10,rI=-2,Ix=e=>e==="*";function nI(e,t){let r=e.split("/"),n=r.length;return r.some(Ix)&&(n+=rI),t&&(n+=JM),r.filter(o=>!Ix(o)).reduce((o,a)=>o+(XM.test(a)?ZM:a===""?eI:tI),n)}function oI(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 aI(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let i=0;i{if(b==="*"){let O=c[S]||"";i=a.slice(0,a.length-O.length).replace(/(.)\/+$/,"$1")}return g[b]=lI(c[S]||"",b),g},{}),pathname:a,pathnameBase:i,pattern:e}}function iI(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ym(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,c)=>(n.push(c),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function sI(e){try{return decodeURI(e)}catch(t){return ym(!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 lI(e,t){try{return decodeURIComponent(e)}catch(r){return ym(!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 Jl(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 uI(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Ps(e):e;return{pathname:r?r.startsWith("/")?r:cI(r,t):t,search:fI(n),hash:pI(o)}}function cI(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 fh(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 xm(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function wm(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Ps(e):(o=Zl({},e),tr(!o.pathname||!o.pathname.includes("?"),fh("?","pathname","search",o)),tr(!o.pathname||!o.pathname.includes("#"),fh("#","pathname","hash",o)),tr(!o.search||!o.search.includes("#"),fh("#","search","hash",o)));let a=e===""||o.pathname==="",i=a?"/":o.pathname,c;if(n||i==null)c=r;else{let S=t.length-1;if(i.startsWith("..")){let O=i.split("/");for(;O[0]==="..";)O.shift(),S-=1;o.pathname=O.join("/")}c=S>=0?t[S]:"/"}let f=uI(o,c),g=i&&i!=="/"&&i.endsWith("/"),b=(a||i===".")&&r.endsWith("/");return!f.pathname.endsWith("/")&&(g||b)&&(f.pathname+="/"),f}const wa=e=>e.join("/").replace(/\/\/+/g,"/"),dI=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),fI=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pI=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function hI(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const V5=["post","put","patch","delete"];new Set(V5);const gI=["get",...V5];new Set(gI);/** * 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 Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.pathnameBase)),i=P.useRef(!1);return $5(()=>{i.current=!0}),P.useCallback(function(f,g){if(g===void 0&&(g={}),!i.current)return;if(typeof f=="number"){r.go(f);return}let b=wm(f,JSON.parse(a),o,g.relative==="path");e==null&&t!=="/"&&(b.pathname=b.pathname==="/"?t:wa([t,b.pathname])),(g.replace?r.replace:r.push)(b,g.state,g)},[t,r,a,o,e])}function H5(){let{matches:e}=P.useContext(Ho),t=e[e.length-1];return t?t.params:{}}function Of(e,t){let{relative:r}=t===void 0?{}:t,{matches:n}=P.useContext(Ho),{pathname:o}=Ea(),a=JSON.stringify(xm(n).map(i=>i.pathnameBase));return P.useMemo(()=>wm(e,JSON.parse(a),o,r==="path"),[e,a,o,r])}function vI(e,t){return yI(e,t)}function yI(e,t,r){ks()||tr(!1);let{navigator:n}=P.useContext(pi),{matches:o}=P.useContext(Ho),a=o[o.length-1],i=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let f=Ea(),g;if(t){var b;let x=typeof t=="string"?Ps(t):t;c==="/"||(b=x.pathname)!=null&&b.startsWith(c)||tr(!1),g=x}else g=f;let S=g.pathname||"/",O=c==="/"?S:S.slice(c.length)||"/",T=YM(e,{pathname:O}),C=CI(T&&T.map(x=>Object.assign({},x,{params:Object.assign({},i,x.params),pathname:wa([c,n.encodeLocation?n.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:wa([c,n.encodeLocation?n.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),o,r);return t&&C?P.createElement(Tf.Provider,{value:{location:Rd({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:fa.Pop}},C):C}function xI(){let e=kI(),t=hI(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 P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),r?P.createElement("pre",{style:o},r):null,a)}const wI=P.createElement(xI,null);class _I extends P.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?P.createElement(Ho.Provider,{value:this.props.routeContext},P.createElement(W5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function SI(e){let{routeContext:t,match:r,children:n}=e,o=P.useContext(Cf);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),P.createElement(Ho.Provider,{value:t},n)}function CI(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 c=a.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id]));c>=0||tr(!1),a=a.slice(0,Math.min(a.length,c+1))}return a.reduceRight((c,f,g)=>{let b=f.route.id?i==null?void 0:i[f.route.id]:null,S=null;r&&(S=f.route.errorElement||wI);let O=t.concat(a.slice(0,g+1)),T=()=>{let C;return b?C=S:f.route.Component?C=P.createElement(f.route.Component,null):f.route.element?C=f.route.element:C=c,P.createElement(SI,{match:f,routeContext:{outlet:c,matches:O,isDataRoute:r!=null},children:C})};return r&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?P.createElement(_I,{location:r.location,revalidation:r.revalidation,component:S,error:b,children:T(),routeContext:{outlet:null,matches:O,isDataRoute:!0}}):T()},null)}var q5=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(q5||{}),Md=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}(Md||{});function TI(e){let t=P.useContext(Cf);return t||tr(!1),t}function OI(e){let t=P.useContext(U5);return t||tr(!1),t}function PI(e){let t=P.useContext(Ho);return t||tr(!1),t}function G5(e){let t=PI(),r=t.matches[t.matches.length-1];return r.route.id||tr(!1),r.route.id}function kI(){var e;let t=P.useContext(W5),r=OI(Md.UseRouteError),n=G5(Md.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function NI(){let{router:e}=TI(q5.UseNavigateStable),t=G5(Md.UseNavigateStable),r=P.useRef(!1);return $5(()=>{r.current=!0}),P.useCallback(function(o,a){a===void 0&&(a={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Rd({fromRouteId:t},a)))},[e,t])}function EI(e){let{to:t,replace:r,state:n,relative:o}=e;ks()||tr(!1);let{matches:a}=P.useContext(Ho),{pathname:i}=Ea(),c=So(),f=wm(t,xm(a).map(b=>b.pathnameBase),i,o==="path"),g=JSON.stringify(f);return P.useEffect(()=>c(JSON.parse(g),{replace:r,state:n,relative:o}),[c,g,o,r,n]),null}function mo(e){tr(!1)}function jI(e){let{basename:t="/",children:r=null,location:n,navigationType:o=fa.Pop,navigator:a,static:i=!1}=e;ks()&&tr(!1);let c=t.replace(/^\/*/,"/"),f=P.useMemo(()=>({basename:c,navigator:a,static:i}),[c,a,i]);typeof n=="string"&&(n=Ps(n));let{pathname:g="/",search:b="",hash:S="",state:O=null,key:T="default"}=n,C=P.useMemo(()=>{let x=Jl(g,c);return x==null?null:{location:{pathname:x,search:b,hash:S,state:O,key:T},navigationType:o}},[c,g,b,S,O,T,o]);return C==null?null:P.createElement(pi.Provider,{value:f},P.createElement(Tf.Provider,{children:r,value:C}))}function _m(e){let{children:t,location:r}=e;return vI(B0(t),r)}new Promise(()=>{});function B0(e,t){t===void 0&&(t=[]);let r=[];return P.Children.forEach(e,(n,o)=>{if(!P.isValidElement(n))return;let a=[...t,o];if(n.type===P.Fragment){r.push.apply(r,B0(n.props.children,a));return}n.type!==mo&&tr(!1),!n.props.index||!n.props.children||tr(!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=B0(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 Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[o]=e[o]);return r}function AI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function RI(e,t){return e.button===0&&(!t||t==="_self")&&!AI(e)}const MI=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],II=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],DI=P.createContext({isTransitioning:!1}),LI="startTransition",Dx=wg[LI];function FI(e){let{basename:t,children:r,future:n,window:o}=e,a=P.useRef();a.current==null&&(a.current=qM({window:o,v5Compat:!0}));let i=a.current,[c,f]=P.useState({action:i.action,location:i.location}),{v7_startTransition:g}=n||{},b=P.useCallback(S=>{g&&Dx?Dx(()=>f(S)):f(S)},[f,g]);return P.useLayoutEffect(()=>i.listen(b),[i,b]),P.createElement(jI,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:i})}const zI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",BI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Y5=P.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:a,replace:i,state:c,target:f,to:g,preventScrollReset:b,unstable_viewTransition:S}=t,O=K5(t,MI),{basename:T}=P.useContext(pi),C,x=!1;if(typeof g=="string"&&BI.test(g)&&(C=g,zI))try{let u=new URL(window.location.href),l=g.startsWith("//")?new URL(u.protocol+g):new URL(g),h=Jl(l.pathname,T);l.origin===u.origin&&h!=null?g=h+l.search+l.hash:x=!0}catch{}let m=mI(g,{relative:o}),d=WI(g,{replace:i,state:c,target:f,preventScrollReset:b,relative:o,unstable_viewTransition:S});function s(u){n&&n(u),u.defaultPrevented||d(u)}return P.createElement("a",Id({},O,{href:C||m,onClick:x||a?n:s,ref:r,target:f}))}),VI=P.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:c,to:f,unstable_viewTransition:g,children:b}=t,S=K5(t,II),O=Of(f,{relative:S.relative}),T=Ea(),C=P.useContext(U5),{navigator:x}=P.useContext(pi),m=C!=null&&$I(O)&&g===!0,d=x.encodeLocation?x.encodeLocation(O).pathname:O.pathname,s=T.pathname,u=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;o||(s=s.toLowerCase(),u=u?u.toLowerCase():null,d=d.toLowerCase());let l=s===d||!i&&s.startsWith(d)&&s.charAt(d.length)==="/",h=u!=null&&(u===d||!i&&u.startsWith(d)&&u.charAt(d.length)==="/"),v={isActive:l,isPending:h,isTransitioning:m},w=l?n:void 0,j;typeof a=="function"?j=a(v):j=[a,l?"active":null,h?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let N=typeof c=="function"?c(v):c;return P.createElement(Y5,Id({},S,{"aria-current":w,className:j,ref:r,style:N,to:f,unstable_viewTransition:g}),typeof b=="function"?b(v):b)});var V0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(V0||(V0={}));var Lx;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Lx||(Lx={}));function UI(e){let t=P.useContext(Cf);return t||tr(!1),t}function WI(e,t){let{target:r,replace:n,state:o,preventScrollReset:a,relative:i,unstable_viewTransition:c}=t===void 0?{}:t,f=So(),g=Ea(),b=Of(e,{relative:i});return P.useCallback(S=>{if(RI(S,r)){S.preventDefault();let O=n!==void 0?n:Ad(g)===Ad(b);f(e,{replace:O,state:o,preventScrollReset:a,relative:i,unstable_viewTransition:c})}},[g,f,b,n,o,r,e,a,i,c])}function $I(e,t){t===void 0&&(t={});let r=P.useContext(DI);r==null&&tr(!1);let{basename:n}=UI(V0.useViewTransitionState),o=Of(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=Jl(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Jl(r.nextLocation.pathname,n)||r.nextLocation.pathname;return z0(o.pathname,i)!=null||z0(o.pathname,a)!=null}function HI({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.createElement("path",{fillRule:"evenodd",d:"M7.5 3.75A1.5 1.5 0 006 5.25v13.5a1.5 1.5 0 001.5 1.5h6a1.5 1.5 0 001.5-1.5V15a.75.75 0 011.5 0v3.75a3 3 0 01-3 3h-6a3 3 0 01-3-3V5.25a3 3 0 013-3h6a3 3 0 013 3V9A.75.75 0 0115 9V5.25a1.5 1.5 0 00-1.5-1.5h-6zm5.03 4.72a.75.75 0 010 1.06l-1.72 1.72h10.94a.75.75 0 010 1.5H10.81l1.72 1.72a.75.75 0 11-1.06 1.06l-3-3a.75.75 0 010-1.06l3-3a.75.75 0 011.06 0z",clipRule:"evenodd"}))}const qI=P.forwardRef(HI),GI=qI;function KI({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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 YI=P.forwardRef(KI),QI=YI;function XI({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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 ZI=P.forwardRef(XI),Q5=ZI;function JI({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.createElement("path",{fillRule:"evenodd",d:"M15.75 1.5a6.75 6.75 0 00-6.651 7.906c.067.39-.032.717-.221.906l-6.5 6.499a3 3 0 00-.878 2.121v2.818c0 .414.336.75.75.75H6a.75.75 0 00.75-.75v-1.5h1.5A.75.75 0 009 19.5V18h1.5a.75.75 0 00.53-.22l2.658-2.658c.19-.189.517-.288.906-.22A6.75 6.75 0 1015.75 1.5zm0 3a.75.75 0 000 1.5A2.25 2.25 0 0118 8.25a.75.75 0 001.5 0 3.75 3.75 0 00-3.75-3.75z",clipRule:"evenodd"}))}const e4=P.forwardRef(JI),t4=e4;function r4({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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 n4=P.forwardRef(r4),o4=n4;function a4({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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 i4=P.forwardRef(a4),s4=i4;function l4({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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"}),P.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 u4=P.forwardRef(l4),c4=u4;function d4({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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"}),P.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"}),P.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 f4=P.forwardRef(d4),p4=f4;function h4({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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"}),P.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 g4=P.forwardRef(h4),m4=g4;function b4({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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 v4=P.forwardRef(b4),y4=v4;function x4({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.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"}),P.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"}),P.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 w4=P.forwardRef(x4),_4=w4;var H={},X5={},Z5={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 T4(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,S=new Array(g);bm.length)&&(d=m.length);for(var s=0,u=new Array(d);ss.length)&&(u=s.length);for(var l=0,h=new Array(u);ls.length)&&(u=s.length);for(var l=0,h=new Array(u);lw.length)&&(j=w.length);for(var N=0,k=new Array(j);Nl.length)&&(h=l.length);for(var v=0,w=new Array(h);vd.length)&&(s=d.length);for(var u=0,l=new Array(s);uh.length)&&(v=h.length);for(var w=0,j=new Array(v);wu.length)&&(l=u.length);for(var h=0,v=new Array(l);hT.length)&&(C=T.length);for(var x=0,m=new Array(C);xx.length)&&(m=x.length);for(var d=0,s=new Array(m);d"u"?c[g]=i.cloneUnlessOtherwiseSpecified(f,i):i.isMergeableObject(f)?c[g]=(0,t.default)(o[g],f,i):o.indexOf(f)===-1&&c.push(f)}),c}})(wT);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(T,C){for(var x in C)Object.defineProperty(T,x,{enumerable:!0,get:C[x]})}t(e,{MaterialTailwindTheme:function(){return b},ThemeProvider:function(){return S},useTheme:function(){return O}});var r=g(P),n=c(nt),o=c(Tr),a=c(Cm),i=c(wT);function c(T){return T&&T.__esModule?T:{default:T}}function f(T){if(typeof WeakMap!="function")return null;var C=new WeakMap,x=new WeakMap;return(f=function(m){return m?x:C})(T)}function g(T,C){if(!C&&T&&T.__esModule)return T;if(T===null||typeof T!="object"&&typeof T!="function")return{default:T};var x=f(C);if(x&&x.has(T))return x.get(T);var m={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in T)if(s!=="default"&&Object.prototype.hasOwnProperty.call(T,s)){var u=d?Object.getOwnPropertyDescriptor(T,s):null;u&&(u.get||u.set)?Object.defineProperty(m,s,u):m[s]=T[s]}return m.default=T,x&&x.set(T,m),m}var b=(0,r.createContext)(a.default);b.displayName="MaterialTailwindThemeProvider";function S(T){var C=T.value,x=C===void 0?a.default:C,m=T.children,d=(0,o.default)(a.default,x,{arrayMerge:i.default});return r.default.createElement(b.Provider,{value:d},m)}var O=function(){return(0,r.useContext)(b)};S.propTypes={value:n.default.instanceOf(Object),children:n.default.node.isRequired}})(Ze);var kf={},bu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(O,T){for(var C in T)Object.defineProperty(O,C,{enumerable:!0,get:T[C]})}t(e,{propTypesOpen:function(){return a},propTypesIcon:function(){return i},propTypesAnimate:function(){return c},propTypesDisabled:function(){return f},propTypesClassName:function(){return g},propTypesValue:function(){return b},propTypesChildren:function(){return S}});var r=o(nt),n=Gt;function o(O){return O&&O.__esModule?O:{default:O}}var a=r.default.bool.isRequired,i=r.default.node,c=n.propTypesAnimation,f=r.default.bool,g=r.default.string,b=r.default.instanceOf(Object).isRequired,S=r.default.node.isRequired})(bu);(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 c}});var r=o(P),n=bu;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 c=function(f){var g=f.value,b=f.children;return r.default.createElement(a.Provider,{value:g},b)};c.propTypes={value:n.propTypesValue,children:n.propTypesChildren},c.displayName="MaterialTailwind.AccordionContextProvider"})(kf);var _T={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{AccordionHeader:function(){return C},default:function(){return x}});var r=S(P),n=S(ct),o=rt,a=S(et),i=kf,c=Ze,f=bu;function g(m,d,s){return d in m?Object.defineProperty(m,d,{value:s,enumerable:!0,configurable:!0,writable:!0}):m[d]=s,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,u)&&(s[u]=m[u])}return s}function T(m,d){if(m==null)return{};var s={},u=Object.keys(m),l,h;for(h=0;h=0)&&(s[l]=m[l]);return s}var C=r.default.forwardRef(function(m,d){var s=m.className,u=m.children,l=O(m,["className","children"]),h=(0,i.useAccordion)(),v=h.open,w=h.icon,j=h.disabled,N=(0,c.useTheme)().accordion,k=N.styles.base;s=s??"";var A=(0,o.twMerge)((0,n.default)((0,a.default)(k.header.initial),g({},(0,a.default)(k.header.active),v)),s),M=(0,n.default)((0,a.default)(k.header.icon));return r.default.createElement("button",b({},l,{ref:d,type:"button",disabled:j,className:A}),u,r.default.createElement("span",{className:M},w??(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 x=C})(_T);var ST={},xr={},H0=function(e,t){return H0=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])},H0(e,t)};function CT(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");H0(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Ld=function(){return Ld=Object.assign||function(t){for(var r,n=1,o=arguments.length;n=0;c--)(i=e[c])&&(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 PT(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 c=n.kind,f=c==="getter"?"get":c==="setter"?"set":"value",g=!t&&e?n.static?e:e.prototype:null,b=t||(g?Object.getOwnPropertyDescriptor(g,n.name):{}),S,O=!1,T=r.length-1;T>=0;T--){var C={};for(var x in n)C[x]=x==="access"?{}:n[x];for(var x in n.access)C.access[x]=n.access[x];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[T])(c==="accessor"?{get:b.get,set:b.set}:b[f],C);if(c==="accessor"){if(m===void 0)continue;if(m===null||typeof m!="object")throw new TypeError("Object expected");(S=i(m.get))&&(b.get=S),(S=i(m.set))&&(b.set=S),(S=i(m.init))&&o.unshift(S)}else(S=i(m))&&(c==="field"?o.unshift(S):b[f]=S)}g&&Object.defineProperty(g,n.name,b),O=!0}function kT(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 Bm(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(c){i={error:c}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function IT(){for(var e=[],t=0;t1||f(T,x)})},C&&(o[T]=C(o[T])))}function f(T,C){try{g(n[T](C))}catch(x){O(a[0][3],x)}}function g(T){T.value instanceof hs?Promise.resolve(T.value.v).then(b,S):O(a[0][2],T)}function b(T){f("next",T)}function S(T){f("throw",T)}function O(T,C){T(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function zT(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:hs(e[o](i)),done:!1}:a?a(i):i}:a}}function BT(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 Fd=="function"?Fd(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(c,f){i=e[a](i),o(c,f,i.done,i.value)})}}function o(a,i,c,f){Promise.resolve(f).then(function(g){a({value:g,done:c})},i)}}function VT(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var rD=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},q0=function(e){return q0=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},q0(e)};function UT(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=q0(e),n=0;nr=>Math.max(Math.min(r,t),e),Nl=e=>e%1?Number(e.toFixed(5)):e,tu=/(-)?([\d]*\.?[\d])+/g,G0=/(#[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,lD=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function vu(e){return typeof e=="string"}const yu={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Vm=Object.assign(Object.assign({},yu),{transform:JT(0,1)}),uD=Object.assign(Object.assign({},yu),{default:1}),xu=e=>({test:t=>vu(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),cD=xu("deg"),ts=xu("%"),dD=xu("px"),fD=xu("vh"),pD=xu("vw"),hD=Object.assign(Object.assign({},ts),{parse:e=>ts.parse(e)/100,transform:e=>ts.transform(e*100)}),Um=(e,t)=>r=>!!(vu(r)&&lD.test(r)&&r.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(r,t)),eO=(e,t,r)=>n=>{if(!vu(n))return n;const[o,a,i,c]=n.match(tu);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:c!==void 0?parseFloat(c):1}},bl={test:Um("hsl","hue"),parse:eO("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+ts.transform(Nl(t))+", "+ts.transform(Nl(r))+", "+Nl(Vm.transform(n))+")"},gD=JT(0,255),$c=Object.assign(Object.assign({},yu),{transform:e=>Math.round(gD(e))}),Gi={test:Um("rgb","red"),parse:eO("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+$c.transform(e)+", "+$c.transform(t)+", "+$c.transform(r)+", "+Nl(Vm.transform(n))+")"};function mD(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 K0={test:Um("#"),parse:mD,transform:Gi.transform},Wm={test:e=>Gi.test(e)||K0.test(e)||bl.test(e),parse:e=>Gi.test(e)?Gi.parse(e):bl.test(e)?bl.parse(e):K0.parse(e),transform:e=>vu(e)?e:e.hasOwnProperty("red")?Gi.transform(e):bl.transform(e)},tO="${c}",rO="${n}";function bD(e){var t,r,n,o;return isNaN(e)&&vu(e)&&((r=(t=e.match(tu))===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0)+((o=(n=e.match(G0))===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)>0}function nO(e){typeof e=="number"&&(e=`${e}`);const t=[];let r=0;const n=e.match(G0);n&&(r=n.length,e=e.replace(G0,tO),t.push(...n.map(Wm.parse)));const o=e.match(tu);return o&&(e=e.replace(tu,rO),t.push(...o.map(yu.parse))),{values:t,numColors:r,tokenised:e}}function oO(e){return nO(e).values}function aO(e){const{values:t,numColors:r,tokenised:n}=nO(e),o=t.length;return a=>{let i=n;for(let c=0;ctypeof e=="number"?0:e;function yD(e){const t=oO(e);return aO(e)(t.map(vD))}const iO={test:bD,parse:oO,createTransformer:aO,getAnimatableNone:yD},xD=new Set(["brightness","contrast","saturate","opacity"]);function wD(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(tu)||[];if(!n)return e;const o=r.replace(n,"");let a=xD.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}const _D=/([a-z-]*)\(.*?\)/g,SD=Object.assign(Object.assign({},iO),{getAnimatableNone:e=>{const t=e.match(_D);return t?t.map(wD).join(" "):e}});fr.alpha=Vm;fr.color=Wm;fr.complex=iO;fr.degrees=cD;fr.filter=SD;fr.hex=K0;fr.hsla=bl;fr.number=yu;fr.percent=ts;fr.progressPercentage=hD;fr.px=dD;fr.rgbUnit=$c;fr.rgba=Gi;fr.scale=uD;fr.vh=fD;fr.vw=pD;var st={},bi={};Object.defineProperty(bi,"__esModule",{value:!0});const sO=1/60*1e3,CD=typeof performance<"u"?()=>performance.now():()=>Date.now(),lO=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(CD()),sO);function TD(e){let t=[],r=[],n=0,o=!1,a=!1;const i=new WeakSet,c={schedule:(f,g=!1,b=!1)=>{const S=b&&o,O=S?t:r;return g&&i.add(f),O.indexOf(f)===-1&&(O.push(f),S&&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]=TD(()=>ru=!0),e),{}),PD=wu.reduce((e,t)=>{const r=Ef[t];return e[t]=(n,o=!1,a=!1)=>(ru||jD(),r.schedule(n,o,a)),e},{}),kD=wu.reduce((e,t)=>(e[t]=Ef[t].cancel,e),{}),ND=wu.reduce((e,t)=>(e[t]=()=>Ef[t].process(rs),e),{}),ED=e=>Ef[e].process(rs),uO=e=>{ru=!1,rs.delta=Y0?sO:Math.max(Math.min(e-rs.timestamp,OD),1),rs.timestamp=e,Q0=!0,wu.forEach(ED),Q0=!1,ru&&(Y0=!1,lO(uO))},jD=()=>{ru=!0,Y0=!0,Q0||lO(uO)},AD=()=>rs;bi.cancelSync=kD;bi.default=PD;bi.flushSync=ND;bi.getFrameData=AD;Object.defineProperty(st,"__esModule",{value:!0});var cO=QT,gs=ZT,Hn=fr,jf=bi;function RD(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var MD=RD(jf);const nu=(e,t,r)=>Math.min(Math.max(r,e),t),ph=.001,ID=.01,Ux=10,DD=.05,LD=1;function FD({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let o,a;gs.warning(e<=Ux*1e3,"Spring duration must be 10 seconds or less");let i=1-t;i=nu(DD,LD,i),e=nu(ID,Ux,e/1e3),i<1?(o=g=>{const b=g*i,S=b*e,O=b-r,T=X0(g,i),C=Math.exp(-S);return ph-O/T*C},a=g=>{const S=g*i*e,O=S*r+r,T=Math.pow(i,2)*Math.pow(g,2)*e,C=Math.exp(-S),x=X0(Math.pow(g,2),i);return(-o(g)+ph>0?-1:1)*((O-T)*C)/x}):(o=g=>{const b=Math.exp(-g*e),S=(g-r)*e+1;return-ph+b*S},a=g=>{const b=Math.exp(-g*e),S=(r-g)*(e*e);return b*S});const c=5/e,f=BD(o,a,c);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 zD=12;function BD(e,t,r){let n=r;for(let o=1;oe[r]!==void 0)}function WD(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Wx(e,UD)&&Wx(e,VD)){const r=FD(e);t=Object.assign(Object.assign(Object.assign({},t),r),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Af(e){var{from:t=0,to:r=1,restSpeed:n=2,restDelta:o}=e,a=cO.__rest(e,["from","to","restSpeed","restDelta"]);const i={done:!1,value:t};let{stiffness:c,damping:f,mass:g,velocity:b,duration:S,isResolvedFromDuration:O}=WD(a),T=$x,C=$x;function x(){const m=b?-(b/1e3):0,d=r-t,s=f/(2*Math.sqrt(c*g)),u=Math.sqrt(c/g)/1e3;if(o===void 0&&(o=Math.min(Math.abs(r-t)/100,.4)),s<1){const l=X0(u,s);T=h=>{const v=Math.exp(-s*u*h);return r-v*((m+s*u*d)/l*Math.sin(l*h)+d*Math.cos(l*h))},C=h=>{const v=Math.exp(-s*u*h);return s*u*v*(Math.sin(l*h)*(m+s*u*d)/l+d*Math.cos(l*h))-v*(Math.cos(l*h)*(m+s*u*d)-l*d*Math.sin(l*h))}}else if(s===1)T=l=>r-Math.exp(-u*l)*(d+(m+u*d)*l);else{const l=u*Math.sqrt(s*s-1);T=h=>{const v=Math.exp(-s*u*h),w=Math.min(l*h,300);return r-v*((m+s*u*d)*Math.sinh(w)+l*d*Math.cosh(w))/l}}}return x(),{next:m=>{const d=T(m);if(O)i.done=m>=S;else{const s=C(m)*1e3,u=Math.abs(s)<=n,l=Math.abs(r-d)<=o;i.done=u&&l}return i.value=i.done?r:d,i},flipTarget:()=>{b=-b,[t,r]=[r,t],x()}}}Af.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const $x=e=>0,$m=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},Rf=(e,t,r)=>-r*e+r*t+e;function hh(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 Hx({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 c=r<.5?r*(1+t):r+t-r*t,f=2*r-c;o=hh(f,c,e+1/3),a=hh(f,c,e),i=hh(f,c,e-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(i*255),alpha:n}}const $D=(e,t,r)=>{const n=e*e,o=t*t;return Math.sqrt(Math.max(0,r*(o-n)+n))},HD=[Hn.hex,Hn.rgba,Hn.hsla],qx=e=>HD.find(t=>t.test(e)),Gx=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,Hm=(e,t)=>{let r=qx(e),n=qx(t);gs.invariant(!!r,Gx(e)),gs.invariant(!!n,Gx(t));let o=r.parse(e),a=n.parse(t);r===Hn.hsla&&(o=Hx(o),r=Hn.rgba),n===Hn.hsla&&(a=Hx(a),n=Hn.rgba);const i=Object.assign({},o);return c=>{for(const f in i)f!=="alpha"&&(i[f]=$D(o[f],a[f],c));return i.alpha=Rf(o.alpha,a.alpha,c),r.transform(i)}},qD={x:0,y:0,z:0},Z0=e=>typeof e=="number",GD=(e,t)=>r=>t(e(r)),qm=(...e)=>e.reduce(GD);function dO(e,t){return Z0(e)?r=>Rf(e,t,r):Hn.color.test(e)?Hm(e,t):Gm(e,t)}const fO=(e,t)=>{const r=[...e],n=r.length,o=e.map((a,i)=>dO(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]=dO(e[o],t[o]));return o=>{for(const a in n)r[a]=n[a](o);return r}};function Kx(e){const t=Hn.complex.parse(e),r=t.length;let n=0,o=0,a=0;for(let i=0;i{const r=Hn.complex.createTransformer(t),n=Kx(e),o=Kx(t);return n.numHSL===o.numHSL&&n.numRGB===o.numRGB&&n.numNumbers>=o.numNumbers?qm(fO(n.parsed,o.parsed),r):(gs.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}`)},YD=(e,t)=>r=>Rf(e,t,r);function QD(e){if(typeof e=="number")return YD;if(typeof e=="string")return Hn.color.test(e)?Hm:Gm;if(Array.isArray(e))return fO;if(typeof e=="object")return KD}function XD(e,t,r){const n=[],o=r||QD(e[0]),a=e.length-1;for(let i=0;ir($m(e,t,n))}function JD(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 c=$m(e[a],e[a+1],o);return t[a](c)}}function Km(e,t,{clamp:r=!0,ease:n,mixer:o}={}){const a=e.length;gs.invariant(a===t.length,"Both input and output ranges must be the same length"),gs.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=XD(t,n,o),c=a===2?ZD(e,i):JD(e,i);return r?f=>c(nu(e[0],e[a-1],f)):c}const _u=e=>t=>1-e(1-t),Mf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pO=e=>t=>Math.pow(t,e),Ym=e=>t=>t*t*((e+1)*t-e),hO=e=>{const t=Ym(e);return r=>(r*=2)<1?.5*t(r):.5*(2-Math.pow(2,-10*(r-1)))},gO=1.525,eL=4/11,tL=8/11,rL=9/10,mO=e=>e,Qm=pO(2),nL=_u(Qm),bO=Mf(Qm),vO=e=>1-Math.sin(Math.acos(e)),yO=_u(vO),oL=Mf(yO),Xm=Ym(gO),aL=_u(Xm),iL=Mf(Xm),sL=hO(gO),lL=4356/361,uL=35442/1805,cL=16061/1805,zd=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-zd(1-e*2)):.5*zd(e*2-1)+.5;function pL(e,t){return e.map(()=>t||bO).splice(0,e.length-1)}function hL(e){const t=e.length;return e.map((r,n)=>n!==0?n/(t-1):0)}function gL(e,t){return e.map(r=>r*t)}function El({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],c=gL(n&&n.length===i.length?n:hL(i),o);function f(){return Km(c,i,{ease:Array.isArray(r)?r:pL(i,r)})}let g=f();return{next:b=>(a.value=g(b),a.done=b>=o,a),flipTarget:()=>{i.reverse(),g=f()}}}function xO({velocity:e=0,from:t=0,power:r=.8,timeConstant:n=350,restDelta:o=.5,modifyTarget:a}){const i={done:!1,value:t};let c=r*e;const f=t+c,g=a===void 0?f:a(f);return g!==f&&(c=g-t),{next:b=>{const S=-c*Math.exp(-b/n);return i.done=!(S>o||S<-o),i.value=i.done?g:g+S,i},flipTarget:()=>{}}}const Yx={keyframes:El,spring:Af,decay:xO};function mL(e){if(Array.isArray(e.to))return El;if(Yx[e.type])return Yx[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?El:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Af:El}function wO(e,t,r=0){return e-t-r}function bL(e,t,r=0,n=!0){return n?wO(t+-e,t,r):t-(e-t)+r}function vL(e,t,r,n){return n?e>=t+r:e<=-r}const yL=e=>{const t=({delta:r})=>e(r);return{start:()=>MD.default.update(t,!0),stop:()=>jf.cancelSync.update(t)}};function _O(e){var t,r,{from:n,autoplay:o=!0,driver:a=yL,elapsed:i=0,repeat:c=0,repeatType:f="loop",repeatDelay:g=0,onPlay:b,onStop:S,onComplete:O,onRepeat:T,onUpdate:C}=e,x=cO.__rest(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:m}=x,d,s=0,u=x.duration,l,h=!1,v=!0,w;const j=mL(x);!((r=(t=j).needsInterpolation)===null||r===void 0)&&r.call(t,n,m)&&(w=Km([0,100],[n,m],{clamp:!1}),n=0,m=100);const N=j(Object.assign(Object.assign({},x),{from:n,to:m}));function k(){s++,f==="reverse"?(v=s%2===0,i=bL(i,u,g,v)):(i=wO(i,u,g),f==="mirror"&&N.flipTarget()),h=!1,T&&T()}function A(){d.stop(),O&&O()}function M(L){if(v||(L=-L),i+=L,!h){const B=N.next(Math.max(0,i));l=B.value,w&&(l=w(l)),h=v?B.done:i<=0}C==null||C(l),h&&(s===0&&(u??(u=i)),s{S==null||S(),d.stop()}}}function SO(e,t){return t?e*(1e3/t):0}function xL({from:e=0,velocity:t=0,min:r,max:n,power:o=.8,timeConstant:a=750,bounceStiffness:i=500,bounceDamping:c=10,restDelta:f=1,modifyTarget:g,driver:b,onUpdate:S,onComplete:O,onStop:T}){let C;function x(u){return r!==void 0&&un}function m(u){return r===void 0?n:n===void 0||Math.abs(r-u){var h;S==null||S(l),(h=u.onUpdate)===null||h===void 0||h.call(u,l)},onComplete:O,onStop:T}))}function s(u){d(Object.assign({type:"spring",stiffness:i,damping:c,restDelta:f},u))}if(x(e))s({from:e,velocity:t,to:m(e)});else{let u=o*t+e;typeof g<"u"&&(u=g(u));const l=m(u),h=l===r?-1:1;let v,w;const j=N=>{v=w,w=N,t=SO(N-v,jf.getFrameData().delta),(h===1&&N>l||h===-1&&NC==null?void 0:C.stop()}}const CO=e=>e*180/Math.PI,wL=(e,t=qD)=>CO(Math.atan2(t.y-e.y,t.x-e.x)),_L=(e,t)=>{let r=!0;return t===void 0&&(t=e,r=!1),n=>r?n-e+t:(e=n,r=!0,t)},SL=e=>e,Zm=(e=SL)=>(t,r,n)=>{const o=r-n,a=-(0-t+1)*(0-e(Math.abs(o)));return o<=0?r+a:r-a},CL=Zm(),TL=Zm(Math.sqrt),TO=e=>e*Math.PI/180,Bd=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),J0=e=>Bd(e)&&e.hasOwnProperty("z"),mc=(e,t)=>Math.abs(e-t);function OL(e,t){if(Z0(e)&&Z0(t))return mc(e,t);if(Bd(e)&&Bd(t)){const r=mc(e.x,t.x),n=mc(e.y,t.y),o=J0(e)&&J0(t)?mc(e.z,t.z):0;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2)+Math.pow(o,2))}}const PL=(e,t,r)=>(t=TO(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),PO=(e,t,r,n=0)=>OO(e+r*(t-e)/Math.max(n,r)),kL=(e=50)=>{let t=0,r=0;return n=>{const o=jf.getFrameData().timestamp,a=o!==r?o-r:0,i=a?PO(t,n,a,e):t;return r=o,t=i,i}},NL=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 EL(e,t){return e/(1e3/t)}const jL=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e},kO=(e,t)=>1-3*t+3*e,NO=(e,t)=>3*t-6*e,EO=e=>3*e,Vd=(e,t,r)=>((kO(t,r)*e+NO(t,r))*e+EO(t))*e,jO=(e,t,r)=>3*kO(t,r)*e*e+2*NO(t,r)*e+EO(t),AL=1e-7,RL=10;function ML(e,t,r,n,o){let a,i,c=0;do i=t+(r-t)/2,a=Vd(i,n,o)-e,a>0?r=i:t=i;while(Math.abs(a)>AL&&++c=DL?LL(i,S,e,r):O===0?S:ML(i,c,c+bc,e,r)}return i=>i===0||i===1?i:Vd(a(i),t,n)}const zL=(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 nu(0,1,o/e)};st.angle=wL;st.animate=_O;st.anticipate=sL;st.applyOffset=_L;st.attract=CL;st.attractExpo=TL;st.backIn=Xm;st.backInOut=iL;st.backOut=aL;st.bounceIn=dL;st.bounceInOut=fL;st.bounceOut=zd;st.circIn=vO;st.circInOut=oL;st.circOut=yO;st.clamp=nu;st.createAnticipate=hO;st.createAttractor=Zm;st.createBackIn=Ym;st.createExpoIn=pO;st.cubicBezier=FL;st.decay=xO;st.degreesToRadians=TO;st.distance=OL;st.easeIn=Qm;st.easeInOut=bO;st.easeOut=nL;st.inertia=xL;st.interpolate=Km;st.isPoint=Bd;st.isPoint3D=J0;st.keyframes=El;st.linear=mO;st.mirrorEasing=Mf;st.mix=Rf;st.mixColor=Hm;st.mixComplex=Gm;st.pipe=qm;st.pointFromVector=PL;st.progress=$m;st.radiansToDegrees=CO;st.reverseEasing=_u;st.smooth=kL;st.smoothFrame=PO;st.snap=NL;st.spring=Af;st.steps=zL;st.toDecimal=OO;st.velocityPerFrame=EL;st.velocityPerSecond=SO;st.wrap=jL;class BL{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const gh=new WeakMap;function Jm(e){return gh.has(e)||gh.set(e,{transforms:[],values:new Map}),gh.get(e)}function VL(e,t){return e.has(t)||e.set(t,new BL),e.get(t)}function AO(e,t){e.indexOf(t)===-1&&e.push(t)}function RO(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const MO=(e,t,r)=>Math.min(Math.max(r,e),t),Gr={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Wo=e=>typeof e=="number",ou=e=>Array.isArray(e)&&!Wo(e[0]),UL=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function IO(e,t){return ou(e)?e[UL(0,e.length,t)]:e}const eb=(e,t,r)=>-r*e+r*t+e,tb=()=>{},Do=e=>e,If=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function rb(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=If(0,t,n);e.push(eb(r,1,o))}}function nb(e){const t=[0];return rb(t,e-1),t}function DO(e,t=nb(e.length),r=Do){const n=e.length,o=n-t.length;return o>0&&rb(t,o),a=>{let i=0;for(;iArray.isArray(e)&&Wo(e[0]),Ud=e=>typeof e=="object"&&!!e.createAnimation,WL=e=>typeof e=="function",ob=e=>typeof e=="string",ei={ms:e=>e*1e3,s:e=>e/1e3};function FO(e,t){return t?e*(1e3/t):0}const $L=["","X","Y","Z"],HL=["translate","scale","rotate","skew"],ms={x:"translateX",y:"translateY",z:"translateZ"},Qx={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},qL={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:Qx,scale:{syntax:"",initialValue:1,toDefaultUnit:Do},skew:Qx},bs=new Map,Df=e=>`--motion-${e}`,Wd=["x","y","z"];HL.forEach(e=>{$L.forEach(t=>{Wd.push(e+t),bs.set(Df(e+t),qL[e])})});const GL=(e,t)=>Wd.indexOf(e)-Wd.indexOf(t),KL=new Set(Wd),Lf=e=>KL.has(e),YL=(e,t)=>{ms[t]&&(t=ms[t]);const{transforms:r}=Jm(e);AO(r,t),e.style.transform=zO(r)},zO=e=>e.sort(GL).reduce(QL,"").trim(),QL=(e,t)=>`${e} ${t}(var(${Df(t)}))`,eg=e=>e.startsWith("--"),Xx=new Set;function XL(e){if(!Xx.has(e)){Xx.add(e);try{const{syntax:t,initialValue:r}=bs.has(e)?bs.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const BO=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,ZL=1e-7,JL=12;function e3(e,t,r,n,o){let a,i,c=0;do i=t+(r-t)/2,a=BO(i,n,o)-e,a>0?r=i:t=i;while(Math.abs(a)>ZL&&++ce3(a,0,1,e,r);return a=>a===0||a===1?a:BO(o(a),t,n)}const t3=(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 MO(0,1,o/e)},r3={ease:vl(.25,.1,.25,1),"ease-in":vl(.42,0,1,1),"ease-in-out":vl(.42,0,.58,1),"ease-out":vl(0,0,.58,1)},n3=/\((.*?)\)/;function tg(e){if(WL(e))return e;if(LO(e))return vl(...e);const t=r3[e];if(t)return t;if(e.startsWith("steps")){const r=n3.exec(e);if(r){const n=r[1].split(",");return t3(parseFloat(n[0]),n[1].trim())}}return Do}class o3{constructor(t,r=[0,1],{easing:n,duration:o=Gr.duration,delay:a=Gr.delay,endDelay:i=Gr.endDelay,repeat:c=Gr.repeat,offset:f,direction:g="normal",autoplay:b=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Do,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((O,T)=>{this.resolve=O,this.reject=T}),n=n||Gr.easing,Ud(n)){const O=n.createAnimation(r);n=O.easing,r=O.keyframes||r,o=O.duration||o}this.repeat=c,this.easing=ou(n)?Do:tg(n),this.updateDuration(o);const S=DO(r,f,ou(n)?n.map(tg):Do);this.tick=O=>{var T;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 x=C/this.duration;let m=Math.floor(x),d=x%1;!d&&x>=1&&(d=1),d===1&&m--;const s=m%2;(g==="reverse"||g==="alternate"&&s||g==="alternate-reverse"&&!s)&&(d=1-d);const u=C>=this.totalDuration?1:Math.min(d,1),l=S(this.easing(u));t(l),this.pauseTime===void 0&&(this.playState==="finished"||C>=this.totalDuration+i)?(this.playState="finished",(T=this.resolve)===null||T===void 0||T.call(this,l)):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 Zx=e=>LO(e)?a3(e):e,a3=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Jx=e=>document.createElement("div").animate(e,{duration:.001}),ew={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Jx({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Jx({opacity:[0,1]}).finished},mh={},qc={};for(const e in ew)qc[e]=()=>(mh[e]===void 0&&(mh[e]=ew[e]()),mh[e]);function i3(e,t){for(let r=0;rArray.isArray(e)?e:[e];function $d(e){return ms[e]&&(e=ms[e]),Lf(e)?Df(e):e}const Ki={get:(e,t)=>{t=$d(t);let r=eg(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=bs.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=$d(t),eg(t)?e.style.setProperty(t,r):e.style[t]=r}};function UO(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function s3(){return window.__MOTION_DEV_TOOLS_RECORD}function Ff(e,t,r,n={}){const o=s3(),a=n.record!==!1&&o;let i,{duration:c=Gr.duration,delay:f=Gr.delay,endDelay:g=Gr.endDelay,repeat:b=Gr.repeat,easing:S=Gr.easing,direction:O,offset:T,allowWebkitAcceleration:C=!1}=n;const x=Jm(e);let m=qc.waapi();const d=Lf(t);d&&YL(e,t);const s=$d(t),u=VL(x.values,s),l=bs.get(s);return UO(u.animation,!(Ud(S)&&u.generator)&&n.record!==!1),()=>{const h=()=>{var w,j;return(j=(w=Ki.get(e,s))!==null&&w!==void 0?w:l==null?void 0:l.initialValue)!==null&&j!==void 0?j:0};let v=i3(VO(r),h);if(Ud(S)){const w=S.createAnimation(v,h,d,s,u);S=w.easing,w.keyframes!==void 0&&(v=w.keyframes),w.duration!==void 0&&(c=w.duration)}if(eg(s)&&(qc.cssRegisterProperty()?XL(s):m=!1),m){l&&(v=v.map(N=>Wo(N)?l.toDefaultUnit(N):N)),v.length===1&&(!qc.partialKeyframes()||a)&&v.unshift(h());const w={delay:ei.ms(f),duration:ei.ms(c),endDelay:ei.ms(g),easing:ou(S)?void 0:Zx(S),direction:O,iterations:b+1,fill:"both"};i=e.animate({[s]:v,offset:T,easing:ou(S)?S.map(Zx):void 0},w),i.finished||(i.finished=new Promise((N,k)=>{i.onfinish=N,i.oncancel=k}));const j=v[v.length-1];i.finished.then(()=>{Ki.set(e,s,j),i.cancel()}).catch(tb),C||(i.playbackRate=1.000001)}else if(d){v=v.map(j=>typeof j=="string"?parseFloat(j):j),v.length===1&&v.unshift(parseFloat(h()));const w=j=>{l&&(j=l.toDefaultUnit(j)),Ki.set(e,s,j)};i=new o3(w,v,Object.assign(Object.assign({},n),{duration:c,easing:S}))}else{const w=v[v.length-1];Ki.set(e,s,l&&Wo(w)?l.toDefaultUnit(w):w)}return a&&o(e,t,v,{duration:c,delay:f,easing:S,repeat:b,offset:T},"motion-one"),u.setAnimation(i),i}}const ab=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function zf(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 l3=e=>e(),ib=(e,t,r=Gr.duration)=>new Proxy({animations:e.map(l3).filter(Boolean),duration:r,options:t},c3),u3=e=>e.animations[0],c3={get:(e,t)=>{const r=u3(e);switch(t){case"duration":return e.duration;case"currentTime":return ei.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(d3)).catch(tb)),e.finished;case"stop":return()=>{e.animations.forEach(n=>UO(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=ei.ms(r);case"currentTime":case"playbackRate":for(let n=0;ne.finished;function f3(e=.1,{start:t=0,from:r=0,easing:n}={}){return(o,a)=>{const i=Wo(r)?r:p3(r,a),c=Math.abs(i-o);let f=e*c;if(n){const g=a*e;f=tg(n)(f/g)*g}return t+f}}function p3(e,t){if(e==="first")return 0;{const r=t-1;return e==="last"?r:r/2}}function WO(e,t,r){return typeof e=="function"?e(t,r):e}function h3(e,t,r={}){e=zf(e);const n=e.length,o=[];for(let a=0;at&&o.atFf(...a)).filter(Boolean);return ib(o,t,(r=n[0])===null||r===void 0?void 0:r[3].duration)}function y3(e,t={}){var{defaultOptions:r={}}=t,n=Es(t,["defaultOptions"]);const o=[],a=new Map,i={},c=new Map;let f=0,g=0,b=0;for(let S=0;S"0",Y);A=q.easing,q.keyframes!==void 0&&(j=q.keyframes),q.duration!==void 0&&(k=q.duration)}const M=WO(x.delay,u,s)||0,D=g+M,L=D+k;let{offset:B=nb(j.length)}=N;B.length===1&&B[0]===0&&(B[1]=1);const U=length-j.length;U>0&&rb(B,U),j.length===1&&j.unshift(null),m3(w,j,A,B,D,L),m=Math.max(M+k,m),b=Math.max(L,b)}}f=g,g+=m}return a.forEach((S,O)=>{for(const T in S){const C=S[T];C.sort(b3);const x=[],m=[],d=[];for(let s=0;st/(2*Math.sqrt(e*r));function C3(e,t,r){return e=t||e>t&&r<=t}const $O=({stiffness:e=ns.stiffness,damping:t=ns.damping,mass:r=ns.mass,from:n=0,to:o=1,velocity:a=0,restSpeed:i,restDistance:c}={})=>{a=a?ei.s(a):0;const f={done:!1,hasReachedTarget:!1,current:n,target:o},g=o-n,b=Math.sqrt(e/r)/1e3,S=S3(e,t,r),O=Math.abs(g)<5;i||(i=O?.01:2),c||(c=O?.005:.5);let T;if(S<1){const C=b*Math.sqrt(1-S*S);T=x=>o-Math.exp(-S*b*x)*((-a+S*b*g)/C*Math.sin(C*x)+g*Math.cos(C*x))}else T=C=>o-Math.exp(-b*C)*(g+(-a+b*g)*C);return C=>{f.current=T(C);const x=C===0?a:sb(T,C,f.current),m=Math.abs(x)<=i,d=Math.abs(o-f.current)<=c;return f.done=m&&d,f.hasReachedTarget=C3(n,o,f.current),f}},T3=({from:e=0,velocity:t=0,power:r=.8,decay:n=.325,bounceDamping:o,bounceStiffness:a,changeTarget:i,min:c,max:f,restDistance:g=.5,restSpeed:b})=>{n=ei.ms(n);const S={hasReachedTarget:!1,done:!1,current:e,target:e},O=w=>c!==void 0&&wf,T=w=>c===void 0?f:f===void 0||Math.abs(c-w)-C*Math.exp(-w/n),s=w=>m+d(w),u=w=>{const j=d(w),N=s(w);S.done=Math.abs(j)<=g,S.current=S.done?m:N};let l,h;const v=w=>{O(S.current)&&(l=w,h=$O({from:S.current,to:T(S.current),velocity:sb(s,w,S.current),damping:o,stiffness:a,restDistance:g,restSpeed:b}))};return v(0),w=>{let j=!1;return!h&&l===void 0&&(j=!0,u(w),v(w)),l!==void 0&&w>l?(S.hasReachedTarget=!0,h(w-l)):(S.hasReachedTarget=!1,!j&&u(w),S)}},bh=10,O3=1e4;function P3(e,t=Do){let r,n=bh,o=e(0);const a=[t(o.current)];for(;!o.done&&n{const n=new Map,o=(i=0,c=100,f=0,g=!1)=>{const b=`${i}-${c}-${f}-${g}`;return n.has(b)||n.set(b,e(Object.assign({from:i,to:c,velocity:f,restSpeed:g?.05:2,restDistance:g?.01:.5},r))),n.get(b)},a=i=>(t.has(i)||t.set(i,P3(i)),t.get(i));return{createAnimation:(i,c,f,g,b)=>{var S,O;let T;const C=i.length;if(f&&C<=2&&i.every(k3)){const m=i[C-1],d=C===1?null:i[0];let s=0,u=0;const l=b==null?void 0:b.generator;if(l){const{animation:w,generatorStartTime:j}=b,N=(w==null?void 0:w.startTime)||j||0,k=(w==null?void 0:w.currentTime)||performance.now()-N,A=l(k).current;u=(S=d)!==null&&S!==void 0?S:A,(C===1||C===2&&i[0]===null)&&(s=sb(M=>l(M).current,k,A))}else u=(O=d)!==null&&O!==void 0?O:parseFloat(c());const h=o(u,m,s,g==null?void 0:g.includes("scale")),v=a(h);T=Object.assign(Object.assign({},v),{easing:"linear"}),b&&(b.generator=h,b.generatorStartTime=performance.now())}else T={easing:"ease",duration:a(o(0,100)).overshootDuration};return T}}}}const k3=e=>typeof e!="string",N3=HO($O),E3=HO(T3),j3={any:0,all:1};function qO(e,t,{root:r,margin:n,amount:o="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=zf(e),i=new WeakMap,c=g=>{g.forEach(b=>{const S=i.get(b.target);if(b.isIntersecting!==!!S)if(b.isIntersecting){const O=t(b);typeof O=="function"?i.set(b.target,O):f.unobserve(b.target)}else S&&(S(b),i.delete(b.target))})},f=new IntersectionObserver(c,{root:r,rootMargin:n,threshold:typeof o=="number"?o:j3[o]});return a.forEach(g=>f.observe(g)),()=>f.disconnect()}const Gc=new WeakMap;let na;function A3(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 R3({target:e,contentRect:t,borderBoxSize:r}){var n;(n=Gc.get(e))===null||n===void 0||n.forEach(o=>{o({target:e,contentSize:t,get size(){return A3(e,r)}})})}function M3(e){e.forEach(R3)}function I3(){typeof ResizeObserver>"u"||(na=new ResizeObserver(M3))}function D3(e,t){na||I3();const r=zf(e);return r.forEach(n=>{let o=Gc.get(n);o||(o=new Set,Gc.set(n,o)),o.add(t),na==null||na.observe(n)}),()=>{r.forEach(n=>{const o=Gc.get(n);o==null||o.delete(t),o!=null&&o.size||na==null||na.unobserve(n)})}}const Kc=new Set;let jl;function L3(){jl=()=>{const e={width:window.innerWidth,height:window.innerHeight},t={target:window,size:e,contentSize:e};Kc.forEach(r=>r(t))},window.addEventListener("resize",jl)}function F3(e){return Kc.add(e),jl||L3(),()=>{Kc.delete(e),!Kc.size&&jl&&(jl=void 0)}}function GO(e,t){return typeof e=="function"?F3(e):D3(e,t)}const z3=50,rw=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),B3=()=>({time:0,x:rw(),y:rw()}),V3={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function nw(e,t,r,n){const o=r[t],{length:a,position:i}=V3[t],c=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=If(0,o.scrollLength,o.current);const g=n-f;o.velocity=g>z3?0:FO(o.current-c,g)}function U3(e,t,r){nw(e,"x",t,r),nw(e,"y",t,r),t.time=r}function W3(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 KO={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},rg={start:0,center:.5,end:1};function ow(e,t,r=0){let n=0;if(rg[e]!==void 0&&(e=rg[e]),ob(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 Wo(e)&&(n=t*e),r+n}const $3=[0,0];function H3(e,t,r,n){let o=Array.isArray(e)?e:$3,a=0,i=0;return Wo(e)?o=[e,e]:ob(e)&&(e=e.trim(),e.includes(" ")?o=e.split(" "):o=[e,rg[e]?e:"0"]),a=ow(o[0],r,n),i=ow(o[1],t),a-i}const q3={x:0,y:0};function G3(e,t,r){let{offset:n=KO.All}=r;const{target:o=e,axis:a="y"}=r,i=a==="y"?"height":"width",c=o!==e?W3(o,e):q3,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 S=n.length;for(let O=0;OK3(e,n.target,r),update:a=>{U3(e,r,a),(n.offset||n.target)&&G3(e,r,n)},notify:typeof t=="function"?()=>t(r):Q3(t,r[o])}}function Q3(e,t){return e.pause(),e.forEachNative((r,{easing:n})=>{var o,a;if(r.updateDuration)n||(r.easing=Do),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 ll=new WeakMap,aw=new WeakMap,vh=new WeakMap,iw=e=>e===document.documentElement?window:e;function X3(e,t={}){var{container:r=document.documentElement}=t,n=Es(t,["container"]);let o=vh.get(r);o||(o=new Set,vh.set(r,o));const a=B3(),i=Y3(r,e,a,n);if(o.add(i),!ll.has(r)){const g=()=>{const S=performance.now();for(const O of o)O.measure();for(const O of o)O.update(S);for(const O of o)O.notify()};ll.set(r,g);const b=iw(r);window.addEventListener("resize",g,{passive:!0}),r!==document.documentElement&&aw.set(r,GO(r,g)),b.addEventListener("scroll",g,{passive:!0})}const c=ll.get(r),f=requestAnimationFrame(c);return()=>{var g;typeof e!="function"&&e.stop(),cancelAnimationFrame(f);const b=vh.get(r);if(!b||(b.delete(i),b.size))return;const S=ll.get(r);ll.delete(r),S&&(iw(r).removeEventListener("scroll",S),(g=aw.get(r))===null||g===void 0||g(),window.removeEventListener("resize",S))}}function Z3(e,t){return typeof e!=typeof t?!0:Array.isArray(e)&&Array.isArray(t)?!J3(e,t):e!==t}function J3(e,t){const r=t.length;if(r!==e.length)return!1;for(let n=0;ne.getDepth()-t.getDepth(),oF=e=>e.animateUpdates(),lw=e=>e.next(),uw=(e,t)=>new CustomEvent(e,{detail:{target:t}});function ng(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:r}}))}function cw(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:{originalEntry:r}}))}const aF={isActive:e=>!!e.inView,subscribe:(e,{enable:t,disable:r},{inViewOptions:n={}})=>{const{once:o}=n,a=Es(n,["once"]);return qO(e,i=>{if(t(),cw(e,"viewenter",i),!o)return c=>{r(),cw(e,"viewleave",c)}},a)}},dw=(e,t,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),ng(e,t,n))},iF={isActive:e=>!!e.hover,subscribe:(e,{enable:t,disable:r})=>{const n=dw(e,"hoverstart",t),o=dw(e,"hoverend",r);return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",o),()=>{e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",o)}}},sF={isActive:e=>!!e.press,subscribe:(e,{enable:t,disable:r})=>{const n=a=>{r(),ng(e,"pressend",a),window.removeEventListener("pointerup",n)},o=a=>{t(),ng(e,"pressstart",a),window.addEventListener("pointerup",n)};return e.addEventListener("pointerdown",o),()=>{e.removeEventListener("pointerdown",o),window.removeEventListener("pointerup",n)}}},Yc={inView:aF,hover:iF,press:sF},fw=["initial","animate",...Object.keys(Yc),"exit"],og=new WeakMap;function lF(e={},t){let r,n=t?t.getDepth()+1:0;const o={initial:!0,animate:!0},a={},i={};for(const x of fw)i[x]=typeof e[x]=="string"?e[x]:t==null?void 0:t.getContext()[x];const c=e.initial===!1?"animate":"initial";let f=sw(e[c]||i[c],e.variants)||{},g=Es(f,["transition"]);const b=Object.assign({},g);function*S(){var x,m;const d=g;g={};const s={};for(const w of fw){if(!o[w])continue;const j=sw(e[w]);if(j)for(const N in j)N!=="transition"&&(g[N]=j[N],s[N]=ab((m=(x=j.transition)!==null&&x!==void 0?x:e.transition)!==null&&m!==void 0?m:{},N))}const u=new Set([...Object.keys(g),...Object.keys(d)]),l=[];u.forEach(w=>{var j;g[w]===void 0&&(g[w]=b[w]),Z3(d[w],g[w])&&((j=b[w])!==null&&j!==void 0||(b[w]=Ki.get(r,w)),l.push(Ff(r,w,g[w],s[w])))}),yield;const h=l.map(w=>w()).filter(Boolean);if(!h.length)return;const v=g;r.dispatchEvent(uw("motionstart",v)),Promise.all(h.map(w=>w.finished)).then(()=>{r.dispatchEvent(uw("motioncomplete",v))}).catch(tb)}const O=(x,m)=>()=>{o[x]=m,yh(C)},T=()=>{for(const x in Yc){const m=Yc[x].isActive(e),d=a[x];m&&!d?a[x]=Yc[x].subscribe(r,{enable:O(x,!0),disable:O(x,!1)},e):!m&&d&&(d(),delete a[x])}},C={update:x=>{r&&(e=x,T(),yh(C))},setActive:(x,m)=>{r&&(o[x]=m,yh(C))},animateUpdates:S,getDepth:()=>n,getTarget:()=>g,getOptions:()=>e,getContext:()=>i,mount:x=>(r=x,og.set(r,C),T(),()=>{og.delete(r),rF(C);for(const m in a)a[m]()}),isMounted:()=>!!r};return C}function YO(e){const t={},r=[];for(let n in e){const o=e[n];Lf(n)&&(ms[n]&&(n=ms[n]),r.push(n),n=Df(n));let a=Array.isArray(o)?o[0]:o;const i=bs.get(n);i&&(a=Wo(o)?i.toDefaultUnit(o):o),t[n]=a}return r.length&&(t.transform=zO(r)),t}const uF=e=>`-${e.toLowerCase()}`,cF=e=>e.replace(/[A-Z]/g,uF);function dF(e={}){const t=YO(e);let r="";for(const n in t)r+=n.startsWith("--")?n:cF(n),r+=`: ${t[n]}; `;return r}const fF=Object.freeze(Object.defineProperty({__proto__:null,ScrollOffset:KO,animate:h3,animateStyle:Ff,createMotionState:lF,createStyleString:dF,createStyles:YO,getAnimationData:Jm,getStyleName:$d,glide:E3,inView:qO,mountedStates:og,resize:GO,scroll:X3,spring:N3,stagger:f3,style:Ki,timeline:v3,withControls:ib},Symbol.toStringTag,{value:"Module"})),pF=lu(fF);function hF(e){var t={};return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var gF=/^((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)-.*))$/,mF=hF(function(e){return gF.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});const bF=Object.freeze(Object.defineProperty({__proto__:null,default:mF},Symbol.toStringTag,{value:"Module"})),vF=lu(bF);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=QT,r=P,n=ZT,o=fr,a=st,i=bi,c=pF;function f(p){return p&&typeof p=="object"&&"default"in p?p:{default:p}}function g(p){if(p&&p.__esModule)return p;var _=Object.create(null);return p&&Object.keys(p).forEach(function(E){if(E!=="default"){var R=Object.getOwnPropertyDescriptor(p,E);Object.defineProperty(_,E,R.get?R:{enumerable:!0,get:function(){return p[E]}})}}),_.default=p,Object.freeze(_)}var b=g(r),S=f(r),O=f(i),T="production",C=typeof process>"u"||process.env===void 0?T:"production",x=function(p){return{isEnabled:function(_){return p.some(function(E){return!!_[E]})}}},m={measureLayout:x(["layout","layoutId","drag"]),animation:x(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:x(["exit"]),drag:x(["drag","dragControls"]),focus:x(["whileFocus"]),hover:x(["whileHover","onHoverStart","onHoverEnd"]),tap:x(["whileTap","onTap","onTapStart","onTapCancel"]),pan:x(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:x(["whileInView","onViewportEnter","onViewportLeave"])};function d(p){for(var _ in p)p[_]!==null&&(_==="projectionNodeConstructor"?m.projectionNodeConstructor=p[_]:m[_].Component=p[_])}var s=r.createContext({strict:!1}),u=Object.keys(m),l=u.length;function h(p,_,E){var R=[],I=r.useContext(s);if(!_)return null;C!=="production"&&E&&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 V=0;V"u")return _;var E=new Map;return new Proxy(_,{get:function(R,I){return E.has(I)||E.set(I,_(I)),E.get(I)}})}var Xe=["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 ht(p){return typeof p!="string"||p.includes("-")?!1:!!(Xe.indexOf(p)>-1||/[A-Z]/.test(p))}var Ve={};function ot(p){Object.assign(Ve,p)}var _t=["","X","Y","Z"],Ne=["translate","scale","rotate","skew"],at=["transformPerspective","x","y","z"];Ne.forEach(function(p){return _t.forEach(function(_){return at.push(p+_)})});function Te(p,_){return at.indexOf(p)-at.indexOf(_)}var ae=new Set(at);function ge(p){return ae.has(p)}var oe=new Set(["originX","originY","originZ"]);function ve(p){return oe.has(p)}function se(p,_){var E=_.layout,R=_.layoutId;return ge(p)||ve(p)||(E||R!==void 0)&&(!!Ve[p]||p==="opacity")}var ie=function(p){return!!(p!==null&&typeof p=="object"&&p.getVelocity)},he={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Oe(p,_,E,R){var I=p.transform,V=p.transformKeys,W=_.enableHardwareAcceleration,F=W===void 0?!0:W,G=_.allowTransformNone,Q=G===void 0?!0:G,Z="";V.sort(Te);for(var re=!1,ne=V.length,le=0;le"u"?Bu:sp;Q(G,F.current,_,W)}var ip={some:0,all:1};function sp(p,_,E,R){var I=R.root,V=R.margin,W=R.amount,F=W===void 0?"some":W,G=R.once;r.useEffect(function(){if(p){var Q={root:I==null?void 0:I.current,rootMargin:V,threshold:typeof F=="number"?F:ip[F]},Z=function(re){var ne,le=re.isIntersecting;if(_.isInView!==le&&(_.isInView=le,!(G&&!le&&_.hasEnteredView))){le&&(_.hasEnteredView=!0),(ne=E.animationState)===null||ne===void 0||ne.setActive(e.AnimationType.InView,le);var ue=E.getProps(),we=le?ue.onViewportEnter:ue.onViewportLeave;we==null||we(re)}};return op(E.getInstance(),Q,Z)}},[p,I,V,F])}function Bu(p,_,E,R){var I=R.fallback,V=I===void 0?!0:I;r.useEffect(function(){!p||!V||(C!=="production"&&Ln(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(function(){var W;_.hasEnteredView=!0;var F=E.getProps().onViewportEnter;F==null||F(null),(W=E.animationState)===null||W===void 0||W.setActive(e.AnimationType.InView,!0)}))},[p])}var lo=function(p){return function(_){return p(_),null}},Ws={inView:lo(ap),tap:lo(rp),focus:lo(Nt),hover:lo(tp)},Vu=0,Uu=function(){return Vu++},$s=function(){return ye(Uu)};function xe(){var p=r.useContext(N);if(p===null)return[!0,null];var _=p.isPresent,E=p.onExitComplete,R=p.register,I=$s();r.useEffect(function(){return R(I)},[]);var V=function(){return E==null?void 0:E(I)};return!_&&E?[!1,V]:[!0]}function Le(){return ze(r.useContext(N))}function ze(p){return p===null?!0:p.isPresent}function We(p,_){if(!Array.isArray(_))return!1;var E=_.length;if(E!==p.length)return!1;for(var R=0;R-1&&p.splice(E,1)}function _N(p,_,E){var R=t.__read(p),I=R.slice(0),V=_<0?I.length+_:_;if(V>=0&&Vtt&&vn,Zo=Array.isArray(Yt)?Yt:[Yt],yn=Zo.reduce(V,{});Dr===!1&&(yn={});var Xs=Tt.prevResolvedValues,Ei=Xs===void 0?{}:Xs,Xu=t.__assign(t.__assign({},Ei),yn),ji=function(ut){Xo=!0,De.delete(ut),Tt.needsAnimating[ut]=!0};for(var $r in Xu){var At=yn[$r],Ye=Ei[$r];$e.hasOwnProperty($r)||(At!==Ye?Ct(At)&&Ct(Ye)?!We(At,Ye)||Qo?ji($r):Tt.protectedKeys[$r]=!0:At!==void 0?ji($r):De.add($r):At!==void 0&&De.has($r)?ji($r):Tt.protectedKeys[$r]=!0)}Tt.prevProp=Yt,Tt.prevResolvedValues=yn,Tt.isActive&&($e=t.__assign(t.__assign({},$e),yn)),I&&p.blockInitialAnimation&&(Xo=!1),Xo&&!nn&&we.push.apply(we,t.__spreadArray([],t.__read(Zo.map(function(ut){return{animation:ut,options:t.__assign({type:vt},Z)}})),!1))},gt=0;gt=3;if(!(!le&&!ue)){var we=ne.point,De=i.getFrameData().timestamp;I.history.push(t.__assign(t.__assign({},we),{timestamp:De}));var $e=I.handlers,tt=$e.onStart,pt=$e.onMove;le||(tt&&tt(I.lastMoveEvent,ne),I.startEvent=I.lastMoveEvent),pt&&pt(I.lastMoveEvent,ne)}}},this.handlePointerMove=function(ne,le){if(I.lastMoveEvent=ne,I.lastMoveEventInfo=wp(le,I.transformPagePoint),zt(ne)&&ne.buttons===0){I.handlePointerUp(ne,le);return}O.default.update(I.updatePoint,!0)},this.handlePointerUp=function(ne,le){I.end();var ue=I.handlers,we=ue.onEnd,De=ue.onSessionEnd,$e=_p(wp(le,I.transformPagePoint),I.history);I.startEvent&&we&&we(ne,$e),De&&De(ne,$e)},!(Or(_)&&_.touches.length>1)){this.handlers=E,this.transformPagePoint=W;var F=Dn(_),G=wp(F,this.transformPagePoint),Q=G.point,Z=i.getFrameData().timestamp;this.history=[t.__assign(t.__assign({},Q),{timestamp:Z})];var re=E.onSessionStart;re&&re(_,_p(G,this.history)),this.removeListeners=a.pipe(Po(window,"pointermove",this.handlePointerMove),Po(window,"pointerup",this.handlePointerUp),Po(window,"pointercancel",this.handlePointerUp))}}return p.prototype.updateHandlers=function(_){this.handlers=_},p.prototype.end=function(){this.removeListeners&&this.removeListeners(),i.cancelSync.update(this.updatePoint)},p}();function wp(p,_){return _?{point:_(p.point)}:p}function $b(p,_){return{x:p.x-_.x,y:p.y-_.y}}function _p(p,_){var E=p.point;return{point:E,delta:$b(E,Hb(_)),offset:$b(E,BN(_)),velocity:VN(_,.1)}}function BN(p){return p[0]}function Hb(p){return p[p.length-1]}function VN(p,_){if(p.length<2)return{x:0,y:0};for(var E=p.length-1,R=null,I=Hb(p);E>=0&&(R=p[E],!(I.timestamp-R.timestamp>it(_)));)E--;if(!R)return{x:0,y:0};var V=(I.timestamp-R.timestamp)/1e3;if(V===0)return{x:0,y:0};var W={x:(I.x-R.x)/V,y:(I.y-R.y)/V};return W.x===1/0&&(W.x=0),W.y===1/0&&(W.y=0),W}function uo(p){return p.max-p.min}function qb(p,_,E){return _===void 0&&(_=0),E===void 0&&(E=.01),a.distance(p,_)I&&(p=E?a.mix(I,p,E.max):Math.min(p,I)),p}function Qb(p,_,E){return{min:_!==void 0?p.min+_:void 0,max:E!==void 0?p.max+E-(p.max-p.min):void 0}}function $N(p,_){var E=_.top,R=_.left,I=_.bottom,V=_.right;return{x:Qb(p.x,R,V),y:Qb(p.y,E,I)}}function Xb(p,_){var E,R=_.min-p.min,I=_.max-p.max;return _.max-_.minR?E=a.progress(_.min,_.max-R,p.min):R>I&&(E=a.progress(p.min,p.max-I,_.min)),a.clamp(0,1,E)}function GN(p,_){var E={};return _.min!==void 0&&(E.min=_.min-p.min),_.max!==void 0&&(E.max=_.max-p.min),E}var Sp=.35;function KN(p){return p===void 0&&(p=Sp),p===!1?p=0:p===!0&&(p=Sp),{x:Zb(p,"left","right"),y:Zb(p,"top","bottom")}}function Zb(p,_,E){return{min:Jb(p,_),max:Jb(p,E)}}function Jb(p,_){var E;return typeof p=="number"?p:(E=p[_])!==null&&E!==void 0?E:0}var ev=function(){return{translate:0,scale:1,origin:0,originPoint:0}},Ys=function(){return{x:ev(),y:ev()}},tv=function(){return{min:0,max:0}},mr=function(){return{x:tv(),y:tv()}};function co(p){return[p("x"),p("y")]}function rv(p){var _=p.top,E=p.left,R=p.right,I=p.bottom;return{x:{min:E,max:R},y:{min:_,max:I}}}function YN(p){var _=p.x,E=p.y;return{top:E.min,right:_.max,bottom:E.max,left:_.min}}function QN(p,_){if(!_)return p;var E=_({x:p.left,y:p.top}),R=_({x:p.right,y:p.bottom});return{top:E.y,left:E.x,bottom:R.y,right:R.x}}function Cp(p){return p===void 0||p===1}function nv(p){var _=p.scale,E=p.scaleX,R=p.scaleY;return!Cp(_)||!Cp(E)||!Cp(R)}function Go(p){return nv(p)||ov(p.x)||ov(p.y)||p.z||p.rotate||p.rotateX||p.rotateY}function ov(p){return p&&p!=="0%"}function $u(p,_,E){var R=p-E,I=_*R;return E+I}function av(p,_,E,R,I){return I!==void 0&&(p=$u(p,I,R)),$u(p,E,R)+_}function Tp(p,_,E,R,I){_===void 0&&(_=0),E===void 0&&(E=1),p.min=av(p.min,_,E,R,I),p.max=av(p.max,_,E,R,I)}function iv(p,_){var E=_.x,R=_.y;Tp(p.x,E.translate,E.scale,E.originPoint),Tp(p.y,R.translate,R.scale,R.originPoint)}function XN(p,_,E,R){var I,V;R===void 0&&(R=!1);var W=E.length;if(W){_.x=_.y=1;for(var F,G,Q=0;Q_?E="y":Math.abs(p.x)>_&&(E="x"),E}function oE(p){var _=p.dragControls,E=p.visualElement,R=ye(function(){return new rE(E)});r.useEffect(function(){return _&&_.subscribe(R)},[R,_]),r.useEffect(function(){return R.addListeners()},[R])}function aE(p){var _=p.onPan,E=p.onPanStart,R=p.onPanEnd,I=p.onPanSessionStart,V=p.visualElement,W=_||E||R||I,F=r.useRef(null),G=r.useContext(v).transformPagePoint,Q={onSessionStart:I,onStart:E,onMove:_,onEnd:function(re,ne){F.current=null,R&&R(re,ne)}};r.useEffect(function(){F.current!==null&&F.current.updateHandlers(Q)});function Z(re){F.current=new Wb(re,Q,{transformPagePoint:G})}Ti(V,"pointerdown",W&&Z),Oi(function(){return F.current&&F.current.end()})}var uv={pan:lo(aE),drag:lo(oE)},qu=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function iE(){var p=qu.map(function(){return new Hs}),_={},E={clearAllListeners:function(){return p.forEach(function(R){return R.clear()})},updatePropListeners:function(R){qu.forEach(function(I){var V,W="on"+I,F=R[W];(V=_[I])===null||V===void 0||V.call(_),F&&(_[I]=E[W](F))})}};return p.forEach(function(R,I){E["on"+qu[I]]=function(V){return R.add(V)},E["notify"+qu[I]]=function(){for(var V=[],W=0;W=0?window.pageYOffset:null,Q=bE(_,p,F);return V.length&&V.forEach(function(Z){var re=t.__read(Z,2),ne=re[0],le=re[1];p.getValue(ne).set(le)}),p.syncRender(),G!==null&&window.scrollTo({top:G}),{target:Q,transitionEnd:R}}else return{target:_,transitionEnd:R}};function yE(p,_,E,R){return pE(_)?vE(p,_,E,R):{target:_,transitionEnd:R}}var xE=function(p,_,E,R){var I=dE(p,_,R);return _=I.target,R=I.transitionEnd,yE(p,_,E,R)};function wE(p){return window.getComputedStyle(p)}var vv={treeType:"dom",readValueFromInstance:function(p,_){if(ge(_)){var E=lp(_);return E&&E.default||0}else{var R=wE(p);return(Ue(_)?R.getPropertyValue(_):R[_])||0}},sortNodePosition:function(p,_){return p.compareDocumentPosition(_)&2?1:-1},getBaseTarget:function(p,_){var E;return(E=p.style)===null||E===void 0?void 0:E[_]},measureViewportBox:function(p,_){var E=_.transformPagePoint;return lv(p,E)},resetTransform:function(p,_,E){var R=E.transformTemplate;_.style.transform=R?R({},""):"none",p.scheduleRender()},restoreTransform:function(p,_){p.style.transform=_.style.transform},removeValueFromRenderState:function(p,_){var E=_.vars,R=_.style;delete E[p],delete R[p]},makeTargetAnimatable:function(p,_,E,R){var I=E.transformValues;R===void 0&&(R=!0);var V=_.transition,W=_.transitionEnd,F=t.__rest(_,["transition","transitionEnd"]),G=Vb(F,V||{},p);if(I&&(W&&(W=I(W)),F&&(F=I(F)),G&&(G=I(G))),R){bp(p,F,G);var Q=xE(p,F,G,W);W=Q.transitionEnd,F=Q.target}return t.__assign({transition:V,transitionEnd:W},F)},scrapeMotionValuesFromProps:gr,build:function(p,_,E,R,I){p.isVisible!==void 0&&(_.style.visibility=p.isVisible?"visible":"hidden"),dt(_,E,R,I.transformTemplate)},render:kt},_E=Gu(vv),SE=Gu(t.__assign(t.__assign({},vv),{getBaseTarget:function(p,_){return p[_]},readValueFromInstance:function(p,_){var E;return ge(_)?((E=lp(_))===null||E===void 0?void 0:E.default)||0:(_=Rn.has(_)?_:or(_),p.getAttribute(_))},scrapeMotionValuesFromProps:Mn,build:function(p,_,E,R,I){Ae(_,E,R,I.transformTemplate)},render:Ir})),kp=function(p,_){return ht(p)?SE(_,{enableHardwareAcceleration:!1}):_E(_,{enableHardwareAcceleration:!0})};function yv(p,_){return _.max===_.min?0:p/(_.max-_.min)*100}var Qs={correct:function(p,_){if(!_.target)return p;if(typeof p=="string")if(o.px.test(p))p=parseFloat(p);else return p;var E=yv(p,_.target.x),R=yv(p,_.target.y);return"".concat(E,"% ").concat(R,"%")}},xv="_$css",CE={correct:function(p,_){var E=_.treeScale,R=_.projectionDelta,I=p,V=p.includes("var("),W=[];V&&(p=p.replace(dv,function(we){return W.push(we),xv}));var F=o.complex.parse(p);if(F.length>5)return I;var G=o.complex.createTransformer(p),Q=typeof F[0]!="number"?1:0,Z=R.x.scale*E.x,re=R.y.scale*E.y;F[0+Q]/=Z,F[1+Q]/=re;var ne=a.mix(Z,re,.5);typeof F[2+Q]=="number"&&(F[2+Q]/=ne),typeof F[3+Q]=="number"&&(F[3+Q]/=ne);var le=G(F);if(V){var ue=0;le=le.replace(xv,function(){var we=W[ue];return ue++,we})}return le}},TE=function(p){t.__extends(_,p);function _(){return p!==null&&p.apply(this,arguments)||this}return _.prototype.componentDidMount=function(){var E=this,R=this.props,I=R.visualElement,V=R.layoutGroup,W=R.switchLayoutGroup,F=R.layoutId,G=I.projection;ot(PE),G&&(V!=null&&V.group&&V.group.add(G),W!=null&&W.register&&F&&W.register(G),G.root.didUpdate(),G.addEventListener("animationComplete",function(){E.safeToRemove()}),G.setOptions(t.__assign(t.__assign({},G.options),{onExitComplete:function(){return E.safeToRemove()}}))),Pe.hasEverUpdated=!0},_.prototype.getSnapshotBeforeUpdate=function(E){var R=this,I=this.props,V=I.layoutDependency,W=I.visualElement,F=I.drag,G=I.isPresent,Q=W.projection;return Q&&(Q.isPresent=G,F||E.layoutDependency!==V||V===void 0?Q.willUpdate():this.safeToRemove(),E.isPresent!==G&&(G?Q.promote():Q.relegate()||O.default.postRender(function(){var Z;!((Z=Q.getStack())===null||Z===void 0)&&Z.members.length||R.safeToRemove()}))),null},_.prototype.componentDidUpdate=function(){var E=this.props.visualElement.projection;E&&(E.root.didUpdate(),!E.currentAnimation&&E.isLead()&&this.safeToRemove())},_.prototype.componentWillUnmount=function(){var E=this.props,R=E.visualElement,I=E.layoutGroup,V=E.switchLayoutGroup,W=R.projection;W&&(W.scheduleCheckAfterUnmount(),I!=null&&I.group&&I.group.remove(W),V!=null&&V.deregister&&V.deregister(W))},_.prototype.safeToRemove=function(){var E=this.props.safeToRemove;E==null||E()},_.prototype.render=function(){return null},_}(S.default.Component);function OE(p){var _=t.__read(xe(),2),E=_[0],R=_[1],I=r.useContext(ce);return S.default.createElement(TE,t.__assign({},p,{layoutGroup:I,switchLayoutGroup:r.useContext(je),isPresent:E,safeToRemove:R}))}var PE={borderRadius:t.__assign(t.__assign({},Qs),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Qs,borderTopRightRadius:Qs,borderBottomLeftRadius:Qs,borderBottomRightRadius:Qs,boxShadow:CE},wv={measureLayout:OE};function _v(p,_,E){E===void 0&&(E={});var R=ie(p)?p:bn(p);return fp("",R,_,E),{stop:function(){return R.stop()},isAnimating:function(){return R.isAnimating()}}}var Sv=["TopLeft","TopRight","BottomLeft","BottomRight"],kE=Sv.length,Cv=function(p){return typeof p=="string"?parseFloat(p):p},Tv=function(p){return typeof p=="number"||o.px.test(p)};function NE(p,_,E,R,I,V){var W,F,G,Q;I?(p.opacity=a.mix(0,(W=E.opacity)!==null&&W!==void 0?W:1,EE(R)),p.opacityExit=a.mix((F=_.opacity)!==null&&F!==void 0?F:1,0,jE(R))):V&&(p.opacity=a.mix((G=_.opacity)!==null&&G!==void 0?G:1,(Q=E.opacity)!==null&&Q!==void 0?Q:1,R));for(var Z=0;Z_?1:E(a.progress(p,_,R))}}function kv(p,_){p.min=_.min,p.max=_.max}function Fn(p,_){kv(p.x,_.x),kv(p.y,_.y)}function Nv(p,_,E,R,I){return p-=_,p=$u(p,1/E,R),I!==void 0&&(p=$u(p,1/I,R)),p}function AE(p,_,E,R,I,V,W){if(_===void 0&&(_=0),E===void 0&&(E=1),R===void 0&&(R=.5),V===void 0&&(V=p),W===void 0&&(W=p),o.percent.test(_)){_=parseFloat(_);var F=a.mix(W.min,W.max,_/100);_=F-W.min}if(typeof _=="number"){var G=a.mix(V.min,V.max,R);p===V&&(G-=_),p.min=Nv(p.min,_,E,G,I),p.max=Nv(p.max,_,E,G,I)}}function Ev(p,_,E,R,I){var V=t.__read(E,3),W=V[0],F=V[1],G=V[2];AE(p,_[W],_[F],_[G],_.scale,R,I)}var RE=["x","scaleX","originX"],ME=["y","scaleY","originY"];function jv(p,_,E,R){Ev(p.x,_,RE,E==null?void 0:E.x,R==null?void 0:R.x),Ev(p.y,_,ME,E==null?void 0:E.y,R==null?void 0:R.y)}function Av(p){return p.translate===0&&p.scale===1}function Rv(p){return Av(p.x)&&Av(p.y)}function Mv(p,_){return p.x.min===_.x.min&&p.x.max===_.x.max&&p.y.min===_.y.min&&p.y.max===_.y.max}var IE=function(){function p(){this.members=[]}return p.prototype.add=function(_){pp(this.members,_),_.scheduleRender()},p.prototype.remove=function(_){if(hp(this.members,_),_===this.prevLead&&(this.prevLead=void 0),_===this.lead){var E=this.members[this.members.length-1];E&&this.promote(E)}},p.prototype.relegate=function(_){var E=this.members.findIndex(function(W){return _===W});if(E===0)return!1;for(var R,I=E;I>=0;I--){var V=this.members[I];if(V.isPresent!==!1){R=V;break}}return R?(this.promote(R),!0):!1},p.prototype.promote=function(_,E){var R,I=this.lead;if(_!==I&&(this.prevLead=I,this.lead=_,_.show(),I)){I.instance&&I.scheduleRender(),_.scheduleRender(),_.resumeFrom=I,E&&(_.resumeFrom.preserveOpacity=!0),I.snapshot&&(_.snapshot=I.snapshot,_.snapshot.latestValues=I.animationValues||I.latestValues,_.snapshot.isShared=!0),!((R=_.root)===null||R===void 0)&&R.isUpdating&&(_.isLayoutDirty=!0);var V=_.options.crossfade;V===!1&&I.hide()}},p.prototype.exitAnimationComplete=function(){this.members.forEach(function(_){var E,R,I,V,W;(R=(E=_.options).onExitComplete)===null||R===void 0||R.call(E),(W=(I=_.resumingFrom)===null||I===void 0?void 0:(V=I.options).onExitComplete)===null||W===void 0||W.call(V)})},p.prototype.scheduleRender=function(){this.members.forEach(function(_){_.instance&&_.scheduleRender(!1)})},p.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},p}(),DE="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function Iv(p,_,E){var R=p.x.translate/_.x,I=p.y.translate/_.y,V="translate3d(".concat(R,"px, ").concat(I,"px, 0) ");if(V+="scale(".concat(1/_.x,", ").concat(1/_.y,") "),E){var W=E.rotate,F=E.rotateX,G=E.rotateY;W&&(V+="rotate(".concat(W,"deg) ")),F&&(V+="rotateX(".concat(F,"deg) ")),G&&(V+="rotateY(".concat(G,"deg) "))}var Q=p.x.scale*_.x,Z=p.y.scale*_.y;return V+="scale(".concat(Q,", ").concat(Z,")"),V===DE?"none":V}var LE=function(p,_){return p.depth-_.depth},Dv=function(){function p(){this.children=[],this.isDirty=!1}return p.prototype.add=function(_){pp(this.children,_),this.isDirty=!0},p.prototype.remove=function(_){hp(this.children,_),this.isDirty=!0},p.prototype.forEach=function(_){this.isDirty&&this.children.sort(LE),this.isDirty=!1,this.children.forEach(_)},p}(),Lv=1e3;function Fv(p){var _=p.attachResizeListener,E=p.defaultParent,R=p.measureScroll,I=p.checkIsScrollRoot,V=p.resetTransform;return function(){function W(F,G,Q){var Z=this;G===void 0&&(G={}),Q===void 0&&(Q=E==null?void 0:E()),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(){Z.isUpdating&&(Z.isUpdating=!1,Z.clearAllSnapshots())},this.updateProjection=function(){Z.nodes.forEach(WE),Z.nodes.forEach($E)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=F,this.latestValues=G,this.root=Q?Q.root||Q:this,this.path=Q?t.__spreadArray(t.__spreadArray([],t.__read(Q.path),!1),[Q],!1):[],this.parent=Q,this.depth=Q?Q.depth+1:0,F&&this.root.registerPotentialNode(F,this);for(var re=0;re=0;R--)if(p.path[R].instance){E=p.path[R];break}var I=E&&E!==p.root?E.instance:document,V=I.querySelector('[data-projection-id="'.concat(_,'"]'));V&&p.mount(V,!0)}function Uv(p){p.min=Math.round(p.min),p.max=Math.round(p.max)}function Wv(p){Uv(p.x),Uv(p.y)}var XE=Fv({attachResizeListener:function(p,_){return mn(p,"resize",_)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),Va={current:void 0},Np=Fv({measureScroll:function(p){return{x:p.scrollLeft,y:p.scrollTop}},defaultParent:function(){if(!Va.current){var p=new XE(0,{});p.mount(window),p.setOptions({layoutScroll:!0}),Va.current=p}return Va.current},resetTransform:function(p,_){p.style.transform=_??"none"},checkIsScrollRoot:function(p){return window.getComputedStyle(p).position==="fixed"}}),$v=t.__assign(t.__assign(t.__assign(t.__assign({},xp),Ws),uv),wv),Ep=Ge(function(p,_){return Ia(p,_,$v,kp,Np)});function ZE(p){return Je(Ia(p,{forwardMotionProps:!1},$v,kp,Np))}var JE=Ge(Ia);function Hv(){var p=r.useRef(!1);return A(function(){return p.current=!0,function(){p.current=!1}},[]),p}function Yu(){var p=Hv(),_=t.__read(r.useState(0),2),E=_[0],R=_[1],I=r.useCallback(function(){p.current&&R(E+1)},[E]),V=r.useCallback(function(){return O.default.postRender(I)},[I]);return[V,E]}var jp=function(p){var _=p.children,E=p.initial,R=p.isPresent,I=p.onExitComplete,V=p.custom,W=p.presenceAffectsLayout,F=ye(ej),G=$s(),Q=r.useMemo(function(){return{id:G,initial:E,isPresent:R,custom:V,onExitComplete:function(Z){var re,ne;F.set(Z,!0);try{for(var le=t.__values(F.values()),ue=le.next();!ue.done;ue=le.next()){var we=ue.value;if(!we)return}}catch(De){re={error:De}}finally{try{ue&&!ue.done&&(ne=le.return)&&ne.call(le)}finally{if(re)throw re.error}}I==null||I()},register:function(Z){return F.set(Z,!1),function(){return F.delete(Z)}}}},W?void 0:[R]);return r.useMemo(function(){F.forEach(function(Z,re){return F.set(re,!1)})},[R]),b.useEffect(function(){!R&&!F.size&&(I==null||I())},[R]),b.createElement(N.Provider,{value:Q},_)};function ej(){return new Map}var Ni=function(p){return p.key||""};function tj(p,_){p.forEach(function(E){var R=Ni(E);_.set(R,E)})}function rj(p){var _=[];return r.Children.forEach(p,function(E){r.isValidElement(E)&&_.push(E)}),_}var nj=function(p){var _=p.children,E=p.custom,R=p.initial,I=R===void 0?!0:R,V=p.onExitComplete,W=p.exitBeforeEnter,F=p.presenceAffectsLayout,G=F===void 0?!0:F,Q=t.__read(Yu(),1),Z=Q[0],re=r.useContext(ce).forceRender;re&&(Z=re);var ne=Hv(),le=rj(_),ue=le,we=new Set,De=r.useRef(ue),$e=r.useRef(new Map).current,tt=r.useRef(!0);if(A(function(){tt.current=!1,tj(le,$e),De.current=ue}),Oi(function(){tt.current=!0,$e.clear(),we.clear()}),tt.current)return b.createElement(b.Fragment,null,ue.map(function(vt){return b.createElement(jp,{key:Ni(vt),isPresent:!0,initial:I?void 0:!1,presenceAffectsLayout:G},vt)}));ue=t.__spreadArray([],t.__read(ue),!1);for(var pt=De.current.map(Ni),gt=le.map(Ni),bt=pt.length,Lt=0;Lt1&&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,we.size?ue:ue.map(function(vt){return r.cloneElement(vt)}))},qv=r.createContext(null),oj=function(p){return!p.isLayoutDirty&&p.willUpdate(!1)};function Gv(){var p=new Set,_=new WeakMap,E=function(){return p.forEach(oj)};return{add:function(R){p.add(R),_.set(R,R.addEventListener("willUpdate",E))},remove:function(R){var I;p.delete(R),(I=_.get(R))===null||I===void 0||I(),_.delete(R),E()},dirty:E}}var Kv=function(p){return p===!0},aj=function(p){return Kv(p===!0)||p==="id"},Yv=function(p){var _,E,R=p.children,I=p.id,V=p.inheritId,W=p.inherit,F=W===void 0?!0:W;V!==void 0&&(F=V);var G=r.useContext(ce),Q=r.useContext(qv),Z=t.__read(Yu(),2),re=Z[0],ne=Z[1],le=r.useRef(null),ue=(_=G.id)!==null&&_!==void 0?_:Q;le.current===null&&(aj(F)&&ue&&(I=I?ue+"-"+I:ue),le.current={id:I,group:Kv(F)&&(E=G==null?void 0:G.group)!==null&&E!==void 0?E:Gv()});var we=r.useMemo(function(){return t.__assign(t.__assign({},le.current),{forceRender:re})},[ne]);return b.createElement(ce.Provider,{value:we},R)},ij=0,sj=function(p){var _=p.children;return b.useEffect(function(){n.warning(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),b.createElement(Yv,{id:ye(function(){return"asl-".concat(ij++)})},_)};function lj(p){var _=p.children,E=p.isValidProp,R=t.__rest(p,["children","isValidProp"]);E&&jn(E),R=t.__assign(t.__assign({},r.useContext(v)),R),R.isStatic=ye(function(){return R.isStatic});var I=r.useMemo(function(){return R},[JSON.stringify(R.transition),R.transformPagePoint,R.reducedMotion]);return b.createElement(v.Provider,{value:I},_)}function uj(p){var _=p.children,E=p.features,R=p.strict,I=R===void 0?!1:R,V=t.__read(r.useState(!Ap(E)),2),W=V[1],F=r.useRef(void 0);if(!Ap(E)){var G=E.renderer,Q=t.__rest(E,["renderer"]);F.current=G,d(Q)}return r.useEffect(function(){Ap(E)&&E().then(function(Z){var re=Z.renderer,ne=t.__rest(Z,["renderer"]);d(ne),F.current=re,W(!0)})},[]),b.createElement(s.Provider,{value:{renderer:F.current,strict:I}},_)}function Ap(p){return typeof p=="function"}var Qv=r.createContext(null);function cj(p,_,E,R){if(!R)return p;var I=p.findIndex(function(Z){return Z.value===_});if(I===-1)return p;var V=R>0?1:-1,W=p[I+V];if(!W)return p;var F=p[I],G=W.layout,Q=a.mix(G.min,G.max,.5);return V===1&&F.layout.max+E>Q||V===-1&&F.layout.min+E.001?1/p:Uj},ly=!1;function Wj(p){var _=Yo(1),E=Yo(1),R=j();n.invariant(!!(p||R),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),n.warning(ly,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),ly=!0,p?(_=p.scaleX||_,E=p.scaleY||E):R&&(_=R.getValue("scaleX",1),E=R.getValue("scaleY",1));var I=Qu(_,sy),V=Qu(E,sy);return{scaleX:I,scaleY:V}}e.AnimatePresence=nj,e.AnimateSharedLayout=sj,e.DeprecatedLayoutGroupContext=qv,e.DragControls=ay,e.FlatTree=Dv,e.LayoutGroup=Yv,e.LayoutGroupContext=ce,e.LazyMotion=uj,e.MotionConfig=lj,e.MotionConfigContext=v,e.MotionContext=w,e.MotionValue=Fb,e.PresenceContext=N,e.Reorder=wj,e.SwitchLayoutGroupContext=je,e.addPointerEvent=Po,e.addScaleCorrector=ot,e.animate=_v,e.animateVisualElement=Wu,e.animationControls=ny,e.animations=xp,e.calcLength=uo,e.checkTargetForNewValues=bp,e.createBox=mr,e.createDomMotionComponent=ZE,e.createMotionComponent=Je,e.domAnimation=ty,e.domMax=_j,e.filterProps=Mr,e.isBrowser=k,e.isDragActive=Vs,e.isMotionValue=ie,e.isValidMotionProp=ir,e.m=JE,e.makeUseVisualState=Oo,e.motion=Ep,e.motionValue=bn,e.resolveMotionValue=ao,e.transform=Xv,e.useAnimation=jj,e.useAnimationControls=oy,e.useAnimationFrame=ry,e.useCycle=Aj,e.useDeprecatedAnimatedState=Vj,e.useDeprecatedInvertedScale=Wj,e.useDomEvent=jt,e.useDragControls=Ij,e.useElementScroll=Pj,e.useForceUpdate=Yu,e.useInView=Rj,e.useInstantLayoutTransition=iy,e.useInstantTransition=Lj,e.useIsPresent=Le,e.useIsomorphicLayoutEffect=A,e.useMotionTemplate=Sj,e.useMotionValue=Yo,e.usePresence=xe,e.useReducedMotion=B,e.useReducedMotionConfig=U,e.useResetProjection=Fj,e.useScroll=Rp,e.useSpring=Cj,e.useTime=Ej,e.useTransform=Qu,e.useUnmountEffect=Oi,e.useVelocity=Tj,e.useViewportScroll=kj,e.useVisualElementContext=j,e.visualElement=Gu,e.wrapHandler=_i})(xr);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{AccordionBody:function(){return x},default:function(){return m}});var r=O(P),n=xr,o=O(ct),a=O(Tr),i=O(et),c=rt,f=kf,g=Ze,b=bu;function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.className,l=d.children,h=T(d,["className","children"]),v=(0,f.useAccordion)(),w=v.open,j=v.animate,N=(0,g.useTheme)().accordion,k=N.styles.base;u=u??"";var A=(0,c.twMerge)((0,o.default)((0,i.default)(k.body)),u),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,j);return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(n.m.div,{className:"overflow-hidden",initial:"unmount",exit:"unmount",animate:w?"mount":"unmount",variants:M},r.default.createElement(n.m.div,S({},h,{ref:s,className:A,initial:"unmount",exit:"unmount",animate:w?"mount":"unmount",variants:L}),l)))});x.propTypes={className:b.propTypesClassName,children:b.propTypesChildren},x.displayName="MaterialTailwind.AccordionBody";var m=x})(ST);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Accordion:function(){return m},AccordionHeader:function(){return g.AccordionHeader},AccordionBody:function(){return b.AccordionBody},useAccordion:function(){return c.useAccordion},default:function(){return d}});var r=T(P),n=T(ct),o=rt,a=T(et),i=Ze,c=kf,f=bu,g=_T,b=ST;function S(s,u,l){return u in s?Object.defineProperty(s,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[u]=l,s}function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.open,h=s.icon,v=s.animate,w=s.className,j=s.disabled,N=s.children,k=C(s,["open","icon","animate","className","disabled","children"]),A=(0,i.useTheme)().accordion,M=A.defaultProps,D=A.styles.base;h=h??M.icon,v=v??M.animate,w=w??M.className,j=j??M.disabled;var L=(0,o.twMerge)((0,n.default)((0,a.default)(D.container),S({},(0,a.default)(D.disabled),j)),w),B=r.default.useMemo(function(){return{open:l,icon:h,animate:v,disabled:j}},[l,h,v,j]);return r.default.createElement(c.AccordionContextProvider,{value:B},r.default.createElement("div",O({},k,{ref:u,className:L}),N))});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})})(X5);var QO={},Xt={};(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(c){return c===o});return i>=0?o:a}var r=t})(Xt);var Bf={},js=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,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{IconButton:function(){return x},default:function(){return m}});var r=O(P),n=O(nt),o=O(js),a=O(ct),i=rt,c=O(Xt),f=O(et),g=Ze,b=hi;function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.variant,l=d.size,h=d.color,v=d.ripple,w=d.className,j=d.children;d.fullWidth;var N=T(d,["variant","size","color","ripple","className","children","fullWidth"]),k=(0,g.useTheme)().iconButton,A=k.valid,M=k.defaultProps,D=k.styles,L=D.base,B=D.variants,U=D.sizes;u=u??M.variant,l=l??M.size,h=h??M.color,v=v??M.ripple,w=w??M.className;var Y=v!==void 0&&new o.default,q=(0,f.default)(L),z=(0,f.default)(B[(0,c.default)(A.variants,u,"filled")][(0,c.default)(A.colors,h,"gray")]),$=(0,f.default)(U[(0,c.default)(A.sizes,l,"md")]),K=(0,i.twMerge)((0,a.default)(q,$,z),w);return r.default.createElement("button",S({},N,{ref:s,className:K,type:N.type||"button",onMouseDown:function(X){var te=N==null?void 0:N.onMouseDown;return v&&Y.create(X,(u==="filled"||u==="gradient")&&h!=="white"?"light":"dark"),typeof te=="function"&&te(X)}}),r.default.createElement("span",{className:"absolute top-1/2 left-1/2 transform -translate-y-1/2 -translate-x-1/2"},j))});x.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},x.displayName="MaterialTailwind.IconButton";var m=x})(Bf);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,l){for(var h in l)Object.defineProperty(u,h,{enumerable:!0,get:l[h]})}t(e,{Alert:function(){return d},default:function(){return s}});var r=C(P),n=C(nt),o=xr,a=C(ct),i=C(Tr),c=rt,f=C(Xt),g=C(et),b=Ze,S=Tm,O=C(Bf);function T(){return T=Object.assign||function(u){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(u,v)&&(h[v]=u[v])}return h}function m(u,l){if(u==null)return{};var h={},v=Object.keys(u),w,j;for(j=0;j=0)&&(h[w]=u[w]);return h}var d=r.default.forwardRef(function(u,l){var h=u.variant,v=u.color,w=u.icon,j=u.open,N=u.action,k=u.onClose,A=u.animate,M=u.className,D=u.children,L=x(u,["variant","color","icon","open","action","onClose","animate","className","children"]),B=(0,b.useTheme)().alert,U=B.defaultProps,Y=B.valid,q=B.styles,z=q.base,$=q.variants;h=h??U.variant,v=v??U.color,M=M??U.className,A=A??U.animate,j=j??U.open,N=N??U.action,k=k??U.onClose;var K=(0,g.default)(z.alert),X=(0,g.default)(z.action),te=(0,g.default)($[(0,f.default)(Y.variants,h,"filled")][(0,f.default)(Y.colors,v,"gray")]),me=(0,c.twMerge)((0,a.default)(K,te),M),de=(0,a.default)(X),ee={unmount:{opacity:0},mount:{opacity:1}},Se=(0,i.default)(ee,A),pe=r.default.createElement("div",{className:"shrink-0"},w),fe=o.AnimatePresence;return r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(fe,null,j&&r.default.createElement(o.m.div,T({},L,{ref:l,role:"alert",className:"".concat(me," flex"),initial:"unmount",exit:"unmount",animate:j?"mount":"unmount",variants:Se}),w&&pe,r.default.createElement("div",{className:"".concat(w?"ml-3":""," mr-12")},D),k&&!N&&r.default.createElement(O.default,{onClick:k,size:"sm",variant:"text",color:h==="outlined"||h==="ghost"?v:"white",className:de},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"}))),N||null)))});d.propTypes={variant:n.default.oneOf(S.propTypesVariant),color:n.default.oneOf(S.propTypesColor),icon:S.propTypesIcon,open:S.propTypesOpen,action:S.propTypesAction,onClose:S.propTypesOnClose,animate:S.propTypesAnimate,className:S.propTypesClassName,children:S.propTypesChildren},d.displayName="MaterialTailwind.Alert";var s=d})(QO);var XO={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{Avatar:function(){return x},default:function(){return m}});var r=O(P),n=O(nt),o=O(ct),a=rt,i=O(Xt),c=O(et),f=Ze,g=Om;function b(d,s,u){return s in d?Object.defineProperty(d,s,{value:u,enumerable:!0,configurable:!0,writable:!0}):d[s]=u,d}function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.variant,l=d.size,h=d.className,v=d.color,w=d.withBorder,j=T(d,["variant","size","className","color","withBorder"]),N=(0,f.useTheme)().avatar,k=N.valid,A=N.defaultProps,M=N.styles,D=M.base,L=M.variants,B=M.sizes,U=M.borderColor;u=u??A.variant,l=l??A.size,h=h??A.className,w=w??A.withBorder,v=v??A.color;var Y=(0,c.default)(L[(0,i.default)(k.variants,u,"rounded")]),q=(0,c.default)(B[(0,i.default)(k.sizes,l,"md")]),z=(0,c.default)(U[(0,i.default)(k.colors,v,"gray")]),$,K=(0,a.twMerge)((0,o.default)((0,c.default)(D.initial),Y,q,($={},b($,(0,c.default)(D.withBorder),w),b($,z,w),$)),h);return r.default.createElement("img",S({},j,{ref:s,className:K}))});x.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)},x.displayName="MaterialTailwind.Avatar";var m=x})(XO);var ZO={},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 c}});var r=n(nt);function n(f){return f&&f.__esModule?f:{default:f}}var o=r.default.node,a=r.default.bool,i=r.default.string,c=r.default.node.isRequired})(JO);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{Breadcrumbs:function(){return x},default:function(){return m}});var r=O(P),n=b(ct),o=rt,a=b(et),i=Ze,c=JO;function f(d,s,u){return s in d?Object.defineProperty(d,s,{value:u,enumerable:!0,configurable:!0,writable:!0}):d[s]=u,d}function g(){return g=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=(0,r.forwardRef)(function(d,s){var u=d.separator,l=d.fullWidth,h=d.className,v=d.children,w=T(d,["separator","fullWidth","className","children"]),j=(0,i.useTheme)().breadcrumbs,N=j.defaultProps,k=j.styles.base;u=u??N.separator,l=l??N.fullWidth,h=h??N.className;var A=(0,n.default)((0,a.default)(k.root.initial),f({},(0,a.default)(k.root.fullWidth),l)),M=(0,o.twMerge)((0,n.default)((0,a.default)(k.list)),h),D=(0,n.default)((0,a.default)(k.item.initial)),L=(0,n.default)((0,a.default)(k.separator));return r.default.createElement("nav",{"aria-label":"breadcrumb",className:A},r.default.createElement("ol",g({},w,{ref:s,className:M}),r.Children.map(v,function(B,U){if((0,r.isValidElement)(B)){var Y;return r.default.createElement("li",{className:(0,n.default)(D,f({},(0,a.default)(k.item.disabled),B==null||(Y=B.props)===null||Y===void 0?void 0:Y.disabled))},B,U!==r.Children.count(v)-1&&r.default.createElement("span",{className:L},u))}return null})))});x.propTypes={separator:c.propTypesSeparator,fullWidth:c.propTypesFullWidth,className:c.propTypesClassName,children:c.propTypesChildren},x.displayName="MaterialTailwind.Breadcrumbs";var m=x})(ZO);var eP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Button:function(){return m},default:function(){return d}});var r=T(P),n=T(nt),o=T(js),a=T(ct),i=rt,c=T(Xt),f=T(et),g=Ze,b=hi;function S(s,u,l){return u in s?Object.defineProperty(s,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[u]=l,s}function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.variant,h=s.size,v=s.color,w=s.fullWidth,j=s.ripple,N=s.className,k=s.children,A=C(s,["variant","size","color","fullWidth","ripple","className","children"]),M=(0,g.useTheme)().button,D=M.valid,L=M.defaultProps,B=M.styles,U=B.base,Y=B.variants,q=B.sizes;l=l??L.variant,h=h??L.size,v=v??L.color,w=w??L.fullWidth,j=j??L.ripple,N=N??L.className;var z=j!==void 0&&new o.default,$=(0,f.default)(U.initial),K=(0,f.default)(Y[(0,c.default)(D.variants,l,"filled")][(0,c.default)(D.colors,v,"gray")]),X=(0,f.default)(q[(0,c.default)(D.sizes,h,"md")]),te=(0,i.twMerge)((0,a.default)($,X,K,S({},(0,f.default)(U.fullWidth),w)),N);return r.default.createElement("button",O({},A,{ref:u,className:te,type:A.type||"button",onMouseDown:function(me){var de=A==null?void 0:A.onMouseDown;return j&&z.create(me,(l==="filled"||l==="gradient")&&v!=="white"?"light":"dark"),typeof de=="function"&&de(me)}}),k)});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})(eP);var tP={},rP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{CardHeader:function(){return x},default:function(){return m}});var r=O(P),n=O(nt),o=O(ct),a=rt,i=O(Xt),c=O(et),f=Ze,g=gi;function b(d,s,u){return s in d?Object.defineProperty(d,s,{value:u,enumerable:!0,configurable:!0,writable:!0}):d[s]=u,d}function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.variant,l=d.color,h=d.shadow,v=d.floated,w=d.className,j=d.children,N=T(d,["variant","color","shadow","floated","className","children"]),k=(0,f.useTheme)().cardHeader,A=k.defaultProps,M=k.styles,D=k.valid,L=M.base,B=M.variants;u=u??A.variant,l=l??A.color,h=h??A.shadow,v=v??A.floated,w=w??A.className;var U=(0,c.default)(L.initial),Y=(0,c.default)(B[(0,i.default)(D.variants,u,"filled")][(0,i.default)(D.colors,l,"white")]),q=(0,a.twMerge)((0,o.default)(U,Y,b({},(0,c.default)(L.shadow),h),b({},(0,c.default)(L.floated),v)),w);return r.default.createElement("div",S({},N,{ref:s,className:q}),j)});x.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},x.displayName="MaterialTailwind.CardHeader";var m=x})(rP);var nP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,x){for(var m in x)Object.defineProperty(C,m,{enumerable:!0,get:x[m]})}t(e,{CardBody:function(){return O},default:function(){return T}});var r=g(P),n=g(ct),o=rt,a=g(et),i=Ze,c=gi;function f(){return f=Object.assign||function(C){for(var x=1;x=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function S(C,x){if(C==null)return{};var m={},d=Object.keys(C),s,u;for(u=0;u=0)&&(m[s]=C[s]);return m}var O=r.default.forwardRef(function(C,x){var m=C.className,d=C.children,s=b(C,["className","children"]),u=(0,i.useTheme)().cardBody,l=u.defaultProps,h=u.styles.base;m=m??l.className;var v=(0,o.twMerge)((0,n.default)((0,a.default)(h)),m);return r.default.createElement("div",f({},s,{ref:x,className:v}),d)});O.propTypes={className:c.propTypesClassName,children:c.propTypesChildren},O.displayName="MaterialTailwind.CardBody";var T=O})(nP);var oP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(x,m){for(var d in m)Object.defineProperty(x,d,{enumerable:!0,get:m[d]})}t(e,{CardFooter:function(){return T},default:function(){return C}});var r=b(P),n=b(ct),o=rt,a=b(et),i=Ze,c=gi;function f(x,m,d){return m in x?Object.defineProperty(x,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):x[m]=d,x}function g(){return g=Object.assign||function(x){for(var m=1;m=0)&&Object.prototype.propertyIsEnumerable.call(x,s)&&(d[s]=x[s])}return d}function O(x,m){if(x==null)return{};var d={},s=Object.keys(x),u,l;for(l=0;l=0)&&(d[u]=x[u]);return d}var T=r.default.forwardRef(function(x,m){var d=x.divider,s=x.className,u=x.children,l=S(x,["divider","className","children"]),h=(0,i.useTheme)().cardFooter,v=h.defaultProps,w=h.styles.base;s=s??v.className,d=d??v.divider;var j=(0,o.twMerge)((0,n.default)((0,a.default)(w.initial),f({},(0,a.default)(w.divider),d)),s);return r.default.createElement("div",g({},l,{ref:m,className:j}),u)});T.propTypes={divider:c.propTypesDivider,className:c.propTypesClassName,children:c.propTypesChildren},T.displayName="MaterialTailwind.CardFooter";var C=T})(oP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,h){for(var v in h)Object.defineProperty(l,v,{enumerable:!0,get:h[v]})}t(e,{Card:function(){return s},CardHeader:function(){return g.CardHeader},CardBody:function(){return b.CardBody},CardFooter:function(){return S.CardFooter},default:function(){return u}});var r=x(P),n=x(nt),o=x(ct),a=rt,i=x(Xt),c=x(et),f=Ze,g=rP,b=nP,S=oP,O=gi;function T(l,h,v){return h in l?Object.defineProperty(l,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[h]=v,l}function C(){return C=Object.assign||function(l){for(var h=1;h=0)&&Object.prototype.propertyIsEnumerable.call(l,w)&&(v[w]=l[w])}return v}function d(l,h){if(l==null)return{};var v={},w=Object.keys(l),j,N;for(N=0;N=0)&&(v[j]=l[j]);return v}var s=r.default.forwardRef(function(l,h){var v=l.variant,w=l.color,j=l.shadow,N=l.className,k=l.children,A=m(l,["variant","color","shadow","className","children"]),M=(0,f.useTheme)().card,D=M.defaultProps,L=M.styles,B=M.valid,U=L.base,Y=L.variants;v=v??D.variant,w=w??D.color,j=j??D.shadow,N=N??D.className;var q=(0,c.default)(U.initial),z=(0,c.default)(Y[(0,i.default)(B.variants,v,"filled")][(0,i.default)(B.colors,w,"white")]),$=(0,a.twMerge)((0,o.default)(q,z,T({},(0,c.default)(U.shadow),j)),N);return r.default.createElement("div",C({},A,{ref:h,className:$}),k)});s.propTypes={variant:n.default.oneOf(O.propTypesVariant),color:n.default.oneOf(O.propTypesColor),shadow:O.propTypesShadow,className:O.propTypesClassName,children:O.propTypesChildren},s.displayName="MaterialTailwind.Card";var u=Object.assign(s,{Header:g.CardHeader,Body:b.CardBody,Footer:S.CardFooter})})(tP);var aP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Checkbox:function(){return m},default:function(){return d}});var r=T(P),n=T(nt),o=T(js),a=T(ct),i=rt,c=T(Xt),f=T(et),g=Ze,b=mi;function S(s,u,l){return u in s?Object.defineProperty(s,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[u]=l,s}function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.color,h=s.label,v=s.icon,w=s.ripple,j=s.className,N=s.disabled,k=s.containerProps,A=s.labelProps,M=s.iconProps,D=s.inputRef,L=C(s,["color","label","icon","ripple","className","disabled","containerProps","labelProps","iconProps","inputRef"]),B=(0,g.useTheme)().checkbox,U=B.defaultProps,Y=B.valid,q=B.styles,z=q.base,$=q.colors,K=r.default.useId();l=l??U.color,h=h??U.label,v=v??U.icon,w=w??U.ripple,j=j??U.className,N=N??U.disabled,k=k??U.containerProps,A=A??U.labelProps,M=M??U.iconProps;var X=w!==void 0&&new o.default,te=(0,a.default)((0,f.default)(z.root),S({},(0,f.default)(z.disabled),N)),me=(0,i.twMerge)((0,a.default)((0,f.default)(z.container)),k==null?void 0:k.className),de=(0,i.twMerge)((0,a.default)((0,f.default)(z.input),(0,f.default)($[(0,c.default)(Y.colors,l,"gray")])),j),ee=(0,i.twMerge)((0,a.default)((0,f.default)(z.label)),A==null?void 0:A.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:u,className:te},r.default.createElement("label",O({},k,{className:me,htmlFor:L.id||K,onMouseDown:function(pe){var fe=k==null?void 0:k.onMouseDown;return w&&X.create(pe,"dark"),typeof fe=="function"&&fe(pe)}}),r.default.createElement("input",O({},L,{ref:D,type:"checkbox",disabled:N,className:de,id:L.id||K})),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({},A,{className:ee,htmlFor:L.id||K}),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})(aP);var iP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,l){for(var h in l)Object.defineProperty(u,h,{enumerable:!0,get:l[h]})}t(e,{Chip:function(){return d},default:function(){return s}});var r=C(P),n=C(nt),o=xr,a=C(ct),i=C(Tr),c=rt,f=C(Xt),g=C(et),b=Ze,S=Rm,O=C(Bf);function T(){return T=Object.assign||function(u){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(u,v)&&(h[v]=u[v])}return h}function m(u,l){if(u==null)return{};var h={},v=Object.keys(u),w,j;for(j=0;j=0)&&(h[w]=u[w]);return h}var d=r.default.forwardRef(function(u,l){var h=u.variant,v=u.size,w=u.color,j=u.icon,N=u.open,k=u.onClose,A=u.action,M=u.animate,D=u.className,L=u.value,B=x(u,["variant","size","color","icon","open","onClose","action","animate","className","value"]),U=(0,b.useTheme)().chip,Y=U.defaultProps,q=U.valid,z=U.styles,$=z.base,K=z.variants,X=z.sizes;h=h??Y.variant,v=v??Y.size,w=w??Y.color,D=D??Y.className,M=M??Y.animate,N=N??Y.open,A=A??Y.action,k=k??Y.onClose;var te=(0,g.default)($.chip),me=(0,g.default)($.action),de=(0,g.default)($.icon),ee=(0,g.default)(K[(0,f.default)(q.variants,h,"filled")][(0,f.default)(q.colors,w,"gray")]),Se=(0,g.default)(X[(0,f.default)(q.sizes,v,"md")].chip),pe=(0,g.default)(X[(0,f.default)(q.sizes,v,"md")].action),fe=(0,g.default)(X[(0,f.default)(q.sizes,v,"md")].icon),be=(0,c.twMerge)((0,a.default)(te,ee,Se),D),ye=(0,a.default)(me,pe),Pe=(0,a.default)(de,fe),Me=(0,a.default)({"ml-4":j&&v==="sm","ml-[18px]":j&&v==="md","ml-5":j&&v==="lg","mr-5":k}),ke={unmount:{opacity:0},mount:{opacity:1}},ce=(0,i.default)(ke,M),je=r.default.createElement("div",{className:Pe},j),He=o.AnimatePresence;return r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(He,null,N&&r.default.createElement(o.m.div,T({},B,{ref:l,className:be,initial:"unmount",exit:"unmount",animate:N?"mount":"unmount",variants:ce}),j&&je,r.default.createElement("span",{className:Me},L),k&&!A&&r.default.createElement(O.default,{onClick:k,size:"sm",variant:"text",color:h==="outlined"||h==="ghost"?w:"white",className:ye},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"}))),A||null)))});d.propTypes={variant:n.default.oneOf(S.propTypesVariant),size:n.default.oneOf(S.propTypesSize),color:n.default.oneOf(S.propTypesColor),icon:S.propTypesIcon,open:S.propTypesOpen,onClose:S.propTypesOnClose,action:S.propTypesAction,animate:S.propTypesAnimate,className:S.propTypesClassName,value:S.propTypesValue},d.displayName="MaterialTailwind.Chip";var s=d})(iP);var sP={},yF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ri=new WeakMap,vc=new WeakMap,yc={},xh=0,lP=function(e){return e&&(e.host||lP(e.parentNode))},xF=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=lP(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})},wF=function(e,t,r,n){var o=xF(t,Array.isArray(e)?e:[e]);yc[r]||(yc[r]=new WeakMap);var a=yc[r],i=[],c=new Set,f=new Set(o),g=function(S){!S||c.has(S)||(c.add(S),g(S.parentNode))};o.forEach(g);var b=function(S){!S||f.has(S)||Array.prototype.forEach.call(S.children,function(O){if(c.has(O))b(O);else try{var T=O.getAttribute(n),C=T!==null&&T!=="false",x=(Ri.get(O)||0)+1,m=(a.get(O)||0)+1;Ri.set(O,x),a.set(O,m),i.push(O),x===1&&C&&vc.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),c.clear(),xh++,function(){i.forEach(function(S){var O=Ri.get(S)-1,T=a.get(S)-1;Ri.set(S,O),a.set(S,T),O||(vc.has(S)||S.removeAttribute(n),vc.delete(S)),T||S.removeAttribute(r)}),xh--,xh||(Ri=new WeakMap,Ri=new WeakMap,vc=new WeakMap,yc={})}},_F=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||yF(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),wF(n,o,r,"aria-hidden")):function(){return null}};/*! * tabbable 6.2.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var SF=["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])"],ag=SF.join(","),uP=typeof Element>"u",au=uP?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hd=!uP&&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},qd=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},CF=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},TF=function(t,r,n){if(qd(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ag));return r&&au.call(t,ag)&&o.unshift(t),o=o.filter(n),o},OF=function e(t,r,n){for(var o=[],a=Array.from(t);a.length;){var i=a.shift();if(!qd(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),f=c.length?c:i.children,g=e(f,!0,n);n.flatten?o.push.apply(o,g):o.push({scopeParent:i,candidates:g})}else{var b=au.call(i,ag);b&&n.filter(i)&&(r||!t.includes(i))&&o.push(i);var S=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),O=!qd(S,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(S&&O){var T=e(S===!0?i.children:S.children,!0,n);n.flatten?o.push.apply(o,T):o.push({scopeParent:i,candidates:T})}else a.unshift.apply(a,i.children)}}return o},cP=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},dP=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||CF(t))&&!cP(t)?0:t.tabIndex},PF=function(t,r){var n=dP(t);return n<0&&r&&!cP(t)?0:n},kF=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},fP=function(t){return t.tagName==="INPUT"},NF=function(t){return fP(t)&&t.type==="hidden"},EF=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},jF=function(t,r){for(var n=0;nsummary:first-of-type"),i=a?t.parentElement:t;if(au.call(i,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var f=t.parentElement,g=Hd(t);if(f&&!f.shadowRoot&&o(f)===!0)return pw(t);t.assignedSlot?t=t.assignedSlot:!f&&g!==t.ownerDocument?t=g.host:t=f}t=c}if(IF(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return pw(t);return!1},LF=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)},BF=function e(t){var r=[],n=[];return t.forEach(function(o,a){var i=!!o.scopeParent,c=i?o.scopeParent:o,f=PF(c,i),g=i?e(o.candidates):c;f===0?i?r.push.apply(r,g):r.push(c):n.push({documentOrder:a,tabIndex:f,item:o,isScope:i,content:g})}),n.sort(kF).reduce(function(o,a){return a.isScope?o.push.apply(o,a.content):o.push(a.content),o},[]).concat(r)},Gd=function(t,r){r=r||{};var n;return r.getShadowRoot?n=OF([t],r.includeContainer,{filter:hw.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:zF}):n=TF(t,r.includeContainer,hw.bind(null,r)),BF(n)};const pP=["top","right","bottom","left"],gw=["start","end"],mw=pP.reduce((e,t)=>e.concat(t,t+"-"+gw[0],t+"-"+gw[1]),[]),Zn=Math.min,Ar=Math.max,Kd=Math.round,xc=Math.floor,yo=e=>({x:e,y:e}),VF={left:"right",right:"left",bottom:"top",top:"bottom"},UF={start:"end",end:"start"};function ig(e,t,r){return Ar(e,Zn(t,r))}function Jn(e,t){return typeof e=="function"?e(t):e}function pn(e){return e.split("-")[0]}function Qn(e){return e.split("-")[1]}function lb(e){return e==="x"?"y":"x"}function ub(e){return e==="y"?"height":"width"}const WF=new Set(["top","bottom"]);function qn(e){return WF.has(pn(e))?"y":"x"}function cb(e){return lb(qn(e))}function hP(e,t,r){r===void 0&&(r=!1);const n=Qn(e),o=cb(e),a=ub(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Qd(i)),[i,Qd(i)]}function $F(e){const t=Qd(e);return[Yd(e),t,Yd(t)]}function Yd(e){return e.replace(/start|end/g,t=>UF[t])}const bw=["left","right"],vw=["right","left"],HF=["top","bottom"],qF=["bottom","top"];function GF(e,t,r){switch(e){case"top":case"bottom":return r?t?vw:bw:t?bw:vw;case"left":case"right":return t?HF:qF;default:return[]}}function KF(e,t,r,n){const o=Qn(e);let a=GF(pn(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(Yd)))),a}function Qd(e){return e.replace(/left|right|bottom|top/g,t=>VF[t])}function YF(e){return{top:0,right:0,bottom:0,left:0,...e}}function db(e){return typeof e!="number"?YF(e):{top:e,right:e,bottom:e,left:e}}function vs(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 yw(e,t,r){let{reference:n,floating:o}=e;const a=qn(t),i=cb(t),c=ub(i),f=pn(t),g=a==="y",b=n.x+n.width/2-o.width/2,S=n.y+n.height/2-o.height/2,O=n[c]/2-o[c]/2;let T;switch(f){case"top":T={x:b,y:n.y-o.height};break;case"bottom":T={x:b,y:n.y+n.height};break;case"right":T={x:n.x+n.width,y:S};break;case"left":T={x:n.x-o.width,y:S};break;default:T={x:n.x,y:n.y}}switch(Qn(t)){case"start":T[i]-=O*(r&&g?-1:1);break;case"end":T[i]+=O*(r&&g?-1:1);break}return T}const QF=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,c=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:S}=yw(g,n,f),O=n,T={},C=0;for(let x=0;x({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:c,middlewareData:f}=t,{element:g,padding:b=0}=Jn(e,t)||{};if(g==null)return{};const S=db(b),O={x:r,y:n},T=cb(o),C=ub(T),x=await i.getDimensions(g),m=T==="y",d=m?"top":"left",s=m?"bottom":"right",u=m?"clientHeight":"clientWidth",l=a.reference[C]+a.reference[T]-O[T]-a.floating[C],h=O[T]-a.reference[T],v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(g));let w=v?v[u]:0;(!w||!await(i.isElement==null?void 0:i.isElement(v)))&&(w=c.floating[u]||a.floating[C]);const j=l/2-h/2,N=w/2-x[C]/2-1,k=Zn(S[d],N),A=Zn(S[s],N),M=k,D=w-x[C]-A,L=w/2-x[C]/2+j,B=ig(M,L,D),U=!f.arrow&&Qn(o)!=null&&L!==B&&a.reference[C]/2-(LQn(o)===e),...r.filter(o=>Qn(o)!==e)]:r.filter(o=>pn(o)===o)).filter(o=>e?Qn(o)===e||(t?Yd(o)!==o:!1):!0)}const JF=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,o;const{rects:a,middlewareData:i,placement:c,platform:f,elements:g}=t,{crossAxis:b=!1,alignment:S,allowedPlacements:O=mw,autoAlignment:T=!0,...C}=Jn(e,t),x=S!==void 0||O===mw?ZF(S||null,T,O):O,m=await si(t,C),d=((r=i.autoPlacement)==null?void 0:r.index)||0,s=x[d];if(s==null)return{};const u=hP(s,a,await(f.isRTL==null?void 0:f.isRTL(g.floating)));if(c!==s)return{reset:{placement:x[0]}};const l=[m[pn(s)],m[u[0]],m[u[1]]],h=[...((n=i.autoPlacement)==null?void 0:n.overflows)||[],{placement:s,overflows:l}],v=x[d+1];if(v)return{data:{index:d+1,overflows:h},reset:{placement:v}};const w=h.map(k=>{const A=Qn(k.placement);return[k.placement,A&&b?k.overflows.slice(0,2).reduce((M,D)=>M+D,0):k.overflows[0],k.overflows]}).sort((k,A)=>k[1]-A[1]),N=((o=w.filter(k=>k[2].slice(0,Qn(k[0])?2:3).every(A=>A<=0))[0])==null?void 0:o[0])||w[0][0];return N!==c?{data:{index:d+1,overflows:h},reset:{placement:N}}:{}}}},e6=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:c,platform:f,elements:g}=t,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:O,fallbackStrategy:T="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:x=!0,...m}=Jn(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const d=pn(o),s=qn(c),u=pn(c)===c,l=await(f.isRTL==null?void 0:f.isRTL(g.floating)),h=O||(u||!x?[Qd(c)]:$F(c)),v=C!=="none";!O&&v&&h.push(...KF(c,x,C,l));const w=[c,...h],j=await si(t,m),N=[];let k=((n=a.flip)==null?void 0:n.overflows)||[];if(b&&N.push(j[d]),S){const L=hP(o,i,l);N.push(j[L[0]],j[L[1]])}if(k=[...k,{placement:o,overflows:N}],!N.every(L=>L<=0)){var A,M;const L=(((A=a.flip)==null?void 0:A.index)||0)+1,B=w[L];if(B&&(!(S==="alignment"?s!==qn(B):!1)||k.every(q=>qn(q.placement)===s?q.overflows[0]>0:!0)))return{data:{index:L,overflows:k},reset:{placement:B}};let U=(M=k.filter(Y=>Y.overflows[0]<=0).sort((Y,q)=>Y.overflows[1]-q.overflows[1])[0])==null?void 0:M.placement;if(!U)switch(T){case"bestFit":{var D;const Y=(D=k.filter(q=>{if(v){const z=qn(q.placement);return z===s||z==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(z=>z>0).reduce((z,$)=>z+$,0)]).sort((q,z)=>q[1]-z[1])[0])==null?void 0:D[0];Y&&(U=Y);break}case"initialPlacement":U=c;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function xw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ww(e){return pP.some(t=>e[t]>=0)}const t6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Jn(e,t);switch(n){case"referenceHidden":{const a=await si(t,{...o,elementContext:"reference"}),i=xw(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ww(i)}}}case"escaped":{const a=await si(t,{...o,altBoundary:!0}),i=xw(a,r.floating);return{data:{escapedOffsets:i,escaped:ww(i)}}}default:return{}}}}};function gP(e){const t=Zn(...e.map(a=>a.left)),r=Zn(...e.map(a=>a.top)),n=Ar(...e.map(a=>a.right)),o=Ar(...e.map(a=>a.bottom));return{x:t,y:r,width:n-t,height:o-r}}function r6(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=>vs(gP(o)))}const n6=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:c=2,x:f,y:g}=Jn(e,t),b=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(n.reference))||[]),S=r6(b),O=vs(gP(b)),T=db(c);function C(){if(S.length===2&&S[0].left>S[1].right&&f!=null&&g!=null)return S.find(m=>f>m.left-T.left&&fm.top-T.top&&g=2){if(qn(r)==="y"){const k=S[0],A=S[S.length-1],M=pn(r)==="top",D=k.top,L=A.bottom,B=M?k.left:A.left,U=M?k.right:A.right,Y=U-B,q=L-D;return{top:D,bottom:L,left:B,right:U,width:Y,height:q,x:B,y:D}}const m=pn(r)==="left",d=Ar(...S.map(k=>k.right)),s=Zn(...S.map(k=>k.left)),u=S.filter(k=>m?k.left===s:k.right===d),l=u[0].top,h=u[u.length-1].bottom,v=s,w=d,j=w-v,N=h-l;return{top:l,bottom:h,left:v,right:w,width:j,height:N,x:v,y:l}}return O}const x=await a.getElementRects({reference:{getBoundingClientRect:C},floating:n.floating,strategy:i});return o.reference.x!==x.reference.x||o.reference.y!==x.reference.y||o.reference.width!==x.reference.width||o.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}},mP=new Set(["left","top"]);async function o6(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=pn(r),c=Qn(r),f=qn(r)==="y",g=mP.has(i)?-1:1,b=a&&f?-1:1,S=Jn(t,e);let{mainAxis:O,crossAxis:T,alignmentAxis:C}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return c&&typeof C=="number"&&(T=c==="end"?C*-1:C),f?{x:T*b,y:O*g}:{x:O*g,y:T*b}}const a6=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:c}=t,f=await o6(t,e);return i===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+f.x,y:a+f.y,data:{...f,placement:i}}}}},i6=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:c={fn:m=>{let{x:d,y:s}=m;return{x:d,y:s}}},...f}=Jn(e,t),g={x:r,y:n},b=await si(t,f),S=qn(pn(o)),O=lb(S);let T=g[O],C=g[S];if(a){const m=O==="y"?"top":"left",d=O==="y"?"bottom":"right",s=T+b[m],u=T-b[d];T=ig(s,T,u)}if(i){const m=S==="y"?"top":"left",d=S==="y"?"bottom":"right",s=C+b[m],u=C-b[d];C=ig(s,C,u)}const x=c.fn({...t,[O]:T,[S]:C});return{...x,data:{x:x.x-r,y:x.y-n,enabled:{[O]:a,[S]:i}}}}}},s6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:c=0,mainAxis:f=!0,crossAxis:g=!0}=Jn(e,t),b={x:r,y:n},S=qn(o),O=lb(S);let T=b[O],C=b[S];const x=Jn(c,t),m=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const u=O==="y"?"height":"width",l=a.reference[O]-a.floating[u]+m.mainAxis,h=a.reference[O]+a.reference[u]-m.mainAxis;Th&&(T=h)}if(g){var d,s;const u=O==="y"?"width":"height",l=mP.has(pn(o)),h=a.reference[S]-a.floating[u]+(l&&((d=i.offset)==null?void 0:d[S])||0)+(l?0:m.crossAxis),v=a.reference[S]+a.reference[u]+(l?0:((s=i.offset)==null?void 0:s[S])||0)-(l?m.crossAxis:0);Cv&&(C=v)}return{[O]:T,[S]:C}}}},l6=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:c}=t,{apply:f=()=>{},...g}=Jn(e,t),b=await si(t,g),S=pn(o),O=Qn(o),T=qn(o)==="y",{width:C,height:x}=a.floating;let m,d;S==="top"||S==="bottom"?(m=S,d=O===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(d=S,m=O==="end"?"top":"bottom");const s=x-b.top-b.bottom,u=C-b.left-b.right,l=Zn(x-b[m],s),h=Zn(C-b[d],u),v=!t.middlewareData.shift;let w=l,j=h;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(j=u),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(w=s),v&&!O){const k=Ar(b.left,0),A=Ar(b.right,0),M=Ar(b.top,0),D=Ar(b.bottom,0);T?j=C-2*(k!==0||A!==0?k+A:Ar(b.left,b.right)):w=x-2*(M!==0||D!==0?M+D:Ar(b.top,b.bottom))}await f({...t,availableWidth:j,availableHeight:w});const N=await i.getDimensions(c.floating);return C!==N.width||x!==N.height?{reset:{rects:!0}}:{}}}};function Vf(){return typeof window<"u"}function As(e){return bP(e)?(e.nodeName||"").toLowerCase():"#document"}function dn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Co(e){var t;return(t=(bP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bP(e){return Vf()?e instanceof Node||e instanceof dn(e).Node:!1}function eo(e){return Vf()?e instanceof Element||e instanceof dn(e).Element:!1}function wo(e){return Vf()?e instanceof HTMLElement||e instanceof dn(e).HTMLElement:!1}function _w(e){return!Vf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dn(e).ShadowRoot}const u6=new Set(["inline","contents"]);function Su(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=to(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!u6.has(o)}const c6=new Set(["table","td","th"]);function d6(e){return c6.has(As(e))}const f6=[":popover-open",":modal"];function Uf(e){return f6.some(t=>{try{return e.matches(t)}catch{return!1}})}const p6=["transform","translate","scale","rotate","perspective"],h6=["transform","translate","scale","rotate","perspective","filter"],g6=["paint","layout","strict","content"];function fb(e){const t=pb(),r=eo(e)?to(e):e;return p6.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)||h6.some(n=>(r.willChange||"").includes(n))||g6.some(n=>(r.contain||"").includes(n))}function m6(e){let t=Oa(e);for(;wo(t)&&!ys(t);){if(fb(t))return t;if(Uf(t))return null;t=Oa(t)}return null}function pb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const b6=new Set(["html","body","#document"]);function ys(e){return b6.has(As(e))}function to(e){return dn(e).getComputedStyle(e)}function Wf(e){return eo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oa(e){if(As(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_w(e)&&e.host||Co(e);return _w(t)?t.host:t}function vP(e){const t=Oa(e);return ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:wo(t)&&Su(t)?t:vP(t)}function Lo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=vP(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=dn(o);if(a){const c=sg(i);return t.concat(i,i.visualViewport||[],Su(o)?o:[],c&&r?Lo(c):[])}return t.concat(o,Lo(o,[],r))}function sg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yP(e){const t=to(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=wo(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,c=Kd(r)!==a||Kd(n)!==i;return c&&(r=a,n=i),{width:r,height:n,$:c}}function hb(e){return eo(e)?e:e.contextElement}function os(e){const t=hb(e);if(!wo(t))return yo(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=yP(t);let i=(a?Kd(r.width):r.width)/n,c=(a?Kd(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const v6=yo(0);function xP(e){const t=dn(e);return!pb()||!t.visualViewport?v6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function y6(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==dn(e)?!1:t}function li(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=hb(e);let i=yo(1);t&&(n?eo(n)&&(i=os(n)):i=os(e));const c=y6(a,r,n)?xP(a):yo(0);let f=(o.left+c.x)/i.x,g=(o.top+c.y)/i.y,b=o.width/i.x,S=o.height/i.y;if(a){const O=dn(a),T=n&&eo(n)?dn(n):n;let C=O,x=sg(C);for(;x&&n&&T!==C;){const m=os(x),d=x.getBoundingClientRect(),s=to(x),u=d.left+(x.clientLeft+parseFloat(s.paddingLeft))*m.x,l=d.top+(x.clientTop+parseFloat(s.paddingTop))*m.y;f*=m.x,g*=m.y,b*=m.x,S*=m.y,f+=u,g+=l,C=dn(x),x=sg(C)}}return vs({width:b,height:S,x:f,y:g})}function $f(e,t){const r=Wf(e).scrollLeft;return t?t.left+r:li(Co(e)).left+r}function wP(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 x6(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=Co(n),c=t?Uf(t.floating):!1;if(n===i||c&&a)return r;let f={scrollLeft:0,scrollTop:0},g=yo(1);const b=yo(0),S=wo(n);if((S||!S&&!a)&&((As(n)!=="body"||Su(i))&&(f=Wf(n)),wo(n))){const T=li(n);g=os(n),b.x=T.x+n.clientLeft,b.y=T.y+n.clientTop}const O=i&&!S&&!a?wP(i,f):yo(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 w6(e){return Array.from(e.getClientRects())}function _6(e){const t=Co(e),r=Wf(e),n=e.ownerDocument.body,o=Ar(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Ar(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+$f(e);const c=-r.scrollTop;return to(n).direction==="rtl"&&(i+=Ar(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:c}}const Sw=25;function S6(e,t){const r=dn(e),n=Co(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,c=0,f=0;if(o){a=o.width,i=o.height;const b=pb();(!b||b&&t==="fixed")&&(c=o.offsetLeft,f=o.offsetTop)}const g=$f(n);if(g<=0){const b=n.ownerDocument,S=b.body,O=getComputedStyle(S),T=b.compatMode==="CSS1Compat"&&parseFloat(O.marginLeft)+parseFloat(O.marginRight)||0,C=Math.abs(n.clientWidth-S.clientWidth-T);C<=Sw&&(a-=C)}else g<=Sw&&(a+=g);return{width:a,height:i,x:c,y:f}}const C6=new Set(["absolute","fixed"]);function T6(e,t){const r=li(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=wo(e)?os(e):yo(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,f=o*a.x,g=n*a.y;return{width:i,height:c,x:f,y:g}}function Cw(e,t,r){let n;if(t==="viewport")n=S6(e,r);else if(t==="document")n=_6(Co(e));else if(eo(t))n=T6(t,r);else{const o=xP(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return vs(n)}function _P(e,t){const r=Oa(e);return r===t||!eo(r)||ys(r)?!1:to(r).position==="fixed"||_P(r,t)}function O6(e,t){const r=t.get(e);if(r)return r;let n=Lo(e,[],!1).filter(c=>eo(c)&&As(c)!=="body"),o=null;const a=to(e).position==="fixed";let i=a?Oa(e):e;for(;eo(i)&&!ys(i);){const c=to(i),f=fb(i);!f&&c.position==="fixed"&&(o=null),(a?!f&&!o:!f&&c.position==="static"&&!!o&&C6.has(o.position)||Su(i)&&!f&&_P(e,i))?n=n.filter(b=>b!==i):o=c,i=Oa(i)}return t.set(e,n),n}function P6(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Uf(t)?[]:O6(t,this._c):[].concat(r),n],c=i[0],f=i.reduce((g,b)=>{const S=Cw(t,b,o);return g.top=Ar(S.top,g.top),g.right=Zn(S.right,g.right),g.bottom=Zn(S.bottom,g.bottom),g.left=Ar(S.left,g.left),g},Cw(t,c,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function k6(e){const{width:t,height:r}=yP(e);return{width:t,height:r}}function N6(e,t,r){const n=wo(t),o=Co(t),a=r==="fixed",i=li(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const f=yo(0);function g(){f.x=$f(o)}if(n||!n&&!a)if((As(t)!=="body"||Su(o))&&(c=Wf(t)),n){const T=li(t,!0,a,t);f.x=T.x+t.clientLeft,f.y=T.y+t.clientTop}else o&&g();a&&!n&&o&&g();const b=o&&!n&&!a?wP(o,c):yo(0),S=i.left+c.scrollLeft-f.x-b.x,O=i.top+c.scrollTop-f.y-b.y;return{x:S,y:O,width:i.width,height:i.height}}function wh(e){return to(e).position==="static"}function Tw(e,t){if(!wo(e)||to(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Co(e)===r&&(r=r.ownerDocument.body),r}function SP(e,t){const r=dn(e);if(Uf(e))return r;if(!wo(e)){let o=Oa(e);for(;o&&!ys(o);){if(eo(o)&&!wh(o))return o;o=Oa(o)}return r}let n=Tw(e,t);for(;n&&d6(n)&&wh(n);)n=Tw(n,t);return n&&ys(n)&&wh(n)&&!fb(n)?r:n||m6(e)||r}const E6=async function(e){const t=this.getOffsetParent||SP,r=this.getDimensions,n=await r(e.floating);return{reference:N6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function j6(e){return to(e).direction==="rtl"}const CP={convertOffsetParentRelativeRectToViewportRelativeRect:x6,getDocumentElement:Co,getClippingRect:P6,getOffsetParent:SP,getElementRects:E6,getClientRects:w6,getDimensions:k6,getScale:os,isElement:eo,isRTL:j6};function TP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function A6(e,t){let r=null,n;const o=Co(e);function a(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function i(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),a();const g=e.getBoundingClientRect(),{left:b,top:S,width:O,height:T}=g;if(c||t(),!O||!T)return;const C=xc(S),x=xc(o.clientWidth-(b+O)),m=xc(o.clientHeight-(S+T)),d=xc(b),u={rootMargin:-C+"px "+-x+"px "+-m+"px "+-d+"px",threshold:Ar(0,Zn(1,f))||1};let l=!0;function h(v){const w=v[0].intersectionRatio;if(w!==f){if(!l)return i();w?i(!1,w):n=setTimeout(()=>{i(!1,1e-7)},1e3)}w===1&&!TP(g,e.getBoundingClientRect())&&i(),l=!1}try{r=new IntersectionObserver(h,{...u,root:o.ownerDocument})}catch{r=new IntersectionObserver(h,u)}r.observe(e)}return i(!0),a}function R6(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,g=hb(e),b=o||a?[...g?Lo(g):[],...Lo(t)]:[];b.forEach(d=>{o&&d.addEventListener("scroll",r,{passive:!0}),a&&d.addEventListener("resize",r)});const S=g&&c?A6(g,r):null;let O=-1,T=null;i&&(T=new ResizeObserver(d=>{let[s]=d;s&&s.target===g&&T&&(T.unobserve(t),cancelAnimationFrame(O),O=requestAnimationFrame(()=>{var u;(u=T)==null||u.observe(t)})),r()}),g&&!f&&T.observe(g),T.observe(t));let C,x=f?li(e):null;f&&m();function m(){const d=li(e);x&&!TP(x,d)&&r(),x=d,C=requestAnimationFrame(m)}return r(),()=>{var d;b.forEach(s=>{o&&s.removeEventListener("scroll",r),a&&s.removeEventListener("resize",r)}),S==null||S(),(d=T)==null||d.disconnect(),T=null,f&&cancelAnimationFrame(C)}}const Qc=si,OP=a6,M6=JF,I6=i6,D6=e6,L6=l6,F6=t6,Ow=XF,z6=n6,B6=s6,PP=(e,t,r)=>{const n=new Map,o={platform:CP,...r},a={...o.platform,_c:n};return QF(e,t,{...o,platform:a})},V6=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?Ow({element:t.current,padding:r}).fn(o):{}:t?Ow({element:t,padding:r}).fn(o):{}}}};var Xc=typeof document<"u"?P.useLayoutEffect:P.useEffect;function Xd(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(!Xd(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)&&!Xd(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Pw(e){const t=P.useRef(e);return Xc(()=>{t.current=e}),t}function U6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,whileElementsMounted:a,open:i}=e,[c,f]=P.useState({x:null,y:null,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,b]=P.useState(n);Xd(g,n)||b(n);const S=P.useRef(null),O=P.useRef(null),T=P.useRef(c),C=Pw(a),x=Pw(o),[m,d]=P.useState(null),[s,u]=P.useState(null),l=P.useCallback(k=>{S.current!==k&&(S.current=k,d(k))},[]),h=P.useCallback(k=>{O.current!==k&&(O.current=k,u(k))},[]),v=P.useCallback(()=>{if(!S.current||!O.current)return;const k={placement:t,strategy:r,middleware:g};x.current&&(k.platform=x.current),PP(S.current,O.current,k).then(A=>{const M={...A,isPositioned:!0};w.current&&!Xd(T.current,M)&&(T.current=M,Uo.flushSync(()=>{f(M)}))})},[g,t,r,x]);Xc(()=>{i===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[i]);const w=P.useRef(!1);Xc(()=>(w.current=!0,()=>{w.current=!1}),[]),Xc(()=>{if(m&&s){if(C.current)return C.current(m,s,v);v()}},[m,s,v,C]);const j=P.useMemo(()=>({reference:S,floating:O,setReference:l,setFloating:h}),[l,h]),N=P.useMemo(()=>({reference:m,floating:s}),[m,s]);return P.useMemo(()=>({...c,update:v,refs:j,elements:N,reference:l,floating:h}),[c,v,j,N,l,h])}var Jt=typeof document<"u"?P.useLayoutEffect:P.useEffect;let _h=!1,W6=0;const kw=()=>"floating-ui-"+W6++;function $6(){const[e,t]=P.useState(()=>_h?kw():void 0);return Jt(()=>{e==null&&t(kw())},[]),P.useEffect(()=>{_h||(_h=!0)},[]),e}const H6=wg["useId".toString()],iu=H6||$6;function kP(){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 NP=P.createContext(null),EP=P.createContext(null),Rs=()=>{var e;return((e=P.useContext(NP))==null?void 0:e.id)||null},vi=()=>P.useContext(EP),q6=e=>{const t=iu(),r=vi(),n=Rs(),o=e||n;return Jt(()=>{const a={id:t,parentId:o};return r==null||r.addNode(a),()=>{r==null||r.removeNode(a)}},[r,t,o]),t},G6=e=>{let{children:t,id:r}=e;const n=Rs();return P.createElement(NP.Provider,{value:P.useMemo(()=>({id:r,parentId:n}),[r,n])},t)},K6=e=>{let{children:t}=e;const r=P.useRef([]),n=P.useCallback(i=>{r.current=[...r.current,i]},[]),o=P.useCallback(i=>{r.current=r.current.filter(c=>c!==i)},[]),a=P.useState(()=>kP())[0];return P.createElement(EP.Provider,{value:P.useMemo(()=>({nodesRef:r,addNode:n,removeNode:o,events:a}),[r,n,o,a])},t)};function Yr(e){return(e==null?void 0:e.ownerDocument)||document}function gb(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function jP(){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 mb(e){return Yr(e).defaultView||window}function On(e){return e?e instanceof mb(e).Element:!1}function ui(e){return e?e instanceof mb(e).HTMLElement:!1}function Y6(e){if(typeof ShadowRoot>"u")return!1;const t=mb(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function AP(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(gb())||t.test(jP()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function RP(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 lg(){return/apple/i.test(navigator.vendor)}function MP(){return gb().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Zd(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function Pn(e){const t=P.useRef(e);return Jt(()=>{t.current=e}),t}const Nw="data-floating-ui-safe-polygon";function Zc(e,t,r){return r&&!Zd(r)?0:typeof e=="number"?e:e==null?void 0:e[t]}const Q6=function(e,t){let{enabled:r=!0,delay:n=0,handleClose:o=null,mouseOnly:a=!1,restMs:i=0,move:c=!0}=t===void 0?{}:t;const{open:f,onOpenChange:g,dataRef:b,events:S,elements:{domReference:O,floating:T},refs:C}=e,x=vi(),m=Rs(),d=Pn(o),s=Pn(n),u=P.useRef(),l=P.useRef(),h=P.useRef(),v=P.useRef(),w=P.useRef(!0),j=P.useRef(!1),N=P.useRef(()=>{}),k=P.useCallback(()=>{var L;const B=(L=b.current.openEvent)==null?void 0:L.type;return(B==null?void 0:B.includes("mouse"))&&B!=="mousedown"},[b]);P.useEffect(()=>{if(!r)return;function L(){clearTimeout(l.current),clearTimeout(v.current),w.current=!0}return S.on("dismiss",L),()=>{S.off("dismiss",L)}},[r,S]),P.useEffect(()=>{if(!r||!d.current||!f)return;function L(){k()&&g(!1)}const B=Yr(T).documentElement;return B.addEventListener("mouseleave",L),()=>{B.removeEventListener("mouseleave",L)}},[T,f,g,r,d,b,k]);const A=P.useCallback(function(L){L===void 0&&(L=!0);const B=Zc(s.current,"close",u.current);B&&!h.current?(clearTimeout(l.current),l.current=setTimeout(()=>g(!1),B)):L&&(clearTimeout(l.current),g(!1))},[s,g]),M=P.useCallback(()=>{N.current(),h.current=void 0},[]),D=P.useCallback(()=>{if(j.current){const L=Yr(C.floating.current).body;L.style.pointerEvents="",L.removeAttribute(Nw),j.current=!1}},[C]);return P.useEffect(()=>{if(!r)return;function L(){return b.current.openEvent?["click","mousedown"].includes(b.current.openEvent.type):!1}function B(q){if(clearTimeout(l.current),w.current=!1,a&&!Zd(u.current)||i>0&&Zc(s.current,"open")===0)return;b.current.openEvent=q;const z=Zc(s.current,"open",u.current);z?l.current=setTimeout(()=>{g(!0)},z):g(!0)}function U(q){if(L())return;N.current();const z=Yr(T);if(clearTimeout(v.current),d.current){clearTimeout(l.current),h.current=d.current({...e,tree:x,x:q.clientX,y:q.clientY,onClose(){D(),M(),A()}});const $=h.current;z.addEventListener("mousemove",$),N.current=()=>{z.removeEventListener("mousemove",$)};return}A()}function Y(q){L()||d.current==null||d.current({...e,tree:x,x:q.clientX,y:q.clientY,onClose(){M(),A()}})(q)}if(On(O)){const q=O;return f&&q.addEventListener("mouseleave",Y),T==null||T.addEventListener("mouseleave",Y),c&&q.addEventListener("mousemove",B,{once:!0}),q.addEventListener("mouseenter",B),q.addEventListener("mouseleave",U),()=>{f&&q.removeEventListener("mouseleave",Y),T==null||T.removeEventListener("mouseleave",Y),c&&q.removeEventListener("mousemove",B),q.removeEventListener("mouseenter",B),q.removeEventListener("mouseleave",U)}}},[O,T,r,e,a,i,c,A,M,D,g,f,x,s,d,b]),Jt(()=>{var L;if(r&&f&&(L=d.current)!=null&&L.__options.blockPointerEvents&&k()){const Y=Yr(T).body;if(Y.setAttribute(Nw,""),Y.style.pointerEvents="none",j.current=!0,On(O)&&T){var B,U;const q=O,z=x==null||(B=x.nodesRef.current.find($=>$.id===m))==null||(U=B.context)==null?void 0:U.elements.floating;return z&&(z.style.pointerEvents=""),q.style.pointerEvents="auto",T.style.pointerEvents="auto",()=>{q.style.pointerEvents="",T.style.pointerEvents=""}}}},[r,f,m,T,O,x,d,b,k]),Jt(()=>{f||(u.current=void 0,M(),D())},[f,M,D]),P.useEffect(()=>()=>{M(),clearTimeout(l.current),clearTimeout(v.current),D()},[r,M,D]),P.useMemo(()=>{if(!r)return{};function L(B){u.current=B.pointerType}return{reference:{onPointerDown:L,onPointerEnter:L,onMouseMove(){f||i===0||(clearTimeout(v.current),v.current=setTimeout(()=>{w.current||g(!0)},i))}},floating:{onMouseEnter(){clearTimeout(l.current)},onMouseLeave(){S.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),A(!1)}}}},[S,r,i,f,g,A])},IP=P.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),DP=()=>P.useContext(IP),X6=e=>{let{children:t,delay:r,timeoutMs:n=0}=e;const[o,a]=P.useReducer((f,g)=>({...f,...g}),{delay:r,timeoutMs:n,initialDelay:r,currentId:null,isInstantPhase:!1}),i=P.useRef(null),c=P.useCallback(f=>{a({currentId:f})},[]);return Jt(()=>{o.currentId?i.current===null?i.current=o.currentId:a({isInstantPhase:!0}):(a({isInstantPhase:!1}),i.current=null)},[o.currentId]),P.createElement(IP.Provider,{value:P.useMemo(()=>({...o,setState:a,setCurrentId:c}),[o,a,c])},t)},Z6=(e,t)=>{let{open:r,onOpenChange:n}=e,{id:o}=t;const{currentId:a,setCurrentId:i,initialDelay:c,setState:f,timeoutMs:g}=DP();P.useEffect(()=>{a&&(f({delay:{open:1,close:Zc(c,"close")}}),a!==o&&n(!1))},[o,n,f,a,c]),P.useEffect(()=>{function b(){n(!1),f({delay:c,currentId:null})}if(!r&&a===o)if(g){const S=window.setTimeout(b,g);return()=>{clearTimeout(S)}}else b()},[r,f,a,o,n,c,g]),P.useEffect(()=>{r&&i(o)},[r,i,o])};function su(){return su=Object.assign||function(e){for(var t=1;te==null?void 0:e.focus({preventScroll:r});o?a():Ew=requestAnimationFrame(a)}function J6(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 Al(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 c;return o.parentId===i.id&&((c=o.context)==null?void 0:c.open)})})||[],r=r.concat(n);return r}function Hf(e){return"composedPath"in e?e.composedPath()[0]:e.target}const ez="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function LP(e){return ui(e)&&e.matches(ez)}function wn(e){e.preventDefault(),e.stopPropagation()}const Jd=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function FP(e,t){const r=Gd(e,Jd());t==="prev"&&r.reverse();const n=r.indexOf(ci(Yr(e)));return r.slice(n+1)[0]}function zP(){return FP(document.body,"next")}function BP(){return FP(document.body,"prev")}function Rl(e,t){const r=t||e.currentTarget,n=e.relatedTarget;return!n||!Hr(r,n)}function tz(e){Gd(e,Jd()).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function rz(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 nz=wg["useInsertionEffect".toString()],oz=nz||(e=>e());function Ms(e){const t=P.useRef(()=>{});return oz(()=>{t.current=e}),P.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o(lg()&&a("button"),document.addEventListener("keydown",jw),()=>{document.removeEventListener("keydown",jw)}),[]),P.createElement("span",su({},t,{ref:r,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:bb,onFocus:i=>{lg()&&MP()&&!az(i)?(i.persist(),vb=window.setTimeout(()=>{n(i)},50)):n(i)}}))}),VP=P.createContext(null),UP=function(e){let{id:t,enabled:r=!0}=e===void 0?{}:e;const[n,o]=P.useState(null),a=iu(),i=WP();return Jt(()=>{if(!r)return;const c=t?document.getElementById(t):null;if(c)c.setAttribute("data-floating-ui-portal",""),o(c);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},iz=e=>{let{children:t,id:r,root:n=null,preserveTabOrder:o=!0}=e;const a=UP({id:r,enabled:!n}),[i,c]=P.useState(null),f=P.useRef(null),g=P.useRef(null),b=P.useRef(null),S=P.useRef(null),O=!!i&&!i.modal&&!!(n||a)&&o;return P.useEffect(()=>{if(!a||!o||i!=null&&i.modal)return;function T(C){a&&Rl(C)&&(C.type==="focusin"?rz:tz)(a)}return a.addEventListener("focusin",T,!0),a.addEventListener("focusout",T,!0),()=>{a.removeEventListener("focusin",T,!0),a.removeEventListener("focusout",T,!0)}},[a,o,i==null?void 0:i.modal]),P.createElement(VP.Provider,{value:P.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:b,afterInsideRef:S,portalNode:a,setFocusManagerState:c}),[o,a])},O&&a&&P.createElement(ef,{"data-type":"outside",ref:f,onFocus:T=>{if(Rl(T,a)){var C;(C=b.current)==null||C.focus()}else{const x=BP()||(i==null?void 0:i.refs.domReference.current);x==null||x.focus()}}}),O&&a&&P.createElement("span",{"aria-owns":a.id,style:bb}),n?Uo.createPortal(t,n):a?Uo.createPortal(t,a):null,O&&a&&P.createElement(ef,{"data-type":"outside",ref:g,onFocus:T=>{if(Rl(T,a)){var C;(C=S.current)==null||C.focus()}else{const x=zP()||(i==null?void 0:i.refs.domReference.current);x==null||x.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1))}}}))},WP=()=>P.useContext(VP),sz=P.forwardRef(function(t,r){return P.createElement("button",su({},t,{type:"button",ref:r,tabIndex:-1,style:bb}))});function lz(e){let{context:t,children:r,order:n=["content"],guards:o=!0,initialFocus:a=0,returnFocus:i=!0,modal:c=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:g=!0}=e;const{refs:b,nodeId:S,onOpenChange:O,events:T,dataRef:C,elements:{domReference:x,floating:m}}=t,d=Pn(n),s=vi(),u=WP(),[l,h]=P.useState(null),v=typeof a=="number"&&a<0,w=P.useRef(null),j=P.useRef(null),N=P.useRef(!1),k=P.useRef(null),A=P.useRef(!1),M=u!=null,D=x&&x.getAttribute("role")==="combobox"&&LP(x),L=P.useCallback(function(q){return q===void 0&&(q=m),q?Gd(q,Jd()):[]},[m]),B=P.useCallback(q=>{const z=L(q);return d.current.map($=>x&&$==="reference"?x:m&&$==="floating"?m:z).filter(Boolean).flat()},[x,m,d,L]);P.useEffect(()=>{if(!c)return;function q($){if($.key==="Tab"){L().length===0&&!D&&wn($);const K=B(),X=Hf($);d.current[0]==="reference"&&X===x&&(wn($),$.shiftKey?oa(K[K.length-1]):oa(K[1])),d.current[1]==="floating"&&X===m&&$.shiftKey&&(wn($),oa(K[0]))}}const z=Yr(m);return z.addEventListener("keydown",q),()=>{z.removeEventListener("keydown",q)}},[x,m,c,d,b,D,L,B]),P.useEffect(()=>{if(!g)return;function q(){A.current=!0,setTimeout(()=>{A.current=!1})}function z($){const K=$.relatedTarget,X=!(Hr(x,K)||Hr(m,K)||Hr(K,m)||Hr(u==null?void 0:u.portalNode,K)||K!=null&&K.hasAttribute("data-floating-ui-focus-guard")||s&&(Al(s.nodesRef.current,S).find(te=>{var me,de;return Hr((me=te.context)==null?void 0:me.elements.floating,K)||Hr((de=te.context)==null?void 0:de.elements.domReference,K)})||J6(s.nodesRef.current,S).find(te=>{var me,de;return((me=te.context)==null?void 0:me.elements.floating)===K||((de=te.context)==null?void 0:de.elements.domReference)===K})));K&&X&&!A.current&&K!==k.current&&(N.current=!0,setTimeout(()=>O(!1)))}if(m&&ui(x))return x.addEventListener("focusout",z),x.addEventListener("pointerdown",q),!c&&m.addEventListener("focusout",z),()=>{x.removeEventListener("focusout",z),x.removeEventListener("pointerdown",q),!c&&m.removeEventListener("focusout",z)}},[x,m,c,S,s,u,O,g]),P.useEffect(()=>{var q;const z=Array.from((u==null||(q=u.portalNode)==null?void 0:q.querySelectorAll("[data-floating-ui-portal]"))||[]);function $(){return[w.current,j.current].filter(Boolean)}if(m&&c){const K=[m,...z,...$()],X=_F(d.current.includes("reference")||D?K.concat(x||[]):K);return()=>{X()}}},[x,m,c,d,u,D]),P.useEffect(()=>{if(c&&!o&&m){const q=[],z=Jd(),$=Gd(Yr(m).body,z),K=B(),X=$.filter(te=>!K.includes(te));return X.forEach((te,me)=>{q[me]=te.getAttribute("tabindex"),te.setAttribute("tabindex","-1")}),()=>{X.forEach((te,me)=>{const de=q[me];de==null?te.removeAttribute("tabindex"):te.setAttribute("tabindex",de)})}}},[m,c,o,B]),Jt(()=>{if(!m)return;const q=Yr(m);let z=i,$=!1;const K=ci(q),X=C.current;k.current=K;const te=B(m),me=(typeof a=="number"?te[a]:a.current)||m;!v&&oa(me,{preventScroll:me===m});function de(ee){if(ee.type==="escapeKey"&&b.domReference.current&&(k.current=b.domReference.current),["referencePress","escapeKey"].includes(ee.type))return;const Se=ee.data.returnFocus;typeof Se=="object"?(z=!0,$=Se.preventScroll):z=Se}return T.on("dismiss",de),()=>{if(T.off("dismiss",de),Hr(m,ci(q))&&b.domReference.current&&(k.current=b.domReference.current),z&&ui(k.current)&&!N.current)if(!b.domReference.current||A.current)oa(k.current,{cancelPrevious:!1,preventScroll:$});else{var ee;X.__syncReturnFocus=!0,(ee=k.current)==null||ee.focus({preventScroll:$}),setTimeout(()=>{delete X.__syncReturnFocus})}}},[m,B,a,i,C,b,T,v]),Jt(()=>{if(u)return u.setFocusManagerState({...t,modal:c,closeOnFocusOut:g}),()=>{u.setFocusManagerState(null)}},[u,c,g,t]),Jt(()=>{if(v||!m)return;function q(){h(L().length)}if(q(),typeof MutationObserver=="function"){const z=new MutationObserver(q);return z.observe(m,{childList:!0,subtree:!0}),()=>{z.disconnect()}}},[m,L,v,b]);const U=o&&(M||c)&&!D;function Y(q){return f&&c?P.createElement(sz,{ref:q==="start"?w:j,onClick:()=>O(!1)},typeof f=="string"?f:"Dismiss"):null}return P.createElement(P.Fragment,null,U&&P.createElement(ef,{"data-type":"inside",ref:u==null?void 0:u.beforeInsideRef,onFocus:q=>{if(c){const $=B();oa(n[0]==="reference"?$[0]:$[$.length-1])}else if(u!=null&&u.preserveTabOrder&&u.portalNode)if(N.current=!1,Rl(q,u.portalNode)){const $=zP()||x;$==null||$.focus()}else{var z;(z=u.beforeOutsideRef.current)==null||z.focus()}}}),D?null:Y("start"),P.cloneElement(r,l===0||n.includes("floating")?{tabIndex:0}:{}),Y("end"),U&&P.createElement(ef,{"data-type":"inside",ref:u==null?void 0:u.afterInsideRef,onFocus:q=>{if(c)oa(B()[0]);else if(u!=null&&u.preserveTabOrder&&u.portalNode)if(N.current=!0,Rl(q,u.portalNode)){const $=BP()||x;$==null||$.focus()}else{var z;(z=u.afterOutsideRef.current)==null||z.focus()}}}))}const wc="data-floating-ui-scroll-lock",uz=P.forwardRef(function(t,r){let{lockScroll:n=!1,...o}=t;return Jt(()=>{var a,i;if(!n||document.body.hasAttribute(wc))return;document.body.setAttribute(wc,"");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(gb()))return Object.assign(document.body.style,{overflow:"hidden",[g]:b+"px"}),()=>{document.body.removeAttribute(wc),Object.assign(document.body.style,{overflow:"",[g]:""})};const S=((a=window.visualViewport)==null?void 0:a.offsetLeft)||0,O=((i=window.visualViewport)==null?void 0:i.offsetTop)||0,T=window.pageXOffset,C=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(C-Math.floor(O))+"px",left:-(T-Math.floor(S))+"px",right:"0",[g]:b+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[g]:""}),document.body.removeAttribute(wc),window.scrollTo(T,C)}},[n]),P.createElement("div",su({ref:r},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function Aw(e){return ui(e.target)&&e.target.tagName==="BUTTON"}function Rw(e){return LP(e)}const cz=function(e,t){let{open:r,onOpenChange:n,dataRef:o,elements:{domReference:a}}=e,{enabled:i=!0,event:c="click",toggle:f=!0,ignoreMouse:g=!1,keyboardHandlers:b=!0}=t===void 0?{}:t;const S=P.useRef();return P.useMemo(()=>i?{reference:{onPointerDown(O){S.current=O.pointerType},onMouseDown(O){O.button===0&&(Zd(S.current,!0)&&g||c!=="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(c==="mousedown"&&S.current){S.current=void 0;return}Zd(S.current,!0)&&g||(r?f&&(!o.current.openEvent||o.current.openEvent.type==="click")&&n(!1):n(!0),o.current.openEvent=O.nativeEvent)}},onKeyDown(O){S.current=void 0,b&&(Aw(O)||(O.key===" "&&!Rw(a)&&O.preventDefault(),O.key==="Enter"&&(r?f&&n(!1):n(!0))))},onKeyUp(O){b&&(Aw(O)||Rw(a)||O.key===" "&&(r?f&&n(!1):n(!0)))}}}:{},[i,o,c,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 dz={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},fz={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pz=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}},hz=function(e,t){let{open:r,onOpenChange:n,events:o,nodeId:a,elements:{reference:i,domReference:c,floating:f},dataRef:g}=e,{enabled:b=!0,escapeKey:S=!0,outsidePress:O=!0,outsidePressEvent:T="pointerdown",referencePress:C=!1,referencePressEvent:x="pointerdown",ancestorScroll:m=!1,bubbles:d=!0}=t===void 0?{}:t;const s=vi(),u=Rs()!=null,l=Ms(typeof O=="function"?O:()=>!1),h=typeof O=="function"?l:O,v=P.useRef(!1),{escapeKeyBubbles:w,outsidePressBubbles:j}=pz(d);return P.useEffect(()=>{if(!r||!b)return;g.current.__escapeKeyBubbles=w,g.current.__outsidePressBubbles=j;function N(L){if(L.key==="Escape"){const B=s?Al(s.nodesRef.current,a):[];if(B.length>0){let U=!0;if(B.forEach(Y=>{var q;if((q=Y.context)!=null&&q.open&&!Y.context.dataRef.current.__escapeKeyBubbles){U=!1;return}}),!U)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function k(L){const B=v.current;if(v.current=!1,B||typeof h=="function"&&!h(L))return;const U=Hf(L);if(ui(U)&&f){const z=f.ownerDocument.defaultView||window,$=U.scrollWidth>U.clientWidth,K=U.scrollHeight>U.clientHeight;let X=K&&L.offsetX>U.clientWidth;if(K&&z.getComputedStyle(U).direction==="rtl"&&(X=L.offsetX<=U.offsetWidth-U.clientWidth),X||$&&L.offsetY>U.clientHeight)return}const Y=s&&Al(s.nodesRef.current,a).some(z=>{var $;return Jc(L,($=z.context)==null?void 0:$.elements.floating)});if(Jc(L,f)||Jc(L,c)||Y)return;const q=s?Al(s.nodesRef.current,a):[];if(q.length>0){let z=!0;if(q.forEach($=>{var K;if((K=$.context)!=null&&K.open&&!$.context.dataRef.current.__outsidePressBubbles){z=!1;return}}),!z)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:u?{preventScroll:!0}:AP(L)||RP(L)}}),n(!1)}function A(){n(!1)}const M=Yr(f);S&&M.addEventListener("keydown",N),h&&M.addEventListener(T,k);let D=[];return m&&(On(c)&&(D=Lo(c)),On(f)&&(D=D.concat(Lo(f))),!On(i)&&i&&i.contextElement&&(D=D.concat(Lo(i.contextElement)))),D=D.filter(L=>{var B;return L!==((B=M.defaultView)==null?void 0:B.visualViewport)}),D.forEach(L=>{L.addEventListener("scroll",A,{passive:!0})}),()=>{S&&M.removeEventListener("keydown",N),h&&M.removeEventListener(T,k),D.forEach(L=>{L.removeEventListener("scroll",A)})}},[g,f,c,i,S,h,T,o,s,a,r,n,m,b,w,j,u]),P.useEffect(()=>{v.current=!1},[h,T]),P.useMemo(()=>b?{reference:{[dz[x]]:()=>{C&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[fz[T]]:()=>{v.current=!0}}}:{},[b,o,C,T,x,n])},gz=function(e,t){let{open:r,onOpenChange:n,dataRef:o,events:a,refs:i,elements:{floating:c,domReference:f}}=e,{enabled:g=!0,keyboardOnly:b=!0}=t===void 0?{}:t;const S=P.useRef(""),O=P.useRef(!1),T=P.useRef();return P.useEffect(()=>{if(!g)return;const x=Yr(c).defaultView||window;function m(){!r&&ui(f)&&f===ci(Yr(f))&&(O.current=!0)}return x.addEventListener("blur",m),()=>{x.removeEventListener("blur",m)}},[c,f,r,g]),P.useEffect(()=>{if(!g)return;function C(x){(x.type==="referencePress"||x.type==="escapeKey")&&(O.current=!0)}return a.on("dismiss",C),()=>{a.off("dismiss",C)}},[a,g]),P.useEffect(()=>()=>{clearTimeout(T.current)},[]),P.useMemo(()=>g?{reference:{onPointerDown(C){let{pointerType:x}=C;S.current=x,O.current=!!(x&&b)},onMouseLeave(){O.current=!1},onFocus(C){var x;O.current||C.type==="focus"&&((x=o.current.openEvent)==null?void 0:x.type)==="mousedown"&&o.current.openEvent&&Jc(o.current.openEvent,f)||(o.current.openEvent=C.nativeEvent,n(!0))},onBlur(C){O.current=!1;const x=C.relatedTarget,m=On(x)&&x.hasAttribute("data-floating-ui-focus-guard")&&x.getAttribute("data-type")==="outside";T.current=setTimeout(()=>{Hr(i.floating.current,x)||Hr(f,x)||m||n(!1)})}}}:{},[g,b,f,i,o,n])};let Mw=!1;const yb="ArrowUp",qf="ArrowDown",xs="ArrowLeft",Cu="ArrowRight";function _c(e,t,r){return Math.floor(e/t)!==r}function ul(e,t){return t<0||t>=e.current.length}function Er(e,t){let{startingIndex:r=-1,decrement:n=!1,disabledIndices:o,amount:a=1}=t===void 0?{}:t;const i=e.current;let c=r;do{var f,g;c=c+(n?-a:a)}while(c>=0&&c<=i.length-1&&(o?o.includes(c):i[c]==null||(f=i[c])!=null&&f.hasAttribute("disabled")||((g=i[c])==null?void 0:g.getAttribute("aria-disabled"))==="true"));return c}function Gf(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function Iw(e,t){return Gf(t,e===yb||e===qf,e===xs||e===Cu)}function Sh(e,t,r){return Gf(t,e===qf,r?e===xs:e===Cu)||e==="Enter"||e==" "||e===""}function mz(e,t,r){return Gf(t,r?e===xs:e===Cu,e===qf)}function bz(e,t,r){return Gf(t,r?e===Cu:e===xs,e===yb)}function Ch(e,t){return Er(e,{disabledIndices:t})}function Dw(e,t){return Er(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const vz=function(e,t){let{open:r,onOpenChange:n,refs:o,elements:{domReference:a}}=e,{listRef:i,activeIndex:c,onNavigate:f=()=>{},enabled:g=!0,selectedIndex:b=null,allowEscape:S=!1,loop:O=!1,nested:T=!1,rtl:C=!1,virtual:x=!1,focusItemOnOpen:m="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:s=!0,disabledIndices:u=void 0,orientation:l="vertical",cols:h=1,scrollItemIntoView:v=!0}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;const w=Rs(),j=vi(),N=Ms(f),k=P.useRef(m),A=P.useRef(b??-1),M=P.useRef(null),D=P.useRef(!0),L=P.useRef(N),B=P.useRef(r),U=P.useRef(!1),Y=P.useRef(!1),q=Pn(u),z=Pn(r),$=Pn(v),[K,X]=P.useState(),te=P.useCallback(function(ee,Se,pe){pe===void 0&&(pe=!1);const fe=ee.current[Se.current];x?X(fe==null?void 0:fe.id):oa(fe,{preventScroll:!0,sync:MP()&&lg()?Mw||U.current:!1}),requestAnimationFrame(()=>{const be=$.current;be&&fe&&(pe||!D.current)&&(fe.scrollIntoView==null||fe.scrollIntoView(typeof be=="boolean"?{block:"nearest",inline:"nearest"}:be))})},[x,$]);Jt(()=>{document.createElement("div").focus({get preventScroll(){return Mw=!0,!1}})},[]),Jt(()=>{g&&(r?k.current&&b!=null&&(Y.current=!0,N(b)):B.current&&(A.current=-1,L.current(null)))},[g,r,b,N]),Jt(()=>{if(g&&r)if(c==null){if(U.current=!1,b!=null)return;B.current&&(A.current=-1,te(i,A)),!B.current&&k.current&&(M.current!=null||k.current===!0&&M.current==null)&&(A.current=M.current==null||Sh(M.current,l,C)||T?Ch(i,q.current):Dw(i,q.current),N(A.current))}else ul(i,c)||(A.current=c,te(i,A,Y.current),Y.current=!1)},[g,r,c,b,T,i,l,C,N,te,q]),Jt(()=>{if(g&&B.current&&!r){var ee,Se;const pe=j==null||(ee=j.nodesRef.current.find(fe=>fe.id===w))==null||(Se=ee.context)==null?void 0:Se.elements.floating;pe&&!Hr(pe,ci(Yr(pe)))&&pe.focus({preventScroll:!0})}},[g,r,j,w]),Jt(()=>{M.current=null,L.current=N,B.current=r});const me=c!=null,de=P.useMemo(()=>{function ee(pe){if(!r)return;const fe=i.current.indexOf(pe);fe!==-1&&N(fe)}return{onFocus(pe){let{currentTarget:fe}=pe;ee(fe)},onClick:pe=>{let{currentTarget:fe}=pe;return fe.focus({preventScroll:!0})},...d&&{onMouseMove(pe){let{currentTarget:fe}=pe;ee(fe)},onPointerLeave(){if(D.current&&(A.current=-1,te(i,A),Uo.flushSync(()=>N(null)),!x)){var pe;(pe=o.floating.current)==null||pe.focus({preventScroll:!0})}}}}},[r,o,te,d,i,N,x]);return P.useMemo(()=>{if(!g)return{};const ee=q.current;function Se(ye){if(D.current=!1,U.current=!0,!z.current&&ye.currentTarget===o.floating.current)return;if(T&&bz(ye.key,l,C)){wn(ye),n(!1),ui(a)&&a.focus();return}const Pe=A.current,Me=Ch(i,ee),ke=Dw(i,ee);if(ye.key==="Home"&&(A.current=Me,N(A.current)),ye.key==="End"&&(A.current=ke,N(A.current)),h>1){const ce=A.current;if(ye.key===yb){if(wn(ye),ce===-1)A.current=ke;else if(A.current=Er(i,{startingIndex:ce,amount:h,decrement:!0,disabledIndices:ee}),O&&(ce-hje?qe:qe-h}ul(i,A.current)&&(A.current=ce),N(A.current)}if(ye.key===qf&&(wn(ye),ce===-1?A.current=Me:(A.current=Er(i,{startingIndex:ce,amount:h,disabledIndices:ee}),O&&ce+h>ke&&(A.current=Er(i,{startingIndex:ce%h-h,amount:h,disabledIndices:ee}))),ul(i,A.current)&&(A.current=ce),N(A.current)),l==="both"){const je=Math.floor(ce/h);ye.key===Cu&&(wn(ye),ce%h!==h-1?(A.current=Er(i,{startingIndex:ce,disabledIndices:ee}),O&&_c(A.current,h,je)&&(A.current=Er(i,{startingIndex:ce-ce%h-1,disabledIndices:ee}))):O&&(A.current=Er(i,{startingIndex:ce-ce%h-1,disabledIndices:ee})),_c(A.current,h,je)&&(A.current=ce)),ye.key===xs&&(wn(ye),ce%h!==0?(A.current=Er(i,{startingIndex:ce,disabledIndices:ee,decrement:!0}),O&&_c(A.current,h,je)&&(A.current=Er(i,{startingIndex:ce+(h-ce%h),decrement:!0,disabledIndices:ee}))):O&&(A.current=Er(i,{startingIndex:ce+(h-ce%h),decrement:!0,disabledIndices:ee})),_c(A.current,h,je)&&(A.current=ce));const He=Math.floor(ke/h)===je;ul(i,A.current)&&(O&&He?A.current=ye.key===xs?ke:Er(i,{startingIndex:ce-ce%h-1,disabledIndices:ee}):A.current=ce),N(A.current);return}}if(Iw(ye.key,l)){if(wn(ye),r&&!x&&ci(ye.currentTarget.ownerDocument)===ye.currentTarget){A.current=Sh(ye.key,l,C)?Me:ke,N(A.current);return}Sh(ye.key,l,C)?O?A.current=Pe>=ke?S&&Pe!==i.current.length?-1:Me:Er(i,{startingIndex:Pe,disabledIndices:ee}):A.current=Math.min(ke,Er(i,{startingIndex:Pe,disabledIndices:ee})):O?A.current=Pe<=Me?S&&Pe!==-1?i.current.length:ke:Er(i,{startingIndex:Pe,decrement:!0,disabledIndices:ee}):A.current=Math.max(Me,Er(i,{startingIndex:Pe,decrement:!0,disabledIndices:ee})),ul(i,A.current)?N(null):N(A.current)}}function pe(ye){m==="auto"&&AP(ye.nativeEvent)&&(k.current=!0)}function fe(ye){k.current=m,m==="auto"&&RP(ye.nativeEvent)&&(k.current=!0)}const be=x&&r&&me&&{"aria-activedescendant":K};return{reference:{...be,onKeyDown(ye){D.current=!1;const Pe=ye.key.indexOf("Arrow")===0;if(x&&r)return Se(ye);if(!r&&!s&&Pe)return;if((Pe||ye.key==="Enter"||ye.key===" "||ye.key==="")&&(M.current=ye.key),T){mz(ye.key,l,C)&&(wn(ye),r?(A.current=Ch(i,ee),N(A.current)):n(!0));return}Iw(ye.key,l)&&(b!=null&&(A.current=b),wn(ye),!r&&s?n(!0):Se(ye),r&&N(A.current))},onFocus(){r&&N(null)},onPointerDown:fe,onMouseDown:pe,onClick:pe},floating:{"aria-orientation":l==="both"?void 0:l,...be,onKeyDown:Se,onPointerMove(){D.current=!0}},item:de}},[a,o,K,q,z,i,g,l,C,x,r,me,T,b,s,S,h,O,m,N,n,de])};function yz(e){return P.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})},e)}const xz=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const a=iu(),i=iu();return P.useMemo(()=>{const c={id:a,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?a:void 0},floating:c}:{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:{...c,...o==="menu"&&{"aria-labelledby":i}}}:{}},[n,o,r,a,i])},Lw=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,r)=>(r?"-":"")+t.toLowerCase());function wz(e,t){const[r,n]=P.useState(e);return e&&!r&&n(!0),P.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,[c,f]=P.useState(!1),[g,b]=P.useState("unmounted"),S=wz(r,i);return Jt(()=>{c&&!S&&b("unmounted")},[c,S]),Jt(()=>{if(n)if(r){b("initial");const O=requestAnimationFrame(()=>{b("open")});return()=>{cancelAnimationFrame(O)}}else f(!0),b("close")},[r,n]),{isMounted:S,status:g}}function _z(e,t){let{initial:r={opacity:0},open:n,close:o,common:a,duration:i=250}=t===void 0?{}:t;const c=e.placement,f=c.split("-")[0],[g,b]=P.useState({}),{isMounted:S,status:O}=$P(e,{duration:i}),T=Pn(r),C=Pn(n),x=Pn(o),m=Pn(a),d=typeof i=="number",s=(d?i:i.open)||0,u=(d?i:i.close)||0;return Jt(()=>{const l={side:f,placement:c},h=T.current,v=x.current,w=C.current,j=m.current,N=typeof h=="function"?h(l):h,k=typeof v=="function"?v(l):v,A=typeof j=="function"?j(l):j,M=(typeof w=="function"?w(l):w)||Object.keys(N).reduce((D,L)=>(D[L]="",D),{});if(O==="initial"&&b(D=>({transitionProperty:D.transitionProperty,...A,...N})),O==="open"&&b({transitionProperty:Object.keys(M).map(Lw).join(","),transitionDuration:s+"ms",...A,...M}),O==="close"){const D=k||N;b({transitionProperty:Object.keys(D).map(Lw).join(","),transitionDuration:u+"ms",...A,...D})}},[f,c,u,x,T,C,m,s,O]),{isMounted:S,styles:g}}const Sz=function(e,t){var r;let{open:n,dataRef:o}=e,{listRef:a,activeIndex:i,onMatch:c=()=>{},enabled:f=!0,findMatch:g=null,resetMs:b=1e3,ignoreKeys:S=[],selectedIndex:O=null}=t===void 0?{listRef:{current:[]},activeIndex:null}:t;const T=P.useRef(),C=P.useRef(""),x=P.useRef((r=O??i)!=null?r:-1),m=P.useRef(null),d=Ms(c),s=Pn(g),u=Pn(S);return Jt(()=>{n&&(clearTimeout(T.current),m.current=null,C.current="")},[n]),Jt(()=>{if(n&&C.current===""){var l;x.current=(l=O??i)!=null?l:-1}},[n,O,i]),P.useMemo(()=>{if(!f)return{};function l(h){const v=Hf(h.nativeEvent);if(On(v)&&(ci(Yr(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===" "&&wn(h));const w=a.current;if(w==null||u.current.includes(h.key)||h.key.length!==1||h.ctrlKey||h.metaKey||h.altKey)return;w.every(D=>{var L,B;return D?((L=D[0])==null?void 0:L.toLocaleLowerCase())!==((B=D[1])==null?void 0:B.toLocaleLowerCase()):!0})&&C.current===h.key&&(C.current="",x.current=m.current),C.current+=h.key,clearTimeout(T.current),T.current=setTimeout(()=>{C.current="",x.current=m.current,o.current.typing=!1},b);const N=x.current,k=[...w.slice((N||0)+1),...w.slice(0,(N||0)+1)],A=s.current?s.current(k,C.current):k.find(D=>(D==null?void 0:D.toLocaleLowerCase().indexOf(C.current.toLocaleLowerCase()))===0),M=A?w.indexOf(A):-1;M!==-1&&(d(M),m.current=M)}return{reference:{onKeyDown:l},floating:{onKeyDown:l}}},[f,o,a,b,u,s,d])};function Fw(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Cz=e=>({name:"inner",options:e,async fn(t){const{listRef:r,overflowRef:n,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:c=4,referenceOverflowThreshold:f=0,scrollRef:g,...b}=e,{rects:S,elements:{floating:O}}=t,T=r.current[i];if(!T)return{};const C={...t,...await OP(-T.offsetTop-S.reference.height/2-T.offsetHeight/2-a).fn(t)},x=(g==null?void 0:g.current)||O,m=await Qc(Fw(C,x.scrollHeight),b),d=await Qc(C,{...b,elementContext:"reference"}),s=Math.max(0,m.top),u=C.y+s,l=Math.max(0,x.scrollHeight-s-Math.max(0,m.bottom));return x.style.maxHeight=l+"px",x.scrollTop=s,o&&(x.offsetHeight=-f||d.bottom>=-f?Uo.flushSync(()=>o(!0)):Uo.flushSync(()=>o(!1))),n&&(n.current=await Qc(Fw({...C,y:u},x.offsetHeight),b)),{y:u}}}),Tz=(e,t)=>{let{open:r,elements:n}=e,{enabled:o=!0,overflowRef:a,scrollRef:i,onChange:c}=t;const f=Ms(c),g=P.useRef(!1),b=P.useRef(null),S=P.useRef(null);return P.useEffect(()=>{if(!o)return;function O(C){if(C.ctrlKey||!T||a.current==null)return;const x=C.deltaY,m=a.current.top>=-.5,d=a.current.bottom>=-.5,s=T.scrollHeight-T.clientHeight,u=x<0?-1:1,l=x<0?"max":"min";T.scrollHeight<=T.clientHeight||(!m&&x>0||!d&&x<0?(C.preventDefault(),Uo.flushSync(()=>{f(h=>h+Math[l](x,s*u))})):/firefox/i.test(jP())&&(T.scrollTop+=x))}const T=(i==null?void 0:i.current)||n.floating;if(r&&T)return T.addEventListener("wheel",O),requestAnimationFrame(()=>{b.current=T.scrollTop,a.current!=null&&(S.current={...a.current})}),()=>{b.current=null,S.current=null,T.removeEventListener("wheel",O)}},[o,r,n.floating,a,i,f]),P.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 T=O.scrollTop-b.current;(a.current.bottom<-.5&&T<-1||a.current.top<-.5&&T>1)&&Uo.flushSync(()=>f(C=>C+T))}requestAnimationFrame(()=>{b.current=O.scrollTop})}}}}:{},[o,a,n.floating,i,f])};function Oz(e,t){const[r,n]=e;let o=!1;const a=t.length;for(let i=0,c=a-1;i=n!=S>=n&&r<=(b-f)*(n-g)/(S-g)+f&&(o=!o)}return o}function Pz(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function kz(e){let{restMs:t=0,buffer:r=.5,blockPointerEvents:n=!1}=e===void 0?{}:e,o,a=!1,i=!1;const c=f=>{let{x:g,y:b,placement:S,elements:O,onClose:T,nodeId:C,tree:x}=f;return function(d){function s(){clearTimeout(o),T()}if(clearTimeout(o),!O.domReference||!O.floating||S==null||g==null||b==null)return;const{clientX:u,clientY:l}=d,h=[u,l],v=Hf(d),w=d.type==="mouseleave",j=Hr(O.floating,v),N=Hr(O.domReference,v),k=O.domReference.getBoundingClientRect(),A=O.floating.getBoundingClientRect(),M=S.split("-")[0],D=g>A.right-A.width/2,L=b>A.bottom-A.height/2,B=Pz(h,k);if(j&&(i=!0),N&&(i=!1),N&&!w){i=!0;return}if(w&&On(d.relatedTarget)&&Hr(O.floating,d.relatedTarget)||x&&Al(x.nodesRef.current,C).some(z=>{let{context:$}=z;return $==null?void 0:$.open}))return;if(M==="top"&&b>=k.bottom-1||M==="bottom"&&b<=k.top+1||M==="left"&&g>=k.right-1||M==="right"&&g<=k.left+1)return s();let U=[];switch(M){case"top":U=[[A.left,k.top+1],[A.left,A.bottom-1],[A.right,A.bottom-1],[A.right,k.top+1]],a=u>=A.left&&u<=A.right&&l>=A.top&&l<=k.top+1;break;case"bottom":U=[[A.left,A.top+1],[A.left,k.bottom-1],[A.right,k.bottom-1],[A.right,A.top+1]],a=u>=A.left&&u<=A.right&&l>=k.bottom-1&&l<=A.bottom;break;case"left":U=[[A.right-1,A.bottom],[A.right-1,A.top],[k.left+1,A.top],[k.left+1,A.bottom]],a=u>=A.left&&u<=k.left+1&&l>=A.top&&l<=A.bottom;break;case"right":U=[[k.right-1,A.bottom],[k.right-1,A.top],[A.left+1,A.top],[A.left+1,A.bottom]],a=u>=k.right-1&&u<=A.right&&l>=A.top&&l<=A.bottom;break}function Y(z){let[$,K]=z;const X=A.width>k.width,te=A.height>k.height;switch(M){case"top":{const me=[X?$+r/2:D?$+r*4:$-r*4,K+r+1],de=[X?$-r/2:D?$+r*4:$-r*4,K+r+1],ee=[[A.left,D||X?A.bottom-r:A.top],[A.right,D?X?A.bottom-r:A.top:A.bottom-r]];return[me,de,...ee]}case"bottom":{const me=[X?$+r/2:D?$+r*4:$-r*4,K-r],de=[X?$-r/2:D?$+r*4:$-r*4,K-r],ee=[[A.left,D||X?A.top+r:A.bottom],[A.right,D?X?A.top+r:A.bottom:A.top+r]];return[me,de,...ee]}case"left":{const me=[$+r+1,te?K+r/2:L?K+r*4:K-r*4],de=[$+r+1,te?K-r/2:L?K+r*4:K-r*4];return[...[[L||te?A.right-r:A.left,A.top],[L?te?A.right-r:A.left:A.right-r,A.bottom]],me,de]}case"right":{const me=[$-r,te?K+r/2:L?K+r*4:K-r*4],de=[$-r,te?K-r/2:L?K+r*4:K-r*4],ee=[[L||te?A.left+r:A.right,A.top],[L?te?A.left+r:A.right:A.left+r,A.bottom]];return[me,de,...ee]}}}const q=a?U:Y([g,b]);if(!a){if(i&&!B)return s();Oz([u,l],q)?t&&!i&&(o=setTimeout(s,t)):s()}}};return c.__options={blockPointerEvents:n},c}function Nz(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=U6(e),a=vi(),i=P.useRef(null),c=P.useRef({}),f=P.useState(()=>kP())[0],[g,b]=P.useState(null),S=P.useCallback(d=>{const s=On(d)?{getBoundingClientRect:()=>d.getBoundingClientRect(),contextElement:d}:d;o.refs.setReference(s)},[o.refs]),O=P.useCallback(d=>{(On(d)||d===null)&&(i.current=d,b(d)),(On(o.refs.reference.current)||o.refs.reference.current===null||d!==null&&!On(d))&&o.refs.setReference(d)},[o.refs]),T=P.useMemo(()=>({...o.refs,setReference:O,setPositionReference:S,domReference:i}),[o.refs,O,S]),C=P.useMemo(()=>({...o.elements,domReference:g}),[o.elements,g]),x=Ms(r),m=P.useMemo(()=>({...o,refs:T,elements:C,dataRef:c,nodeId:n,events:f,open:t,onOpenChange:x}),[o,n,f,t,x,T,C]);return Jt(()=>{const d=a==null?void 0:a.nodesRef.current.find(s=>s.id===n);d&&(d.context=m)}),P.useMemo(()=>({...o,context:m,refs:T,reference:O,positionReference:S}),[o,T,m,O,S])}function Th(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[c,f]=i;if(c.indexOf("on")===0){if(n.has(c)||n.set(c,[]),typeof f=="function"){var g;(g=n.get(c))==null||g.push(f),o[c]=function(){for(var b,S=arguments.length,O=new Array(S),T=0;TC(...O))}}}else o[c]=f}),o),{})}}const Ez=function(e){e===void 0&&(e=[]);const t=e,r=P.useCallback(a=>Th(a,e,"reference"),t),n=P.useCallback(a=>Th(a,e,"floating"),t),o=P.useCallback(a=>Th(a,e,"item"),e.map(a=>a==null?void 0:a.item));return P.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])},jz=Object.freeze(Object.defineProperty({__proto__:null,FloatingDelayGroup:X6,FloatingFocusManager:lz,FloatingNode:G6,FloatingOverlay:uz,FloatingPortal:iz,FloatingTree:K6,arrow:V6,autoPlacement:M6,autoUpdate:R6,computePosition:PP,detectOverflow:Qc,flip:D6,getOverflowAncestors:Lo,hide:F6,inline:z6,inner:Cz,limitShift:B6,offset:OP,platform:CP,safePolygon:kz,shift:I6,size:L6,useClick:cz,useDelayGroup:Z6,useDelayGroupContext:DP,useDismiss:hz,useFloating:Nz,useFloatingNodeId:q6,useFloatingParentNodeId:Rs,useFloatingPortalNode:UP,useFloatingTree:vi,useFocus:gz,useHover:Q6,useId:iu,useInnerOffset:Tz,useInteractions:Ez,useListNavigation:vz,useMergeRefs:yz,useRole:xz,useTransitionStatus:$P,useTransitionStyles:_z,useTypeahead:Sz},Symbol.toStringTag,{value:"Module"})),pr=lu(jz);var HP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,x){for(var m in x)Object.defineProperty(C,m,{enumerable:!0,get:x[m]})}t(e,{DialogHeader:function(){return O},default:function(){return T}});var r=g(P),n=g(ct),o=rt,a=g(et),i=Ze,c=Ns;function f(){return f=Object.assign||function(C){for(var x=1;x=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function S(C,x){if(C==null)return{};var m={},d=Object.keys(C),s,u;for(u=0;u=0)&&(m[s]=C[s]);return m}var O=r.default.forwardRef(function(C,x){var m=C.className,d=C.children,s=b(C,["className","children"]),u=(0,i.useTheme)().dialogHeader,l=u.defaultProps,h=u.styles.base;m=m??l.className;var v=(0,o.twMerge)((0,n.default)((0,a.default)(h)),m);return r.default.createElement("div",f({},s,{ref:x,className:v}),d)});O.propTypes={className:c.propTypesClassName,children:c.propTypesChildren},O.displayName="MaterialTailwind.DialogHeader";var T=O})(HP);var qP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(x,m){for(var d in m)Object.defineProperty(x,d,{enumerable:!0,get:m[d]})}t(e,{DialogBody:function(){return T},default:function(){return C}});var r=b(P),n=b(ct),o=rt,a=b(et),i=Ze,c=Ns;function f(x,m,d){return m in x?Object.defineProperty(x,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):x[m]=d,x}function g(){return g=Object.assign||function(x){for(var m=1;m=0)&&Object.prototype.propertyIsEnumerable.call(x,s)&&(d[s]=x[s])}return d}function O(x,m){if(x==null)return{};var d={},s=Object.keys(x),u,l;for(l=0;l=0)&&(d[u]=x[u]);return d}var T=r.default.forwardRef(function(x,m){var d=x.divider,s=x.className,u=x.children,l=S(x,["divider","className","children"]),h=(0,i.useTheme)().dialogBody,v=h.defaultProps,w=h.styles.base;s=s??v.className;var j=(0,o.twMerge)((0,n.default)((0,a.default)(w.initial),f({},(0,a.default)(w.divider),d)),s);return r.default.createElement("div",g({},l,{ref:m,className:j}),u)});T.propTypes={divider:c.propTypesDivider,className:c.propTypesClassName,children:c.propTypesChildren},T.displayName="MaterialTailwind.DialogBody";var C=T})(qP);var GP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,x){for(var m in x)Object.defineProperty(C,m,{enumerable:!0,get:x[m]})}t(e,{DialogFooter:function(){return O},default:function(){return T}});var r=g(P),n=g(ct),o=rt,a=g(et),i=Ze,c=Ns;function f(){return f=Object.assign||function(C){for(var x=1;x=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function S(C,x){if(C==null)return{};var m={},d=Object.keys(C),s,u;for(u=0;u=0)&&(m[s]=C[s]);return m}var O=r.default.forwardRef(function(C,x){var m=C.className,d=C.children,s=b(C,["className","children"]),u=(0,i.useTheme)().dialogFooter,l=u.defaultProps,h=u.styles.base;m=m??l.className;var v=(0,o.twMerge)((0,n.default)((0,a.default)(h)),m);return r.default.createElement("div",f({},s,{ref:x,className:v}),d)});O.propTypes={className:c.propTypesClassName,children:c.propTypesChildren},O.displayName="MaterialTailwind.DialogFooter";var T=O})(GP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(k,A){for(var M in A)Object.defineProperty(k,M,{enumerable:!0,get:A[M]})}t(e,{Dialog:function(){return j},DialogHeader:function(){return T.DialogHeader},DialogBody:function(){return C.DialogBody},DialogFooter:function(){return x.DialogFooter},default:function(){return N}});var r=s(P),n=s(nt),o=pr,a=xr,i=s(ct),c=s(Tr),f=rt,g=s(Xt),b=s(et),S=Ze,O=Ns,T=HP,C=qP,x=GP;function m(k,A,M){return A in k?Object.defineProperty(k,A,{value:M,enumerable:!0,configurable:!0,writable:!0}):k[A]=M,k}function d(){return d=Object.assign||function(k){for(var A=1;A=0)&&Object.prototype.propertyIsEnumerable.call(k,D)&&(M[D]=k[D])}return M}function w(k,A){if(k==null)return{};var M={},D=Object.keys(k),L,B;for(B=0;B=0)&&(M[L]=k[L]);return M}var j=r.default.forwardRef(function(k,A){var M=k.open,D=k.handler,L=k.size,B=k.dismiss,U=k.animate,Y=k.className,q=k.children,z=v(k,["open","handler","size","dismiss","animate","className","children"]),$=(0,S.useTheme)().dialog,K=$.defaultProps,X=$.valid,te=$.styles,me=te.base,de=te.sizes;D=D??void 0,L=L??K.size,B=B??K.dismiss,U=U??K.animate,Y=Y??K.className;var ee=(0,i.default)((0,b.default)(me.backdrop)),Se=(0,f.twMerge)((0,i.default)((0,b.default)(me.container),(0,b.default)(de[(0,g.default)(X.sizes,L,"md")])),Y),pe={unmount:{opacity:0,y:-50,transition:{duration:.3}},mount:{opacity:1,y:0,transition:{duration:.3}}},fe={unmount:{opacity:0,transition:{delay:.2}},mount:{opacity:1}},be=(0,c.default)(pe,U),ye=(0,o.useFloating)({open:M,onOpenChange:D}),Pe=ye.floating,Me=ye.context,ke=(0,o.useId)(),ce="".concat(ke,"-label"),je="".concat(ke,"-description"),He=(0,o.useInteractions)([(0,o.useClick)(Me),(0,o.useRole)(Me),(0,o.useDismiss)(Me,B)]).getFloatingProps,qe=(0,o.useMergeRefs)([A,Pe]),Je=a.AnimatePresence;return r.default.createElement(a.LazyMotion,{features:a.domAnimation},r.default.createElement(o.FloatingPortal,null,r.default.createElement(Je,null,M&&r.default.createElement(o.FloatingOverlay,{style:{zIndex:9999},lockScroll:!0},r.default.createElement(o.FloatingFocusManager,{context:Me},r.default.createElement(a.m.div,{className:L==="xxl"?"":ee,initial:"unmount",exit:"unmount",animate:M?"mount":"unmount",variants:fe,transition:{duration:.2}},r.default.createElement(a.m.div,d({},He(h(u({},z),{ref:qe,className:Se,"aria-labelledby":ce,"aria-describedby":je})),{initial:"unmount",exit:"unmount",animate:M?"mount":"unmount",variants:be}),q)))))))});j.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},j.displayName="MaterialTailwind.Dialog";var N=Object.assign(j,{Header:T.DialogHeader,Body:C.DialogBody,Footer:x.DialogFooter})})(sP);var KP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{Input:function(){return C},default:function(){return x}});var r=S(P),n=S(nt),o=S(ct),a=S(Xt),i=S(et),c=Ze,f=gu;function g(m,d,s){return d in m?Object.defineProperty(m,d,{value:s,enumerable:!0,configurable:!0,writable:!0}):m[d]=s,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,u)&&(s[u]=m[u])}return s}function T(m,d){if(m==null)return{};var s={},u=Object.keys(m),l,h;for(h=0;h=0)&&(s[l]=m[l]);return s}var C=r.default.forwardRef(function(m,d){var s=m.variant,u=m.color,l=m.size,h=m.label,v=m.error,w=m.success,j=m.icon,N=m.containerProps,k=m.labelProps,A=m.className,M=m.shrink,D=m.inputRef,L=O(m,["variant","color","size","label","error","success","icon","containerProps","labelProps","className","shrink","inputRef"]),B=(0,c.useTheme)().input,U=B.defaultProps,Y=B.valid,q=B.styles,z=q.base,$=q.variants;s=s??U.variant,l=l??U.size,u=u??U.color,h=h??U.label,k=k??U.labelProps,N=N??U.containerProps,A=A??U.className,M=M??U.shrink,j=j??U.icon;var K=$[(0,a.default)(Y.variants,s,"outlined")],X=K.sizes[(0,a.default)(Y.sizes,l,"md")],te=(0,i.default)(K.error.input),me=(0,i.default)(K.success.input),de=(0,i.default)(K.shrink.input),ee=(0,i.default)(K.colors.input[(0,a.default)(Y.colors,u,"gray")]),Se=(0,i.default)(K.error.label),pe=(0,i.default)(K.success.label),fe=(0,i.default)(K.shrink.label),be=(0,i.default)(K.colors.label[(0,a.default)(Y.colors,u,"gray")]),ye=(0,o.default)((0,i.default)(z.container),(0,i.default)(X.container),N==null?void 0:N.className),Pe=(0,o.default)((0,i.default)(z.input),(0,i.default)(K.base.input),(0,i.default)(X.input),g({},(0,i.default)(K.base.inputWithIcon),j),g({},ee,!v&&!w),g({},te,v),g({},me,w),g({},de,M),A),Me=(0,o.default)((0,i.default)(z.label),(0,i.default)(K.base.label),(0,i.default)(X.label),g({},be,!v&&!w),g({},Se,v),g({},pe,w),g({},fe,M),k==null?void 0:k.className),ke=(0,o.default)((0,i.default)(z.icon),(0,i.default)(K.base.icon),(0,i.default)(X.icon)),ce=(0,o.default)((0,i.default)(z.asterisk));return r.default.createElement("div",b({},N,{ref:d,className:ye}),j&&r.default.createElement("div",{className:ke},j),r.default.createElement("input",b({},L,{ref:D,className:Pe,placeholder:(L==null?void 0:L.placeholder)||" "})),r.default.createElement("label",b({},k,{className:Me}),h," ",L.required?r.default.createElement("span",{className:ce},"*"):""))});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 x=C})(KP);var YP={},Tu={},Is={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,h){for(var v in h)Object.defineProperty(l,v,{enumerable:!0,get:h[v]})}t(e,{propTypesOpen:function(){return g},propTypesHandler:function(){return b},propTypesPlacement:function(){return S},propTypesOffset:function(){return O},propTypesDismiss:function(){return T},propTypesAnimate:function(){return C},propTypesLockScroll:function(){return x},propTypesDisabled:function(){return m},propTypesClassName:function(){return d},propTypesChildren:function(){return s},propTypesContextValue:function(){return u}});var r=a(nt),n=Gt;function o(l,h,v){return h in l?Object.defineProperty(l,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[h]=v,l}function a(l){return l&&l.__esModule?l:{default:l}}function i(l){for(var h=1;hs.length)&&(u=s.length);for(var l=0,h=new Array(u);l=0)&&Object.prototype.propertyIsEnumerable.call(x,s)&&(d[s]=x[s])}return d}function O(x,m){if(x==null)return{};var d={},s=Object.keys(x),u,l;for(l=0;l=0)&&(d[u]=x[u]);return d}var T=r.default.forwardRef(function(x,m){var d=x.children,s=S(x,["children"]),u=(0,o.useMenu)(),l=u.getReferenceProps,h=u.reference,v=u.nested,w=(0,n.useMergeRefs)([m,h]);return r.default.cloneElement(d,f({},l(f(b(f({},s),{ref:w,onClick:function(N){N.stopPropagation()}}),v&&{role:"menuitem"}))))});T.propTypes={children:a.propTypesChildren},T.displayName="MaterialTailwind.MenuHandler";var C=T})(XP);var ZP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{MenuList:function(){return x},default:function(){return m}});var r=O(P),n=pr,o=xr,a=O(ct),i=rt,c=O(et),f=Ze,g=Tu,b=Is;function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.children,l=d.className,h=T(d,["children","className"]),v=(0,f.useTheme)().menu,w=v.styles.base,j=(0,g.useMenu)(),N=j.open,k=j.handler,A=j.strategy,M=j.x,D=j.y,L=j.floating,B=j.listItemsRef,U=j.getFloatingProps,Y=j.getItemProps,q=j.appliedAnimation,z=j.lockScroll,$=j.context,K=j.activeIndex,X=j.tree,te=j.allowHover,me=j.internalAllowHover,de=j.setActiveIndex,ee=j.nested;l=l??"";var Se=(0,i.twMerge)((0,a.default)((0,c.default)(w.menu)),l),pe=(0,n.useMergeRefs)([s,L]),fe=o.AnimatePresence,be=r.default.createElement(o.m.div,S({},h,{ref:pe,style:{position:A,top:D??0,left:M??0},className:Se},U({onKeyDown:function(Pe){Pe.key==="Tab"&&(k(!1),Pe.shiftKey&&Pe.preventDefault())}}),{initial:"unmount",exit:"unmount",animate:N?"mount":"unmount",variants:q}),r.default.Children.map(u,function(ye,Pe){return r.default.isValidElement(ye)&&r.default.cloneElement(ye,Y({tabIndex:K===Pe?0:-1,role:"menuitem",className:ye.props.className,ref:function(ke){B.current[Pe]=ke},onClick:function(ke){if(ye.props.onClick){var ce,je;(je=(ce=ye.props).onClick)===null||je===void 0||je.call(ce,ke)}X==null||X.events.emit("click")},onMouseEnter:function(){(te&&N||me&&N)&&de(Pe)}}))}));return r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(n.FloatingPortal,null,r.default.createElement(fe,null,N&&r.default.createElement(r.default.Fragment,null,z?r.default.createElement(n.FloatingOverlay,{lockScroll:!0},r.default.createElement(n.FloatingFocusManager,{context:$,modal:!ee,initialFocus:ee?-1:0,returnFocus:!ee,visuallyHiddenDismiss:!0},be)):r.default.createElement(n.FloatingFocusManager,{context:$,modal:!ee,initialFocus:ee?-1:0,returnFocus:!ee,visuallyHiddenDismiss:!0},be)))))});x.propTypes={className:b.propTypesClassName,children:b.propTypesChildren},x.displayName="MaterialTailwind.MenuList";var m=x})(ZP);var JP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(x,m){for(var d in m)Object.defineProperty(x,d,{enumerable:!0,get:m[d]})}t(e,{MenuItem:function(){return T},default:function(){return C}});var r=b(P),n=b(ct),o=rt,a=b(et),i=Ze,c=Is;function f(x,m,d){return m in x?Object.defineProperty(x,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):x[m]=d,x}function g(){return g=Object.assign||function(x){for(var m=1;m=0)&&Object.prototype.propertyIsEnumerable.call(x,s)&&(d[s]=x[s])}return d}function O(x,m){if(x==null)return{};var d={},s=Object.keys(x),u,l;for(l=0;l=0)&&(d[u]=x[u]);return d}var T=r.default.forwardRef(function(x,m){var d=x.className,s=d===void 0?"":d,u=x.disabled,l=u===void 0?!1:u,h=x.children,v=S(x,["className","disabled","children"]),w=(0,i.useTheme)().menu,j=w.styles.base,N=(0,o.twMerge)((0,n.default)((0,a.default)(j.item.initial),f({},(0,a.default)(j.item.disabled),l)),s);return r.default.createElement("button",g({},v,{ref:m,role:"menuitem",className:N}),h)});T.propTypes={className:c.propTypesClassName,disabled:c.propTypesDisabled,children:c.propTypesChildren},T.displayName="MaterialTailwind.MenuItem";var C=T})(JP);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(T,C){for(var x in C)Object.defineProperty(T,x,{enumerable:!0,get:C[x]})}t(e,{Menu:function(){return S},MenuHandler:function(){return i.MenuHandler},MenuList:function(){return c.MenuList},MenuItem:function(){return f.MenuItem},useMenu:function(){return o.useMenu},default:function(){return O}});var r=b(P),n=pr,o=Tu,a=QP,i=XP,c=ZP,f=JP;function g(){return g=Object.assign||function(T){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.open,l=d.animate,h=d.className,v=d.children,w=T(d,["open","animate","className","children"]),j;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 N=r.default.useRef(null),k=(0,g.useTheme)().navbar,A=k.styles,M=A.base.mobileNav;l=l??{},h=h??"";var D=(0,c.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((j=N.current)===null||j===void 0?void 0:j.scrollHeight,"px"),transition:{duration:.3,times:"[0.4, 0, 0.2, 1]"}}},B=(0,a.default)(L,l),U=n.AnimatePresence,Y=(0,o.useMergeRefs)([s,N]);return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(U,null,r.default.createElement(n.m.div,S({},w,{ref:Y,className:D,initial:"unmount",exit:"unmount",animate:u?"mount":"unmount",variants:B}),v)))});x.displayName="MaterialTailwind.MobileNav",x.propTypes={open:b.propTypesOpen,animate:b.propTypesAnimate,className:b.propTypesClassName,children:b.propTypesChildren};var m=x})(tk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Navbar:function(){return m},MobileNav:function(){return g.MobileNav},default:function(){return d}});var r=T(P),n=T(nt),o=T(ct),a=rt,i=T(Xt),c=T(et),f=Ze,g=tk,b=Pf;function S(s,u,l){return u in s?Object.defineProperty(s,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[u]=l,s}function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.variant,h=s.color,v=s.shadow,w=s.blurred,j=s.fullWidth,N=s.className,k=s.children,A=C(s,["variant","color","shadow","blurred","fullWidth","className","children"]),M=(0,f.useTheme)().navbar,D=M.defaultProps,L=M.valid,B=M.styles,U=B.base,Y=B.variants;l=l??D.variant,h=h??D.color,v=v??D.shadow,w=w??D.blurred,j=j??D.fullWidth,N=N??D.className;var q,z=(0,o.default)((0,c.default)(U.navbar.initial),(q={},S(q,(0,c.default)(U.navbar.shadow),v),S(q,(0,c.default)(U.navbar.blurred),w&&h==="white"),S(q,(0,c.default)(U.navbar.fullWidth),j),q)),$=(0,o.default)((0,c.default)(Y[(0,i.default)(L.variants,l,"filled")][(0,i.default)(L.colors,h,"white")])),K=(0,a.twMerge)((0,o.default)(z,$),N);return r.default.createElement("nav",O({},A,{ref:u,className:K}),k)});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})})(ek);var rk={},Kf={},Ds={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{propTypesOpen:function(){return a},propTypesHandler:function(){return i},propTypesPlacement:function(){return c},propTypesOffset:function(){return f},propTypesDismiss:function(){return g},propTypesAnimate:function(){return b},propTypesContent:function(){return S},propTypesInteractive:function(){return O},propTypesClassName:function(){return T},propTypesChildren:function(){return C},propTypesContextValue:function(){return x}});var r=o(nt),n=Gt;function o(m){return m&&m.__esModule?m:{default:m}}var a=r.default.bool,i=r.default.func,c=n.propTypesPlacements,f=n.propTypesOffsetType,g=n.propTypesDismissType,b=n.propTypesAnimation,S=r.default.node,O=r.default.bool,T=r.default.string,C=r.default.node.isRequired,x=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})(Ds);(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 c}});var r=o(P),n=Ds;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 c=function(f){var g=f.value,b=f.children;return r.default.createElement(a.Provider,{value:g},b)};c.propTypes={value:n.propTypesContextValue,children:n.propTypesChildren},c.displayName="MaterialTailwind.PopoverContextProvider"})(Kf);var nk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(x,m){for(var d in m)Object.defineProperty(x,d,{enumerable:!0,get:m[d]})}t(e,{PopoverHandler:function(){return T},default:function(){return C}});var r=c(P),n=pr,o=Kf,a=Ds;function i(x,m,d){return m in x?Object.defineProperty(x,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):x[m]=d,x}function c(x){return x&&x.__esModule?x:{default:x}}function f(x){for(var m=1;m=0)&&Object.prototype.propertyIsEnumerable.call(x,s)&&(d[s]=x[s])}return d}function O(x,m){if(x==null)return{};var d={},s=Object.keys(x),u,l;for(l=0;l=0)&&(d[u]=x[u]);return d}var T=r.default.forwardRef(function(x,m){var d=x.children,s=S(x,["children"]),u=(0,o.usePopover)(),l=u.getReferenceProps,h=u.reference,v=(0,n.useMergeRefs)([m,h]);return r.default.cloneElement(d,f({},l(b(f({},s),{ref:v}))))});T.propTypes={children:a.propTypesChildren},T.displayName="MaterialTailwind.PopoverHandler";var C=T})(nk);var ok={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(h,v){for(var w in v)Object.defineProperty(h,w,{enumerable:!0,get:v[w]})}t(e,{PopoverContent:function(){return u},default:function(){return l}});var r=T(P),n=pr,o=xr,a=T(ct),i=rt,c=T(et),f=Ze,g=Kf,b=Ds;function S(h,v,w){return v in h?Object.defineProperty(h,v,{value:w,enumerable:!0,configurable:!0,writable:!0}):h[v]=w,h}function O(){return O=Object.assign||function(h){for(var v=1;v=0)&&Object.prototype.propertyIsEnumerable.call(h,j)&&(w[j]=h[j])}return w}function s(h,v){if(h==null)return{};var w={},j=Object.keys(h),N,k;for(k=0;k=0)&&(w[N]=h[N]);return w}var u=r.default.forwardRef(function(h,v){var w=h.children,j=h.className,N=d(h,["children","className"]),k=(0,f.useTheme)().popover,A=k.defaultProps,M=k.styles.base,D=(0,g.usePopover)(),L=D.open,B=D.strategy,U=D.x,Y=D.y,q=D.context,z=D.floating,$=D.getFloatingProps,K=D.appliedAnimation,X=D.labelId,te=D.descriptionId;j=j??A.className;var me=(0,i.twMerge)((0,a.default)((0,c.default)(M)),j),de=(0,n.useMergeRefs)([v,z]),ee=o.AnimatePresence;return r.default.createElement(o.LazyMotion,{features:o.domAnimation},r.default.createElement(n.FloatingPortal,null,r.default.createElement(ee,null,L&&r.default.createElement(n.FloatingFocusManager,{context:q},r.default.createElement(o.m.div,O({},$(m(C({},N),{ref:de,className:me,style:{position:B,top:Y??"",left:U??""},"aria-labelledby":X,"aria-describedby":te})),{initial:"unmount",exit:"unmount",animate:L?"mount":"unmount",variants:K}),w)))))});u.propTypes={className:b.propTypesClassName,children:b.propTypesChildren},u.displayName="MaterialTailwind.PopoverContent";var l=u})(ok);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,h){for(var v in h)Object.defineProperty(l,v,{enumerable:!0,get:h[v]})}t(e,{Popover:function(){return s},PopoverHandler:function(){return g.PopoverHandler},PopoverContent:function(){return b.PopoverContent},usePopover:function(){return c.usePopover},default:function(){return u}});var r=T(P),n=T(nt),o=pr,a=T(Tr),i=Ze,c=Kf,f=Ds,g=nk,b=ok;function S(l,h){(h==null||h>l.length)&&(h=l.length);for(var v=0,w=new Array(h);v=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.variant,l=d.color,h=d.size,v=d.value,w=d.label,j=d.className,N=d.barProps,k=T(d,["variant","color","size","value","label","className","barProps"]),A=(0,f.useTheme)().progress,M=A.defaultProps,D=A.valid,L=A.styles,B=L.base,U=L.variants,Y=L.sizes;u=u??M.variant,l=l??M.color,h=h??M.size,w=w??M.label,j=j??M.className,N=N??M.barProps;var q=(0,c.default)(U[(0,i.default)(D.variants,u,"filled")][(0,i.default)(D.colors,l,"gray")]),z=(0,c.default)(Y[(0,i.default)(D.sizes,h,"md")].container.initial),$=(0,o.default)((0,c.default)(B.container.initial),z),K=(0,c.default)(Y[(0,i.default)(D.sizes,h,"md")].container.withLabel),X=(0,o.default)((0,c.default)(B.container.withLabel),K),te=(0,c.default)(Y[(0,i.default)(D.sizes,h,"md")].bar),me=(0,o.default)((0,c.default)(B.bar),te),de=(0,a.twMerge)((0,o.default)($,b({},X,w)),j),ee=(0,a.twMerge)((0,o.default)(me,q),N==null?void 0:N.className);return r.default.createElement("div",S({},k,{ref:s,className:de}),r.default.createElement("div",S({},N,{className:ee,style:{width:"".concat(v,"%")}}),w&&"".concat(v,"% ").concat(typeof w=="string"?w:"")))});x.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},x.displayName="MaterialTailwind.Progress";var m=x})(ak);var ik={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Radio:function(){return m},default:function(){return d}});var r=T(P),n=T(nt),o=T(js),a=T(ct),i=rt,c=T(Xt),f=T(et),g=Ze,b=mi;function S(s,u,l){return u in s?Object.defineProperty(s,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[u]=l,s}function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.color,h=s.label,v=s.icon,w=s.ripple,j=s.className,N=s.disabled,k=s.containerProps,A=s.labelProps,M=s.iconProps,D=s.inputRef,L=C(s,["color","label","icon","ripple","className","disabled","containerProps","labelProps","iconProps","inputRef"]),B=(0,g.useTheme)().radio,U=B.defaultProps,Y=B.valid,q=B.styles,z=q.base,$=q.colors,K=r.default.useId();l=l??U.color,h=h??U.label,v=v??U.icon,w=w??U.ripple,j=j??U.className,N=N??U.disabled,k=k??U.containerProps,A=A??U.labelProps,M=M??U.iconProps;var X=w!==void 0&&new o.default,te=(0,a.default)((0,f.default)(z.root),S({},(0,f.default)(z.disabled),N)),me=(0,i.twMerge)((0,a.default)((0,f.default)(z.container)),k==null?void 0:k.className),de=(0,i.twMerge)((0,a.default)((0,f.default)(z.input),(0,f.default)($[(0,c.default)(Y.colors,l,"gray")])),j),ee=(0,i.twMerge)((0,a.default)((0,f.default)(z.label)),A==null?void 0:A.className),Se=(0,a.default)((0,a.default)((0,f.default)(z.icon)),$[(0,c.default)(Y.colors,l,"gray")].color,M==null?void 0:M.className);return r.default.createElement("div",{ref:u,className:te},r.default.createElement("label",O({},k,{className:me,htmlFor:L.id||K,onMouseDown:function(pe){var fe=k==null?void 0:k.onMouseDown;return w&&X.create(pe,"dark"),typeof fe=="function"&&fe(pe)}}),r.default.createElement("input",O({},L,{ref:D,type:"radio",disabled:N,className:de,id:L.id||K})),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({},A,{className:ee,htmlFor:L.id||K}),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})(ik);var sk={},xb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(b,S){for(var O in S)Object.defineProperty(b,O,{enumerable:!0,get:S[O]})}t(e,{SelectContext:function(){return i},useSelect:function(){return c},usePrevious:function(){return f},SelectContextProvider:function(){return g}});var r=a(P),n=xr,o=mu;function a(b){return b&&b.__esModule?b:{default:b}}var i=r.default.createContext(null);i.displayName="MaterialTailwind.SelectContext";function c(){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 S=r.default.useRef();return(0,n.useIsomorphicLayoutEffect)(function(){S.current=b},[b]),S.current}var g=function(b){var S=b.value,O=b.children;return r.default.createElement(i.Provider,{value:S},O)};g.propTypes={value:o.propTypesContextValue,children:o.propTypesChildren},g.displayName="MaterialTailwind.SelectContextProvider"})(xb);var lk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{SelectOption:function(){return C},default:function(){return x}});var r=S(P),n=S(ct),o=rt,a=S(et),i=Ze,c=xb,f=mu;function g(m,d,s){return d in m?Object.defineProperty(m,d,{value:s,enumerable:!0,configurable:!0,writable:!0}):m[d]=s,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,u)&&(s[u]=m[u])}return s}function T(m,d){if(m==null)return{};var s={},u=Object.keys(m),l,h;for(h=0;h=0)&&(s[l]=m[l]);return s}var C=function(m){var d=function(){q(v),K(l),$(!1),te(null)},s=function(Pe){(Pe.key==="Enter"||Pe.key===" "&&!de.current.typing)&&(Pe.preventDefault(),d())},u=m.value,l=u===void 0?"":u,h=m.index,v=h===void 0?0:h,w=m.disabled,j=w===void 0?!1:w,N=m.className,k=N===void 0?"":N,A=m.children,M=O(m,["value","index","disabled","className","children"]),D=(0,i.useTheme)().select,L=D.styles,B=L.base,U=(0,c.useSelect)(),Y=U.selectedIndex,q=U.setSelectedIndex,z=U.listRef,$=U.setOpen,K=U.onChange,X=U.activeIndex,te=U.setActiveIndex,me=U.getItemProps,de=U.dataRef,ee=(0,a.default)(B.option.initial),Se=(0,a.default)(B.option.active),pe=(0,a.default)(B.option.disabled),fe,be=(0,o.twMerge)((0,n.default)(ee,(fe={},g(fe,Se,Y===v),g(fe,pe,j),fe)),k??"");return r.default.createElement("li",b({},M,{role:"option",ref:function(ye){return z.current[v]=ye},className:be,disabled:j,tabIndex:X===v?0:1,"aria-selected":X===v&&Y===v,"data-selected":Y===v},me({onClick:function(ye){var Pe=M==null?void 0:M.onClick;typeof Pe=="function"&&(Pe(ye),d()),d()},onKeyDown:function(ye){var Pe=M==null?void 0:M.onKeyDown;typeof Pe=="function"&&(Pe(ye),s(ye)),s(ye)}})),A)};C.propTypes={value:f.propTypesValue,index:f.propTypesIndex,disabled:f.propTypesDisabled,className:f.propTypesClassName,children:f.propTypesChildren},C.displayName="MaterialTailwind.SelectOption";var x=C})(lk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(z,$){for(var K in $)Object.defineProperty(z,K,{enumerable:!0,get:$[K]})}t(e,{Select:function(){return Y},Option:function(){return C.SelectOption},useSelect:function(){return O.useSelect},usePrevious:function(){return O.usePrevious},default:function(){return q}});var r=l(P),n=l(nt),o=pr,a=xr,i=l(ct),c=rt,f=l(Tr),g=l(Xt),b=l(et),S=Ze,O=xb,T=mu,C=lk;function x(z,$){($==null||$>z.length)&&($=z.length);for(var K=0,X=new Array($);K<$;K++)X[K]=z[K];return X}function m(z){if(Array.isArray(z))return z}function d(z){if(Array.isArray(z))return x(z)}function s(z,$,K){return $ in z?Object.defineProperty(z,$,{value:K,enumerable:!0,configurable:!0,writable:!0}):z[$]=K,z}function u(){return u=Object.assign||function(z){for(var $=1;$=0)&&Object.prototype.propertyIsEnumerable.call(z,X)&&(K[X]=z[X])}return K}function D(z,$){if(z==null)return{};var K={},X=Object.keys(z),te,me;for(me=0;me=0)&&(K[te]=z[te]);return K}function L(z,$){return m(z)||v(z,$)||U(z,$)||w()}function B(z){return d(z)||h(z)||U(z)||j()}function U(z,$){if(z){if(typeof z=="string")return x(z,$);var K=Object.prototype.toString.call(z).slice(8,-1);if(K==="Object"&&z.constructor&&(K=z.constructor.name),K==="Map"||K==="Set")return Array.from(K);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return x(z,$)}}var Y=r.default.forwardRef(function(z,$){var K=z.variant,X=z.color,te=z.size,me=z.label,de=z.error,ee=z.success,Se=z.arrow,pe=z.value,fe=z.onChange,be=z.selected,ye=z.offset,Pe=z.dismiss,Me=z.animate,ke=z.lockScroll,ce=z.labelProps,je=z.menuProps,He=z.className,qe=z.disabled,Je=z.name,Qe=z.children,Ge=z.containerProps,Xe=M(z,["variant","color","size","label","error","success","arrow","value","onChange","selected","offset","dismiss","animate","lockScroll","labelProps","menuProps","className","disabled","name","children","containerProps"]),ht,Ve=(0,S.useTheme)().select,ot=Ve.defaultProps,_t=Ve.valid,Ne=Ve.styles,at=Ne.base,Te=Ne.variants,ae=L(r.default.useState("close"),2),ge=ae[0],oe=ae[1];K=K??ot.variant,X=X??ot.color,te=te??ot.size,me=me??ot.label,de=de??ot.error,ee=ee??ot.success,Se=Se??ot.arrow,pe=pe??ot.value,fe=fe??ot.onChange,be=be??ot.selected,ye=ye??ot.offset,Pe=Pe??ot.dismiss,Me=Me??ot.animate,ce=ce??ot.labelProps,je=je??ot.menuProps;var ve;Ge=(ve=(0,f.default)(Ge,(ot==null?void 0:ot.containerProps)||{}))!==null&&ve!==void 0?ve:ot.containerProps,He=He??ot.className;var se=r.default.useRef([]),ie,he=r.default.useRef(B((ie=r.default.Children.map(Qe,function(jt){var Nt=jt.props;return Nt==null?void 0:Nt.value}))!==null&&ie!==void 0?ie:[])),Oe=L(r.default.useState(!1),2),Ce=Oe[0],Ue=Oe[1],Fe=L(r.default.useState(null),2),Ie=Fe[0],Ee=Fe[1],dt=L(r.default.useState(0),2),ft=dt[0],Ft=dt[1],Kt=L(r.default.useState(!1),2),Pt=Kt[0],Rt=Kt[1],hr=(0,O.usePrevious)(Ie),ir=(0,o.useFloating)({placement:"bottom-start",open:Ce,onOpenChange:Ue,whileElementsMounted:o.autoUpdate,middleware:[(0,o.offset)(5),(0,o.flip)({padding:10}),(0,o.size)({apply:function(Nt){var zt=Nt.rects,Or=Nt.elements,tn,so;Object.assign(Or==null||(tn=Or.floating)===null||tn===void 0?void 0:tn.style,{width:"".concat(zt==null||(so=zt.reference)===null||so===void 0?void 0:so.width,"px"),zIndex:99})},padding:20})]}),Jr=ir.x,jn=ir.y,Mr=ir.strategy,en=ir.refs,wr=ir.context;r.default.useEffect(function(){Ft(Math.max(0,he.current.indexOf(pe)+1))},[pe]);var no=en.floating,An=(0,o.useInteractions)([(0,o.useClick)(wr),(0,o.useRole)(wr,{role:"listbox"}),(0,o.useDismiss)(wr,N({},Pe)),(0,o.useListNavigation)(wr,{listRef:se,activeIndex:Ie,selectedIndex:ft,onNavigate:Ee,loop:!0}),(0,o.useTypeahead)(wr,{listRef:he,activeIndex:Ie,selectedIndex:ft,onMatch:Ce?Ee:Ft})]),J=An.getReferenceProps,Ae=An.getFloatingProps,Be=An.getItemProps;(0,a.useIsomorphicLayoutEffect)(function(){var jt=no.current;if(Ce&&Pt&&jt){var Nt=Ie!=null?se.current[Ie]:ft!=null?se.current[ft]:null;if(Nt&&hr!=null){var zt,Or,tn=(Or=(zt=se.current[hr])===null||zt===void 0?void 0:zt.offsetHeight)!==null&&Or!==void 0?Or:0,so=jt.offsetHeight,Da=Nt.offsetTop,In=Da+tn;Daso+jt.scrollTop&&(jt.scrollTop+=In-so-jt.scrollTop+5)}}},[Ce,Pt,hr,Ie]);var Mt=r.default.useMemo(function(){return{selectedIndex:ft,setSelectedIndex:Ft,listRef:se,setOpen:Ue,onChange:fe||function(){},activeIndex:Ie,setActiveIndex:Ee,getItemProps:Be,dataRef:wr.dataRef}},[ft,fe,Ie,Be,wr.dataRef]);r.default.useEffect(function(){oe(Ce?"open":!Ce&&ft||!Ce&&pe?"withValue":"close")},[Ce,pe,ft,be]);var yt=Te[(0,g.default)(_t.variants,K,"outlined")],Et=yt.sizes[(0,g.default)(_t.sizes,te,"md")],It=yt.error.select,or=yt.success.select,kt=yt.colors.select[(0,g.default)(_t.colors,X,"gray")],Rn=yt.error.label,Ir=yt.success.label,gr=yt.colors.label[(0,g.default)(_t.colors,X,"gray")],Mn=yt.states[ge],oo=(0,i.default)((0,b.default)(at.container),(0,b.default)(Et.container),Ge==null?void 0:Ge.className),Ct=(0,c.twMerge)((0,i.default)((0,b.default)(at.select),(0,b.default)(yt.base.select),(0,b.default)(Mn.select),(0,b.default)(Et.select),s({},(0,b.default)(kt[ge]),!de&&!ee),s({},(0,b.default)(It.initial),de),s({},(0,b.default)(It.states[ge]),de),s({},(0,b.default)(or.initial),ee),s({},(0,b.default)(or.states[ge]),ee)),He),Ra,To=(0,c.twMerge)((0,i.default)((0,b.default)(at.label),(0,b.default)(yt.base.label),(0,b.default)(Mn.label),(0,b.default)(Et.label.initial),(0,b.default)(Et.label.states[ge]),s({},(0,b.default)(gr[ge]),!de&&!ee),s({},(0,b.default)(Rn.initial),de),s({},(0,b.default)(Rn.states[ge]),de),s({},(0,b.default)(Ir.initial),ee),s({},(0,b.default)(Ir.states[ge]),ee)),(Ra=ce.className)!==null&&Ra!==void 0?Ra:""),ao=(0,i.default)((0,b.default)(at.arrow.initial),s({},(0,b.default)(at.arrow.active),Ce)),io,Oo=(0,c.twMerge)((0,i.default)((0,b.default)(at.menu)),(io=je.className)!==null&&io!==void 0?io:""),Ma=(0,i.default)("absolute top-2/4 -translate-y-2/4",K==="outlined"?"left-3 pt-0.5":"left-0 pt-3"),xi={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]}}},wi=(0,f.default)(xi,Me),Ia=a.AnimatePresence;r.default.useEffect(function(){pe&&!fe&&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.")},[pe,fe]);var mn=r.default.createElement(o.FloatingFocusManager,{context:wr,modal:!1},r.default.createElement(a.m.ul,u({},Ae(A(N({},je),{ref:en.setFloating,role:"listbox",className:Oo,style:{position:Mr,top:jn??0,left:Jr??0,overflow:"auto"},onPointerEnter:function(Nt){var zt=je==null?void 0:je.onPointerEnter;typeof zt=="function"&&(zt(Nt),Rt(!1)),Rt(!1)},onPointerMove:function(Nt){var zt=je==null?void 0:je.onPointerMove;typeof zt=="function"&&(zt(Nt),Rt(!1)),Rt(!1)},onKeyDown:function(Nt){var zt=je==null?void 0:je.onKeyDown;typeof zt=="function"&&(zt(Nt),Rt(!0)),Rt(!0)}})),{initial:"unmount",exit:"unmount",animate:Ce?"mount":"unmount",variants:wi}),r.default.Children.map(Qe,function(jt,Nt){var zt;return r.default.isValidElement(jt)&&r.default.cloneElement(jt,A(N({},jt.props),{index:((zt=jt.props)===null||zt===void 0?void 0:zt.index)||Nt+1,id:"material-tailwind-select-".concat(Nt)}))})));return r.default.createElement(O.SelectContextProvider,{value:Mt},r.default.createElement("div",u({},Ge,{ref:$,className:oo}),r.default.createElement("button",u({type:"button"},J(A(N({},Xe),{ref:en.setReference,className:Ct,disabled:qe,name:Je}))),typeof be=="function"?r.default.createElement("span",{className:Ma},be(Qe[ft-1],ft-1)):pe&&!fe?r.default.createElement("span",{className:Ma},pe):r.default.createElement("span",u({},(ht=Qe[ft-1])===null||ht===void 0?void 0:ht.props,{className:Ma})),r.default.createElement("div",{className:ao},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",u({},ce,{className:To}),me),r.default.createElement(a.LazyMotion,{features:a.domAnimation},r.default.createElement(Ia,null,Ce&&r.default.createElement(r.default.Fragment,null,ke?r.default.createElement(o.FloatingOverlay,{lockScroll:!0},mn):mn)))))});Y.propTypes={variant:n.default.oneOf(T.propTypesVariant),color:n.default.oneOf(T.propTypesColor),size:n.default.oneOf(T.propTypesSize),label:T.propTypesLabel,error:T.propTypesError,success:T.propTypesSuccess,arrow:T.propTypesArrow,value:T.propTypesValue,onChange:T.propTypesOnChange,selected:T.propTypesSelected,offset:T.propTypesOffset,dismiss:T.propTypesDismiss,animate:T.propTypesAnimate,lockScroll:T.propTypesLockScroll,labelProps:T.propTypesLabelProps,menuProps:T.propTypesMenuProps,className:T.propTypesClassName,disabled:T.propTypesDisabled,name:T.propTypesName,children:T.propTypesChildren,containerProps:T.propTypesContainerProps},Y.displayName="MaterialTailwind.Select";var q=Object.assign(Y,{Option:C.SelectOption})})(sk);var uk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Switch:function(){return m},default:function(){return d}});var r=T(P),n=T(nt),o=T(js),a=T(ct),i=rt,c=T(Xt),f=T(et),g=Ze,b=mi;function S(s,u,l){return u in s?Object.defineProperty(s,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[u]=l,s}function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.color,h=s.label,v=s.ripple,w=s.className,j=s.disabled,N=s.containerProps,k=s.circleProps,A=s.labelProps,M=s.inputRef,D=C(s,["color","label","ripple","className","disabled","containerProps","circleProps","labelProps","inputRef"]),L=(0,g.useTheme)(),B=L.switch,U=B.defaultProps,Y=B.valid,q=B.styles,z=q.base,$=q.colors,K=r.default.useId();l=l??U.color,v=v??U.ripple,w=w??U.className,j=j??U.disabled,N=N??U.containerProps,A=A??U.labelProps,k=k??U.circleProps;var X=v!==void 0&&new o.default,te=(0,a.default)((0,f.default)(z.root),S({},(0,f.default)(z.disabled),j)),me=(0,i.twMerge)((0,a.default)((0,f.default)(z.container)),N==null?void 0:N.className),de=(0,i.twMerge)((0,a.default)((0,f.default)(z.input),(0,f.default)($[(0,c.default)(Y.colors,l,"gray")])),w),ee=(0,i.twMerge)((0,a.default)((0,f.default)(z.circle),$[(0,c.default)(Y.colors,l,"gray")].circle,$[(0,c.default)(Y.colors,l,"gray")].before),k==null?void 0:k.className),Se=(0,a.default)((0,f.default)(z.ripple)),pe=(0,i.twMerge)((0,a.default)((0,f.default)(z.label)),A==null?void 0:A.className);return r.default.createElement("div",{ref:u,className:te},r.default.createElement("div",O({},N,{className:me}),r.default.createElement("input",O({},D,{ref:M,type:"checkbox",disabled:j,id:D.id||K,className:de})),r.default.createElement("label",O({},k,{htmlFor:D.id||K,className:ee}),v&&r.default.createElement("div",{className:Se,onMouseDown:function(fe){var be=N==null?void 0:N.onMouseDown;return v&&X.create(fe,"dark"),typeof be=="function"&&be(fe)}}))),h&&r.default.createElement("label",O({},A,{htmlFor:D.id||K,className:pe}),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})(uk);var ck={},Ls={},yi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(T,C){for(var x in C)Object.defineProperty(T,x,{enumerable:!0,get:C[x]})}t(e,{propTypesId:function(){return a},propTypesValue:function(){return i},propTypesAnimate:function(){return c},propTypesDisabled:function(){return f},propTypesClassName:function(){return g},propTypesOrientation:function(){return b},propTypesIndicator:function(){return S},propTypesChildren:function(){return O}});var r=o(nt),n=Gt;function o(T){return T&&T.__esModule?T:{default:T}}var a=r.default.string,i=r.default.oneOfType([r.default.string,r.default.number]).isRequired,c=n.propTypesAnimation,f=r.default.bool,g=r.default.string,b=r.default.oneOf(["horizontal","vertical"]),S=r.default.instanceOf(Object),O=r.default.node.isRequired})(yi);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(N,k){for(var A in k)Object.defineProperty(N,A,{enumerable:!0,get:k[A]})}t(e,{TabsContext:function(){return m},useTabs:function(){return d},TabsContextProvider:function(){return s},setId:function(){return u},setActive:function(){return l},setAnimation:function(){return h},setIndicator:function(){return v},setIsInitial:function(){return w},setOrientation:function(){return j}});var r=c(P),n=yi;function o(N,k){(k==null||k>N.length)&&(k=N.length);for(var A=0,M=new Array(k);A=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.value,l=d.className,h=d.activeClassName,v=d.disabled,w=d.children,j=T(d,["value","className","activeClassName","disabled","children"]),N=(0,c.useTheme)(),k=N.tab,A=k.defaultProps,M=k.styles.base,D=(0,f.useTabs)(),L=D.state,B=D.dispatch,U=L.id,Y=L.active,q=L.indicatorProps;l=l??A.className,h=h??A.activeClassName,v=v??A.disabled;var z,$=(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===u),z)),l),K,X=(0,a.twMerge)((0,o.default)((0,i.default)(M.indicator)),(K=q==null?void 0:q.className)!==null&&K!==void 0?K:"");return r.default.createElement("li",S({},j,{ref:s,role:"tab",className:$,onClick:function(te){var me=j==null?void 0:j.onClick;typeof me=="function"&&((0,f.setActive)(B,u),(0,f.setIsInitial)(B,!1),me(te)),(0,f.setIsInitial)(B,!1),(0,f.setActive)(B,u)},"data-value":u}),r.default.createElement("div",{className:"z-20 text-inherit"},w),Y===u&&r.default.createElement(n.motion.div,S({},q,{transition:{duration:.5},className:X,layoutId:U})))});x.propTypes={value:g.propTypesValue,className:g.propTypesClassName,disabled:g.propTypesDisabled,children:g.propTypesChildren},x.displayName="MaterialTailwind.Tab";var m=x})(dk);var fk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{TabsBody:function(){return x},default:function(){return m}});var r=O(P),n=xr,o=O(Tr),a=O(ct),i=rt,c=O(et),f=Ze,g=Ls,b=yi;function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.animate,l=d.className,h=d.children,v=T(d,["animate","className","children"]),w=(0,f.useTheme)().tabsBody,j=w.defaultProps,N=w.styles.base,k=(0,g.useTabs)().dispatch;l=l??j.className,u=u??j.animate;var A=(0,i.twMerge)((0,a.default)((0,c.default)(N)),l),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,u)},[u,M]);return(0,n.useIsomorphicLayoutEffect)(function(){(0,g.setAnimation)(k,D)},[D,k]),r.default.createElement("div",S({},v,{ref:s,className:A}),h)});x.propTypes={animate:b.propTypesAnimate,className:b.propTypesClassName,children:b.propTypesChildren},x.displayName="MaterialTailwind.TabsBody";var m=x})(fk);var pk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{TabsHeader:function(){return C},default:function(){return x}});var r=S(P),n=S(ct),o=rt,a=S(et),i=Ze,c=Ls,f=yi;function g(m,d,s){return d in m?Object.defineProperty(m,d,{value:s,enumerable:!0,configurable:!0,writable:!0}):m[d]=s,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,u)&&(s[u]=m[u])}return s}function T(m,d){if(m==null)return{};var s={},u=Object.keys(m),l,h;for(h=0;h=0)&&(s[l]=m[l]);return s}var C=r.default.forwardRef(function(m,d){var s=m.indicatorProps,u=m.className,l=m.children,h=O(m,["indicatorProps","className","children"]),v=(0,i.useTheme)().tabsHeader,w=v.defaultProps,j=v.styles,N=(0,c.useTabs)(),k=N.state,A=N.dispatch,M=k.orientation;r.default.useEffect(function(){(0,c.setIndicator)(A,s)},[A,s]),u=u??w.className;var D=(0,o.twMerge)((0,n.default)((0,a.default)(j.base),g({},j[M]&&(0,a.default)(j[M]),M)),u);return r.default.createElement("nav",null,r.default.createElement("ul",b({},h,{ref:d,role:"tablist",className:D}),l))});C.propTypes={indicatorProps:f.propTypesIndicator,className:f.propTypesClassName,children:f.propTypesChildren},C.displayName="MaterialTailwind.TabsHeader";var x=C})(pk);var hk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{TabPanel:function(){return C},default:function(){return x}});var r=S(P),n=xr,o=S(ct),a=rt,i=S(et),c=Ze,f=Ls,g=yi;function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,u)&&(s[u]=m[u])}return s}function T(m,d){if(m==null)return{};var s={},u=Object.keys(m),l,h;for(h=0;h=0)&&(s[l]=m[l]);return s}var C=r.default.forwardRef(function(m,d){var s=m.value,u=m.className,l=m.children,h=O(m,["value","className","children"]),v=(0,c.useTheme)().tabPanel,w=v.defaultProps,j=v.styles.base,N=(0,f.useTabs)().state,k=N.active,A=N.appliedAnimation,M=N.isInitial;u=u??w.className;var D=(0,a.twMerge)((0,o.default)((0,i.default)(j)),u),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:k===s?"mount":M?"initial":"unmount",variants:A,"data-value":s}),l)))});C.propTypes={value:g.propTypesValue,className:g.propTypesClassName,children:g.propTypesChildren},C.displayName="MaterialTailwind.TabPanel";var x=C})(hk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,h){for(var v in h)Object.defineProperty(l,v,{enumerable:!0,get:h[v]})}t(e,{Tabs:function(){return s},Tab:function(){return f.Tab},TabsBody:function(){return g.TabsBody},TabsHeader:function(){return b.TabsHeader},TabPanel:function(){return S.TabPanel},useTabs:function(){return c.useTabs},default:function(){return u}});var r=x(P),n=x(ct),o=rt,a=x(et),i=Ze,c=Ls,f=dk,g=fk,b=pk,S=hk,O=yi;function T(l,h,v){return h in l?Object.defineProperty(l,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[h]=v,l}function C(){return C=Object.assign||function(l){for(var h=1;h=0)&&Object.prototype.propertyIsEnumerable.call(l,w)&&(v[w]=l[w])}return v}function d(l,h){if(l==null)return{};var v={},w=Object.keys(l),j,N;for(N=0;N=0)&&(v[j]=l[j]);return v}var s=r.default.forwardRef(function(l,h){var v=l.value,w=l.className,j=l.orientation,N=l.children,k=m(l,["value","className","orientation","children"]),A=(0,i.useTheme)().tabs,M=A.defaultProps,D=A.styles,L=r.default.useId();w=w??M.className,j=j??M.orientation;var B=(0,o.twMerge)((0,n.default)((0,a.default)(D.base),T({},D[j]&&(0,a.default)(D[j]),j)),w);return r.default.createElement(c.TabsContextProvider,{id:L,value:v,orientation:j},r.default.createElement("div",C({},k,{ref:h,className:B}),N))});s.propTypes={id:O.propTypesId,value:O.propTypesValue,className:O.propTypesClassName,orientation:O.propTypesOrientation,children:O.propTypesChildren},s.displayName="MaterialTailwind.Tabs";var u=Object.assign(s,{Tab:f.Tab,Body:g.TabsBody,Header:b.TabsHeader,Panel:S.TabPanel})})(ck);var gk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{Textarea:function(){return C},default:function(){return x}});var r=S(P),n=S(nt),o=S(ct),a=S(Xt),i=S(et),c=Ze,f=gu;function g(m,d,s){return d in m?Object.defineProperty(m,d,{value:s,enumerable:!0,configurable:!0,writable:!0}):m[d]=s,m}function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,u)&&(s[u]=m[u])}return s}function T(m,d){if(m==null)return{};var s={},u=Object.keys(m),l,h;for(h=0;h=0)&&(s[l]=m[l]);return s}var C=r.default.forwardRef(function(m,d){var s=m.variant,u=m.color,l=m.size,h=m.label,v=m.error,w=m.success,j=m.resize,N=m.labelProps,k=m.containerProps,A=m.shrink,M=m.className,D=O(m,["variant","color","size","label","error","success","resize","labelProps","containerProps","shrink","className"]),L=(0,c.useTheme)().textarea,B=L.defaultProps,U=L.valid,Y=L.styles,q=Y.base,z=Y.variants;s=s??B.variant,l=l??B.size,u=u??B.color,h=h??B.label,N=N??B.labelProps,k=k??B.containerProps,A=A??B.shrink,M=M??B.className;var $=z[(0,a.default)(U.variants,s,"outlined")],K=(0,i.default)($.error.textarea),X=(0,i.default)($.success.textarea),te=(0,i.default)($.shrink.textarea),me=(0,i.default)($.colors.textarea[(0,a.default)(U.colors,u,"gray")]),de=(0,i.default)($.error.label),ee=(0,i.default)($.success.label),Se=(0,i.default)($.shrink.label),pe=(0,i.default)($.colors.label[(0,a.default)(U.colors,u,"gray")]),fe=(0,o.default)((0,i.default)(q.container),k==null?void 0:k.className),be=(0,o.default)((0,i.default)(q.textarea),(0,i.default)($.base.textarea),(0,i.default)($.sizes[(0,a.default)(U.sizes,l,"md")].textarea),g({},me,!v&&!w),g({},K,v),g({},X,w),g({},te,A),j?"":"!resize-none",M),ye=(0,o.default)((0,i.default)(q.label),(0,i.default)($.base.label),(0,i.default)($.sizes[(0,a.default)(U.sizes,l,"md")].label),g({},pe,!v&&!w),g({},de,v),g({},ee,w),g({},Se,A),N==null?void 0:N.className);return r.default.createElement("div",{ref:d,className:fe},r.default.createElement("textarea",b({},D,{className:be,placeholder:(D==null?void 0:D.placeholder)||" "})),r.default.createElement("label",{className:ye},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 x=C})(gk);var mk={};(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 k},default:function(){return A}});var r=m(P),n=m(nt),o=pr,a=xr,i=m(ct),c=rt,f=m(Tr),g=m(et),b=Ze,S=Ds;function O(M,D){(D==null||D>M.length)&&(D=M.length);for(var L=0,B=new Array(D);L=0)&&Object.prototype.propertyIsEnumerable.call(M,B)&&(L[B]=M[B])}return L}function w(M,D){if(M==null)return{};var L={},B=Object.keys(M),U,Y;for(Y=0;Y=0)&&(L[U]=M[U]);return L}function j(M,D){return T(M)||d(M,D)||N(M,D)||s()}function N(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 k=r.default.forwardRef(function(M,D){var L=M.open,B=M.handler,U=M.content,Y=M.interactive,q=M.placement,z=M.offset,$=M.dismiss,K=M.animate,X=M.className,te=M.children,me=v(M,["open","handler","content","interactive","placement","offset","dismiss","animate","className","children"]),de=(0,b.useTheme)().tooltip,ee=de.defaultProps,Se=de.styles.base,pe=j(r.default.useState(!1),2),fe=pe[0],be=pe[1];L=L??fe,B=B??be,Y=Y??ee.interactive,q=q??ee.placement,z=z??ee.offset,$=$??ee.dismiss,K=K??ee.animate,X=X??ee.className;var ye=(0,c.twMerge)((0,i.default)((0,g.default)(Se)),X),Pe={unmount:{opacity:0},mount:{opacity:1}},Me=(0,f.default)(Pe,K),ke=(0,o.useFloating)({open:L,onOpenChange:B,middleware:[(0,o.offset)(z),(0,o.flip)(),(0,o.shift)()],placement:q}),ce=ke.x,je=ke.y,He=ke.reference,qe=ke.floating,Je=ke.strategy,Qe=ke.refs,Ge=ke.update,Xe=ke.context,ht=(0,o.useInteractions)([(0,o.useClick)(Xe,{enabled:Y}),(0,o.useFocus)(Xe),(0,o.useHover)(Xe),(0,o.useRole)(Xe,{role:"tooltip"}),(0,o.useDismiss)(Xe,$)]),Ve=ht.getReferenceProps,ot=ht.getFloatingProps;r.default.useEffect(function(){if(Qe.reference.current&&Qe.floating.current&&L)return(0,o.autoUpdate)(Qe.reference.current,Qe.floating.current,Ge)},[L,Ge,Qe.reference,Qe.floating]);var _t=(0,o.useMergeRefs)([D,qe]),Ne=(0,o.useMergeRefs)([D,He]),at=a.AnimatePresence;return r.default.createElement(r.default.Fragment,null,typeof te=="string"?r.default.createElement("span",x({},Ve({ref:Ne})),te):r.default.cloneElement(te,u({},Ve(h(u({},te==null?void 0:te.props),{ref:Ne})))),r.default.createElement(a.LazyMotion,{features:a.domAnimation},r.default.createElement(o.FloatingPortal,null,r.default.createElement(at,null,L&&r.default.createElement(a.m.div,x({},ot(h(u({},me),{ref:_t,className:ye,style:{position:Je,top:je??"",left:ce??""}})),{initial:"unmount",exit:"unmount",animate:L?"mount":"unmount",variants:Me}),U)))))});k.propTypes={open:S.propTypesOpen,handler:S.propTypesHandler,content:S.propTypesContent,interactive:S.propTypesInteractive,placement:n.default.oneOf(S.propTypesPlacement),offset:S.propTypesOffset,dismiss:S.propTypesDismiss,animate:S.propTypesAnimate,className:S.propTypesClassName,children:S.propTypesChildren},k.displayName="MaterialTailwind.Tooltip";var A=k})(mk);var bk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,l){for(var h in l)Object.defineProperty(u,h,{enumerable:!0,get:l[h]})}t(e,{Typography:function(){return d},default:function(){return s}});var r=S(P),n=S(nt),o=S(ct),a=rt,i=S(Xt),c=S(et),f=Ze,g=Im;function b(u,l,h){return l in u?Object.defineProperty(u,l,{value:h,enumerable:!0,configurable:!0,writable:!0}):u[l]=h,u}function S(u){return u&&u.__esModule?u:{default:u}}function O(u){for(var l=1;l=0)&&Object.prototype.propertyIsEnumerable.call(u,v)&&(h[v]=u[v])}return h}function m(u,l){if(u==null)return{};var h={},v=Object.keys(u),w,j;for(j=0;j=0)&&(h[w]=u[w]);return h}var d=r.default.forwardRef(function(u,l){var h=u.variant,v=u.color,w=u.textGradient,j=u.as,N=u.className,k=u.children,A=x(u,["variant","color","textGradient","as","className","children"]),M=(0,f.useTheme)().typography,D=M.defaultProps,L=M.valid,B=M.styles,U=B.variants,Y=B.colors,q=B.textGradient;h=h??D.variant,v=v??D.color,w=w||D.textGradient,j=j??void 0,N=N??D.className;var z=(0,c.default)(U[(0,i.default)(L.variants,h,"paragraph")]),$=Y[(0,i.default)(L.colors,v,"inherit")],K=(0,c.default)(q),X=(0,a.twMerge)((0,o.default)(z,b({},$.color,!w),b({},K,w),b({},$.gradient,w)),N),te;switch(h){case"h1":te=r.default.createElement(j||"h1",C(O({},A),{ref:l,className:X}),k);break;case"h2":te=r.default.createElement(j||"h2",C(O({},A),{ref:l,className:X}),k);break;case"h3":te=r.default.createElement(j||"h3",C(O({},A),{ref:l,className:X}),k);break;case"h4":te=r.default.createElement(j||"h4",C(O({},A),{ref:l,className:X}),k);break;case"h5":te=r.default.createElement(j||"h5",C(O({},A),{ref:l,className:X}),k);break;case"h6":te=r.default.createElement(j||"h6",C(O({},A),{ref:l,className:X}),k);break;case"lead":te=r.default.createElement(j||"p",C(O({},A),{ref:l,className:X}),k);break;case"paragraph":te=r.default.createElement(j||"p",C(O({},A),{ref:l,className:X}),k);break;case"small":te=r.default.createElement(j||"p",C(O({},A),{ref:l,className:X}),k);break;default:te=r.default.createElement(j||"p",C(O({},A),{ref:l,className:X}),k);break}return te});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 s=d})(bk);var vk={},yk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(g,b){for(var S in b)Object.defineProperty(g,S,{enumerable:!0,get:b[S]})}t(e,{propTypesClassName:function(){return a},propTypesChildren:function(){return i},propTypesOpen:function(){return c},propTypesAnimate:function(){return f}});var r=o(nt),n=Gt;function o(g){return g&&g.__esModule?g:{default:g}}var a=r.default.string,i=r.default.node.isRequired,c=r.default.bool.isRequired,f=n.propTypesAnimation})(yk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{Collapse:function(){return x},default:function(){return m}});var r=O(P),n=xr,o=pr,a=O(Tr),i=O(ct),c=rt,f=O(et),g=Ze,b=yk;function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.open,l=d.animate,h=d.className,v=d.children,w=T(d,["open","animate","className","children"]),j=r.default.useRef(null),N=(0,g.useTheme)().collapse,k=N.styles,A=k.base;l=l??{},h=h??"";var M=(0,c.twMerge)((0,i.default)((0,f.default)(A)),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,l),B=n.AnimatePresence,U=(0,o.useMergeRefs)([s,j]);return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(B,null,r.default.createElement(n.m.div,S({},w,{ref:U,className:M,initial:"unmount",exit:"unmount",animate:u?"mount":"unmount",variants:L}),v)))});x.displayName="MaterialTailwind.Collapse",x.propTypes={open:b.propTypesOpen,animate:b.propTypesAnimate,className:b.propTypesClassName,children:b.propTypesChildren};var m=x})(vk);var xk={},Ou={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(g,b){for(var S in b)Object.defineProperty(g,S,{enumerable:!0,get:b[S]})}t(e,{propTypesClassName:function(){return o},propTypesDisabled:function(){return a},propTypesSelected:function(){return i},propTypesRipple:function(){return c},propTypesChildren:function(){return f}});var r=n(nt);function n(g){return g&&g.__esModule?g:{default:g}}var o=r.default.string,a=r.default.bool,i=r.default.bool,c=r.default.bool,f=r.default.node.isRequired})(Ou);var wk={},wb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,x){for(var m in x)Object.defineProperty(C,m,{enumerable:!0,get:x[m]})}t(e,{ListItemPrefix:function(){return O},default:function(){return T}});var r=g(P),n=Ze,o=g(ct),a=rt,i=g(et),c=Ou;function f(){return f=Object.assign||function(C){for(var x=1;x=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function S(C,x){if(C==null)return{};var m={},d=Object.keys(C),s,u;for(u=0;u=0)&&(m[s]=C[s]);return m}var O=r.default.forwardRef(function(C,x){var m=C.className,d=C.children,s=b(C,["className","children"]),u=(0,n.useTheme)().list,l=u.styles.base,h=(0,a.twMerge)((0,o.default)((0,i.default)(l.itemPrefix)),m);return r.default.createElement("div",f({},s,{ref:x,className:h}),d)});O.propTypes={className:c.propTypesClassName,children:c.propTypesChildren},O.displayName="MaterialTailwind.ListItemPrefix";var T=O})(wb);var _b={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,x){for(var m in x)Object.defineProperty(C,m,{enumerable:!0,get:x[m]})}t(e,{ListItemSuffix:function(){return O},default:function(){return T}});var r=g(P),n=Ze,o=g(ct),a=rt,i=g(et),c=Ou;function f(){return f=Object.assign||function(C){for(var x=1;x=0)&&Object.prototype.propertyIsEnumerable.call(C,d)&&(m[d]=C[d])}return m}function S(C,x){if(C==null)return{};var m={},d=Object.keys(C),s,u;for(u=0;u=0)&&(m[s]=C[s]);return m}var O=r.default.forwardRef(function(C,x){var m=C.className,d=C.children,s=b(C,["className","children"]),u=(0,n.useTheme)().list,l=u.styles.base,h=(0,a.twMerge)((0,o.default)((0,i.default)(l.itemSuffix)),m);return r.default.createElement("div",f({},s,{ref:x,className:h}),d)});O.propTypes={className:c.propTypesClassName,children:c.propTypesChildren},O.displayName="MaterialTailwind.ListItemSuffix";var T=O})(_b);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{ListItem:function(){return m},ListItemPrefix:function(){return g.ListItemPrefix},ListItemSuffix:function(){return b.ListItemSuffix},default:function(){return d}});var r=T(P),n=Ze,o=T(js),a=T(ct),i=rt,c=T(et),f=Ou,g=wb,b=_b;function S(s,u,l){return u in s?Object.defineProperty(s,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[u]=l,s}function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.className,h=s.disabled,v=s.selected,w=s.ripple,j=s.children,N=C(s,["className","disabled","selected","ripple","children"]),k=(0,n.useTheme)().list,A=k.defaultProps,M=k.styles.base;w=w??A.ripple;var D=w!==void 0&&new o.default,L,B=(0,i.twMerge)((0,a.default)((0,c.default)(M.item.initial),(L={},S(L,(0,c.default)(M.item.disabled),h),S(L,(0,c.default)(M.item.selected),v&&!h),L)),l);return r.default.createElement("div",O({},N,{ref:u,role:"button",tabIndex:0,className:B,onMouseDown:function(U){var Y=N==null?void 0:N.onMouseDown;return w&&D.create(U,"dark"),typeof Y=="function"&&Y(U)}}),j)});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})})(wk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{List:function(){return x},ListItem:function(){return f.ListItem},ListItemPrefix:function(){return g.ListItemPrefix},ListItemSuffix:function(){return b.ListItemSuffix},default:function(){return m}});var r=O(P),n=Ze,o=O(ct),a=rt,i=O(et),c=Ou,f=wk,g=wb,b=_b;function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.className,l=d.children,h=T(d,["className","children"]),v=(0,n.useTheme)().list,w=v.defaultProps,j=v.styles.base;u=u??w.className;var N=(0,a.twMerge)((0,o.default)((0,i.default)(j.list)),u);return r.default.createElement("nav",S({},h,{ref:s,className:N}),l)});x.propTypes={className:c.propTypesClassName,children:c.propTypesChildren},x.displayName="MaterialTailwind.List";var m=Object.assign(x,{Item:f.ListItem,ItemPrefix:g.ListItemPrefix,ItemSuffix:b.ListItemSuffix})})(xk);var _k={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,s){for(var u in s)Object.defineProperty(d,u,{enumerable:!0,get:s[u]})}t(e,{ButtonGroup:function(){return x},default:function(){return m}});var r=O(P),n=O(nt),o=O(ct),a=rt,i=O(Xt),c=O(et),f=Ze,g=hi;function b(d,s,u){return s in d?Object.defineProperty(d,s,{value:u,enumerable:!0,configurable:!0,writable:!0}):d[s]=u,d}function S(){return S=Object.assign||function(d){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(d,l)&&(u[l]=d[l])}return u}function C(d,s){if(d==null)return{};var u={},l=Object.keys(d),h,v;for(v=0;v=0)&&(u[h]=d[h]);return u}var x=r.default.forwardRef(function(d,s){var u=d.variant,l=d.size,h=d.color,v=d.fullWidth,w=d.ripple,j=d.className,N=d.children,k=T(d,["variant","size","color","fullWidth","ripple","className","children"]),A=(0,f.useTheme)().buttonGroup,M=A.defaultProps,D=A.styles,L=A.valid,B=D.base,U=D.dividerColor;u=u??M.variant,l=l??M.size,h=h??M.color,w=w??M.ripple,v=v??M.fullWidth,j=j??M.className;var Y,q=(0,a.twMerge)((0,o.default)((0,c.default)(B.initial),(Y={},b(Y,(0,c.default)(B.fullWidth),v),b(Y,"divide-x",u!=="outlined"),b(Y,(0,c.default)(U[(0,i.default)(L.colors,h,"gray")]),u!=="outlined"),Y)),j);return r.default.createElement("div",S({},k,{ref:s,className:q}),r.default.Children.map(N,function(z,$){var K;return r.default.isValidElement(z)&&r.default.cloneElement(z,{variant:u,size:l,color:h,ripple:w,fullWidth:v,className:(0,a.twMerge)((0,o.default)({"rounded-r-none":$!==r.default.Children.count(N)-1,"border-r-0":$!==r.default.Children.count(N)-1,"rounded-l-none":$!==0}),(K=z.props)===null||K===void 0?void 0:K.className)})}))});x.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},x.displayName="MaterialTailwind.ButtonGroup";var m=x})(_k);var Sk={},Ck={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,x){for(var m in x)Object.defineProperty(C,m,{enumerable:!0,get:x[m]})}t(e,{propTypesClassName:function(){return o},propTypesPrevArrow:function(){return a},propTypesNextArrow:function(){return i},propTypesNavigation:function(){return c},propTypesAutoplay:function(){return f},propTypesAutoplayDelay:function(){return g},propTypesTransition:function(){return b},propTypesLoop:function(){return S},propTypesChildren:function(){return O},propTypesSlideRef:function(){return T}});var r=n(nt);function n(C){return C&&C.__esModule?C:{default:C}}var o=r.default.string,a=r.default.func,i=r.default.func,c=r.default.func,f=r.default.bool,g=r.default.number,b=r.default.object,S=r.default.bool,O=r.default.node.isRequired,T=r.default.oneOfType([r.default.func,r.default.shape({current:r.default.any})])})(Ck);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(v,w){for(var j in w)Object.defineProperty(v,j,{enumerable:!0,get:w[j]})}t(e,{Carousel:function(){return l},default:function(){return h}});var r=T(P),n=xr,o=pr,a=T(ct),i=rt,c=T(et),f=Ze,g=Ck;function b(v,w){(w==null||w>v.length)&&(w=v.length);for(var j=0,N=new Array(w);j=0)&&Object.prototype.propertyIsEnumerable.call(v,N)&&(j[N]=v[N])}return j}function d(v,w){if(v==null)return{};var j={},N=Object.keys(v),k,A;for(A=0;A=0)&&(j[k]=v[k]);return j}function s(v,w){return S(v)||C(v,w)||u(v,w)||x()}function u(v,w){if(v){if(typeof v=="string")return b(v,w);var j=Object.prototype.toString.call(v).slice(8,-1);if(j==="Object"&&v.constructor&&(j=v.constructor.name),j==="Map"||j==="Set")return Array.from(j);if(j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j))return b(v,w)}}var l=r.default.forwardRef(function(v,w){var j=v.children,N=v.prevArrow,k=v.nextArrow,A=v.navigation,M=v.autoplay,D=v.autoplayDelay,L=v.transition,B=v.loop,U=v.className,Y=v.slideRef,q=m(v,["children","prevArrow","nextArrow","navigation","autoplay","autoplayDelay","transition","loop","className","slideRef"]),z=(0,f.useTheme)().carousel,$=z.defaultProps,K=z.styles.base,X=(0,n.useMotionValue)(0),te=r.default.useRef(null),me=s(r.default.useState(0),2),de=me[0],ee=me[1],Se=r.default.Children.toArray(j);U=U??$.className,N=N??$.prevArrow,k=k??$.nextArrow,A=A??$.navigation,M=M??$.autoplay,D=D??$.autoplayDelay,L=L??$.transition,B=B??$.loop;var pe=(0,i.twMerge)((0,a.default)((0,c.default)(K.carousel)),U),fe=(0,i.twMerge)((0,a.default)((0,c.default)(K.slide))),be=r.default.useCallback(function(){var ke;return-de*(((ke=te.current)===null||ke===void 0?void 0:ke.clientWidth)||0)},[de]),ye=r.default.useCallback(function(){var ke=B?0:de;ee(de+1===Se.length?ke:de+1)},[de,B,Se.length]),Pe=function(){var ke=B?Se.length-1:0;ee(de-1<0?ke:de-1)};r.default.useEffect(function(){var ke=(0,n.animate)(X,be(),L);return ke.stop},[be,de,X,L]),r.default.useEffect(function(){window.addEventListener("resize",function(){(0,n.animate)(X,be(),L)})},[be,L,X]),r.default.useEffect(function(){if(M){var ke=setInterval(function(){return ye()},D);return function(){return clearInterval(ke)}}},[M,ye,D]);var Me=(0,o.useMergeRefs)([te,w]);return r.default.createElement("div",O({},q,{ref:Me,className:pe}),Se.map(function(ke,ce){return r.default.createElement(n.LazyMotion,{key:ce,features:n.domAnimation},r.default.createElement(n.m.div,{ref:Y,className:fe,style:{x:X,left:"".concat(ce*100,"%"),right:"".concat(ce*100,"%")}},ke))}),N&&N({loop:B,handlePrev:Pe,activeIndex:de,firstIndex:de===0}),k&&k({loop:B,handleNext:ye,activeIndex:de,lastIndex:de===Se.length-1}),A&&A({setActiveIndex:ee,activeIndex:de,length:Se.length}))});l.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},l.displayName="MaterialTailwind.Carousel";var h=l})(Sk);var Tk={},Ok={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{propTypesOpen:function(){return a},propTypesSize:function(){return i},propTypesOverlay:function(){return c},propTypesChildren:function(){return f},propTypesPlacement:function(){return g},propTypesOverlayProps:function(){return b},propTypesClassName:function(){return S},propTypesOnClose:function(){return O},propTypesDismiss:function(){return T},propTypesTransition:function(){return C},propTypesOverlayRef:function(){return x}});var r=o(nt),n=Gt;function o(m){return m&&m.__esModule?m:{default:m}}var a=r.default.bool.isRequired,i=r.default.number,c=r.default.bool,f=r.default.node.isRequired,g=["top","right","bottom","left"],b=r.default.object,S=r.default.string,O=r.default.func,T=n.propTypesDismissType,C=r.default.object,x=r.default.oneOfType([r.default.func,r.default.shape({current:r.default.any})])})(Ok);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,h){for(var v in h)Object.defineProperty(l,v,{enumerable:!0,get:h[v]})}t(e,{Drawer:function(){return s},default:function(){return u}});var r=C(P),n=C(nt),o=xr,a=pr,i=C(Tr),c=C(ct),f=rt,g=C(et),b=Ze,S=Ok;function O(l,h,v){return h in l?Object.defineProperty(l,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[h]=v,l}function T(){return T=Object.assign||function(l){for(var h=1;h=0)&&Object.prototype.propertyIsEnumerable.call(l,w)&&(v[w]=l[w])}return v}function d(l,h){if(l==null)return{};var v={},w=Object.keys(l),j,N;for(N=0;N=0)&&(v[j]=l[j]);return v}var s=r.default.forwardRef(function(l,h){var v=l.open,w=l.size,j=l.overlay,N=l.children,k=l.placement,A=l.overlayProps,M=l.className,D=l.onClose,L=l.dismiss,B=l.transition,U=l.overlayRef,Y=m(l,["open","size","overlay","children","placement","overlayProps","className","onClose","dismiss","transition","overlayRef"]),q=(0,b.useTheme)().drawer,z=q.defaultProps,$=q.styles.base,K=(0,o.useAnimation)();w=w??z.size,j=j??z.overlay,k=k??z.placement,M=M??z.className,A=A??z.overlayProps,D=D??z.onClose;var X;L=(X=(0,i.default)(z.dismiss,L||{}))!==null&&X!==void 0?X:z.dismiss,B=B??z.transition;var te=(0,f.twMerge)((0,c.default)((0,g.default)($.drawer),{"top-0 right-0":k==="right","bottom-0 left-0":k==="bottom","top-0 left-0":k==="top"||k==="left"}),M),me=(0,f.twMerge)((0,c.default)((0,g.default)($.overlay)),A==null?void 0:A.className),de=(0,a.useFloating)({open:v,onOpenChange:D}).context,ee=(0,a.useInteractions)([(0,a.useDismiss)(de,L)]).getFloatingProps;r.default.useEffect(function(){K.start(v?"open":"close")},[v,K,k]);var Se={open:{x:0,y:0},close:{x:k==="left"?-w:k==="right"?w:0,y:k==="top"?-w:k==="bottom"?w:0}},pe={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,j&&v&&r.default.createElement(o.m.div,{ref:U,className:me,initial:"unmount",exit:"unmount",animate:v?"mount":"unmount",variants:pe,transition:{duration:.3}})),r.default.createElement(o.m.div,T({},ee(x({ref:h},Y)),{className:te,style:{maxWidth:k==="left"||k==="right"?w:"100%",maxHeight:k==="top"||k==="bottom"?w:"100%",height:k==="left"||k==="right"?"100vh":"100%"},initial:"close",animate:K,variants:Se,transition:B}),N)))});s.propTypes={open:S.propTypesOpen,size:S.propTypesSize,overlay:S.propTypesOverlay,children:S.propTypesChildren,placement:n.default.oneOf(S.propTypesPlacement),overlayProps:S.propTypesOverlayProps,className:S.propTypesClassName,onClose:S.propTypesOnClose,dismiss:S.propTypesDismiss,transition:S.propTypesTransition,overlayRef:S.propTypesOverlayRef},s.displayName="MaterialTailwind.Drawer";var u=s})(Tk);var Pk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Badge:function(){return m},default:function(){return d}});var r=T(P),n=T(nt),o=T(Tr),a=T(ct),i=rt,c=T(Xt),f=T(et),g=Ze,b=Dm;function S(s,u,l){return u in s?Object.defineProperty(s,u,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[u]=l,s}function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.color,h=s.invisible,v=s.withBorder,w=s.overlap,j=s.placement,N=s.className,k=s.content,A=s.children,M=s.containerProps,D=s.containerRef,L=C(s,["color","invisible","withBorder","overlap","placement","className","content","children","containerProps","containerRef"]),B=(0,g.useTheme)().badge,U=B.valid,Y=B.defaultProps,q=B.styles,z=q.base,$=q.placements,K=q.colors;l=l??Y.color,h=h??Y.invisible,v=v??Y.withBorder,w=w??Y.overlap,j=j??Y.placement;var X;N=(X=(0,a.default)(N,Y.className))!==null&&X!==void 0?X:Y.className;var te;M=(te=(0,o.default)(M,Y.containerProps||{}))!==null&&te!==void 0?te:Y.containerProps;var me=(0,f.default)(z.badge.initial),de=(0,f.default)(z.badge.withBorder),ee=(0,f.default)(z.badge.withContent),Se=(0,f.default)(K[(0,c.default)(U.colors,l,"red")]),pe=(0,f.default)($[(0,c.default)(U.placements,j,"top-end")][(0,c.default)(U.overlaps,w,"square")]),fe,be=(0,i.twMerge)((0,a.default)(me,pe,Se,(fe={},S(fe,de,v),S(fe,ee,k),fe)),N),ye=(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:ye}),A,!h&&r.default.createElement("span",O({},L,{ref:u,className:be}),k))});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})(Pk);var kk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(k,A){for(var M in A)Object.defineProperty(k,M,{enumerable:!0,get:A[M]})}t(e,{Rating:function(){return j},default:function(){return N}});var r=C(P),n=C(nt),o=C(ct),a=rt,i=C(Xt),c=C(et),f=Ze,g=Lm;function b(k,A){(A==null||A>k.length)&&(A=k.length);for(var M=0,D=new Array(A);M=0)&&Object.prototype.propertyIsEnumerable.call(k,D)&&(M[D]=k[D])}return M}function l(k,A){if(k==null)return{};var M={},D=Object.keys(k),L,B;for(B=0;B=0)&&(M[L]=k[L]);return M}function h(k,A){return S(k)||m(k,A)||w(k,A)||d()}function v(k){return O(k)||x(k)||w(k)||s()}function w(k,A){if(k){if(typeof k=="string")return b(k,A);var M=Object.prototype.toString.call(k).slice(8,-1);if(M==="Object"&&k.constructor&&(M=k.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(k,A)}}var j=r.default.forwardRef(function(k,A){var M=k.count,D=k.value,L=k.ratedIcon,B=k.unratedIcon,U=k.ratedColor,Y=k.unratedColor,q=k.className,z=k.onChange,$=k.readonly,K=u(k,["count","value","ratedIcon","unratedIcon","ratedColor","unratedColor","className","onChange","readonly"]),X,te,me=(0,f.useTheme)().rating,de=me.valid,ee=me.defaultProps,Se=me.styles,pe=Se.base,fe=Se.colors;M=M??ee.count,D=D??ee.value,L=L??ee.ratedIcon,L=L??ee.ratedIcon,B=B??ee.unratedIcon,U=U??ee.ratedColor,Y=Y??ee.unratedColor,q=q??ee.className,z=z??ee.onChange,$=$??ee.readonly;var be=h(r.default.useState(function(){return v(Array(D).fill("rated")).concat(v(Array(M-D).fill("un_rated")))}),2),ye=be[0],Pe=be[1],Me=h(r.default.useState(function(){return v(Array(M).fill("un_rated"))}),2),ke=Me[0],ce=Me[1],je=h(r.default.useState(!1),2),He=je[0],qe=je[1],Je=(0,c.default)(fe[(0,i.default)(de.colors,U,"yellow")]),Qe=(0,c.default)(fe[(0,i.default)(de.colors,Y,"blue-gray")]),Ge=(0,a.twMerge)((0,o.default)((0,c.default)(pe.rating),q)),Xe=(0,c.default)(pe.icon),ht=L,Ve=B,ot=r.default.isValidElement(L)&&r.default.cloneElement(ht,{className:(0,a.twMerge)((0,o.default)(Xe,Je,ht==null||(X=ht.props)===null||X===void 0?void 0:X.className))}),_t=r.default.isValidElement(L)&&r.default.cloneElement(Ve,{className:(0,a.twMerge)((0,o.default)(Xe,Qe,Ve==null||(te=Ve.props)===null||te===void 0?void 0:te.className))}),Ne=!r.default.isValidElement(L)&&r.default.createElement(L,{className:(0,a.twMerge)((0,o.default)(Xe,Je))}),at=!r.default.isValidElement(L)&&r.default.createElement(B,{className:(0,a.twMerge)((0,o.default)(Xe,Qe))}),Te=function(ae){return ae.map(function(ge,oe){return r.default.createElement("span",{key:oe,onClick:function(){if(!$){var ve=ye.map(function(se,ie){return ie<=oe?"rated":"un_rated"});Pe(ve),z&&typeof z=="function"&&z(ve.filter(function(se){return se==="rated"}).length)}},onMouseEnter:function(){if(!$){var ve=ke.map(function(se,ie){return ie<=oe?"rated":"un_rated"});qe(!0),ce(ve)}},onMouseLeave:function(){return!$&&qe(!1)}},r.default.isValidElement(ge==="rated"?L:B)?ge==="rated"?ot:_t:ge==="rated"?Ne:at)})};return r.default.createElement("div",T({},K,{ref:A,className:Ge}),Te(He?ke:ye))});j.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},j.displayName="MaterialTailwind.Rating";var N=j})(kk);var Nk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(w,j){for(var N in j)Object.defineProperty(w,N,{enumerable:!0,get:j[N]})}t(e,{Slider:function(){return h},default:function(){return v}});var r=C(P),n=C(nt),o=C(Tr),a=C(ct),i=rt,c=C(Xt),f=C(et),g=Ze,b=Fm;function S(w,j){(j==null||j>w.length)&&(j=w.length);for(var N=0,k=new Array(j);N=0)&&Object.prototype.propertyIsEnumerable.call(w,k)&&(N[k]=w[k])}return N}function s(w,j){if(w==null)return{};var N={},k=Object.keys(w),A,M;for(M=0;M=0)&&(N[A]=w[A]);return N}function u(w,j){return O(w)||x(w,j)||l(w,j)||m()}function l(w,j){if(w){if(typeof w=="string")return S(w,j);var N=Object.prototype.toString.call(w).slice(8,-1);if(N==="Object"&&w.constructor&&(N=w.constructor.name),N==="Map"||N==="Set")return Array.from(N);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return S(w,j)}}var h=r.default.forwardRef(function(w,j){var N=w.color,k=w.size,A=w.className,M=w.trackClassName,D=w.thumbClassName,L=w.barClassName,B=w.value,U=w.defaultValue,Y=w.onChange,q=w.min,z=w.max,$=w.step,K=w.inputRef,X=w.inputProps,te=d(w,["color","size","className","trackClassName","thumbClassName","barClassName","value","defaultValue","onChange","min","max","step","inputRef","inputProps"]),me=(0,g.useTheme)().slider,de=me.valid,ee=me.defaultProps,Se=me.styles,pe=Se.base,fe=Se.sizes,be=Se.colors,ye=u(r.default.useState(U||0),2),Pe=ye[0],Me=ye[1];r.default.useMemo(function(){U&&Me(U)},[U]),N=N??ee.color,k=k??ee.size,q=q??ee.min,z=z??ee.max,$=$??ee.step;var ke;A=(ke=(0,a.default)(ee.className,A))!==null&&ke!==void 0?ke:ee.className;var ce;D=(ce=(0,a.default)(ee.thumbClassName,D))!==null&&ce!==void 0?ce:ee.thumbClassName;var je;M=(je=(0,a.default)(ee.trackClassName,M))!==null&&je!==void 0?je:ee.trackClassName;var He;L=(He=(0,a.default)(ee.barClassName,L))!==null&&He!==void 0?He:ee.barClassName;var qe;X=(qe=(0,o.default)(X,(ee==null?void 0:ee.inputProps)||{}))!==null&&qe!==void 0?qe:ee.inputProps;var Je=(0,i.twMerge)((0,a.default)((0,f.default)(pe.container),(0,f.default)(be[(0,c.default)(de.colors,N,"gray")]),(0,f.default)(fe[(0,c.default)(de.sizes,k,"md")].container),A)),Qe=(0,i.twMerge)((0,a.default)((0,f.default)(pe.bar),L)),Ge=(0,a.default)((0,f.default)(pe.track),(0,f.default)(fe[(0,c.default)(de.sizes,k,"md")].track)),Xe=(0,a.default)((0,f.default)(pe.thumb),(0,f.default)(fe[(0,c.default)(de.sizes,k,"md")].thumb)),ht=(0,a.default)((0,f.default)(pe.slider),(0,i.twMerge)(Ge,M),(0,i.twMerge)(Xe,D));return r.default.createElement("div",T({},te,{ref:j,className:Je}),r.default.createElement("label",{className:Qe,style:{width:"".concat(B||Pe,"%")}}),r.default.createElement("input",T({ref:K,type:"range",max:z,min:q,step:$,className:ht},B?{value:B}:null,{defaultValue:U,onChange:function(Ve){return Y?Y(Ve):Me(Number(Ve.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})(Nk);var Ek={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Spinner:function(){return m},default:function(){return d}});var r=S(nt),n=T(P),o=S(ct),a=rt,i=S(Xt),c=S(et),f=Ze,g=zm;function b(){return b=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=(0,n.forwardRef)(function(s,u){var l=s.color,h=s.className,v=C(s,["color","className"]),w=(0,f.useTheme)().spinner,j=w.defaultProps,N=w.valid,k=w.styles,A=k.base,M=k.colors;l=l??j.color;var D;h=(D=(0,o.default)(j.className,h))!==null&&D!==void 0?D:j.className;var L=(0,c.default)(M[(0,i.default)(N.colors,l,"gray")]),B=(0,a.twMerge)((0,o.default)((0,c.default)(A)),h),U,Y;return n.default.createElement("svg",b({},v,{ref:u,className:B,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})(Ek);var jk={},Pu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(h,v){for(var w in v)Object.defineProperty(h,w,{enumerable:!0,get:v[w]})}t(e,{useTimelineItem:function(){return s},TimelineItem:function(){return u},default:function(){return l}});var r=b(P),n=rt,o=b(et),a=Ze,i=qo;function c(h,v){(v==null||v>h.length)&&(v=h.length);for(var w=0,j=new Array(v);w=0)&&Object.prototype.propertyIsEnumerable.call(h,j)&&(w[j]=h[j])}return w}function C(h,v){if(h==null)return{};var w={},j=Object.keys(h),N,k;for(k=0;k=0)&&(w[N]=h[N]);return w}function x(h,v){return f(h)||S(h,v)||m(h,v)||O()}function m(h,v){if(h){if(typeof h=="string")return c(h,v);var w=Object.prototype.toString.call(h).slice(8,-1);if(w==="Object"&&h.constructor&&(w=h.constructor.name),w==="Map"||w==="Set")return Array.from(w);if(w==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w))return c(h,v)}}var d=r.default.createContext(0);d.displayName="MaterialTailwind.TimelineItemContext";function s(){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 u=r.default.forwardRef(function(h,v){var w=h.className,j=h.children,N=T(h,["className","children"]),k=(0,a.useTheme)().timelineItem,A=k.styles,M=A.base,D=x(r.default.useState(0),2),L=D[0],B=D[1],U=r.default.useMemo(function(){return[L,B]},[L,B]),Y=(0,n.twMerge)((0,o.default)(M),w);return r.default.createElement(d.Provider,{value:U},r.default.createElement("li",g({ref:v},N,{className:Y}),j))});u.propTypes={className:i.propTypeClassName,children:i.propTypeChildren.isRequired},u.displayName="MaterialTailwind.TimelineItem";var l=u})(Pu);var Ak={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(w,j){for(var N in j)Object.defineProperty(w,N,{enumerable:!0,get:j[N]})}t(e,{TimelineIcon:function(){return h},default:function(){return v}});var r=C(P),n=C(nt),o=pr,a=rt,i=C(Xt),c=C(et),f=Ze,g=Pu,b=qo;function S(w,j){(j==null||j>w.length)&&(j=w.length);for(var N=0,k=new Array(j);N=0)&&Object.prototype.propertyIsEnumerable.call(w,k)&&(N[k]=w[k])}return N}function s(w,j){if(w==null)return{};var N={},k=Object.keys(w),A,M;for(M=0;M=0)&&(N[A]=w[A]);return N}function u(w,j){return O(w)||x(w,j)||l(w,j)||m()}function l(w,j){if(w){if(typeof w=="string")return S(w,j);var N=Object.prototype.toString.call(w).slice(8,-1);if(N==="Object"&&w.constructor&&(N=w.constructor.name),N==="Map"||N==="Set")return Array.from(N);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return S(w,j)}}var h=r.default.forwardRef(function(w,j){var N=w.color,k=w.variant,A=w.className,M=w.children,D=d(w,["color","variant","className","children"]),L=(0,f.useTheme)().timelineIcon,B=L.styles,U=L.valid,Y=B.base,q=B.variants,z=u((0,g.useTimelineItem)(),2),$=z[1],K=r.default.useRef(null),X=(0,o.useMergeRefs)([j,K]);r.default.useEffect(function(){var de=K.current;if(de){var ee=de.getBoundingClientRect().width;return $(ee),function(){$(0)}}},[$,A,M]);var te=(0,c.default)(q[(0,i.default)(U.variants,k,"filled")][(0,i.default)(U.colors,N,"gray")]),me=(0,a.twMerge)((0,c.default)(Y),te,A);return r.default.createElement("span",T({ref:X},D,{className:me}),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})(Ak);var Rk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,h){for(var v in h)Object.defineProperty(l,v,{enumerable:!0,get:h[v]})}t(e,{TimelineHeader:function(){return s},default:function(){return u}});var r=S(P),n=rt,o=S(et),a=Ze,i=Pu,c=qo;function f(l,h){(h==null||h>l.length)&&(h=l.length);for(var v=0,w=new Array(h);v=0)&&Object.prototype.propertyIsEnumerable.call(l,w)&&(v[w]=l[w])}return v}function x(l,h){if(l==null)return{};var v={},w=Object.keys(l),j,N;for(N=0;N=0)&&(v[j]=l[j]);return v}function m(l,h){return g(l)||O(l,h)||d(l,h)||T()}function d(l,h){if(l){if(typeof l=="string")return f(l,h);var v=Object.prototype.toString.call(l).slice(8,-1);if(v==="Object"&&l.constructor&&(v=l.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(l,h)}}var s=r.default.forwardRef(function(l,h){var v=l.className,w=l.children,j=C(l,["className","children"]),N=(0,a.useTheme)().timelineBody,k=N.styles,A=k.base,M=m((0,i.useTimelineItem)(),1),D=M[0],L=(0,n.twMerge)((0,o.default)(A),v);return r.default.createElement("div",b({},j,{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,w))});s.propTypes={children:c.propTypeChildren,className:c.propTypeClassName},s.displayName="MaterialTailwind.TimelineHeader";var u=s})(Rk);var Mk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(T,C){for(var x in C)Object.defineProperty(T,x,{enumerable:!0,get:C[x]})}t(e,{TimelineHeader:function(){return S},default:function(){return O}});var r=f(P),n=rt,o=f(et),a=Ze,i=qo;function c(){return c=Object.assign||function(T){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(T,m)&&(x[m]=T[m])}return x}function b(T,C){if(T==null)return{};var x={},m=Object.keys(T),d,s;for(s=0;s=0)&&(x[d]=T[d]);return x}var S=r.default.forwardRef(function(T,C){var x=T.className,m=T.children,d=g(T,["className","children"]),s=(0,a.useTheme)().timelineHeader,u=s.styles,l=u.base,h=(0,n.twMerge)((0,o.default)(l),x);return r.default.createElement("div",c({},d,{ref:C,className:h}),m)});S.propTypes={children:i.propTypeChildren,className:i.propTypeClassName},S.displayName="MaterialTailwind.TimelineHeader";var O=S})(Mk);var Ik={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,h){for(var v in h)Object.defineProperty(l,v,{enumerable:!0,get:h[v]})}t(e,{TimelineConnector:function(){return s},default:function(){return u}});var r=S(P),n=rt,o=S(et),a=Ze,i=Pu,c=qo;function f(l,h){(h==null||h>l.length)&&(h=l.length);for(var v=0,w=new Array(h);v=0)&&Object.prototype.propertyIsEnumerable.call(l,w)&&(v[w]=l[w])}return v}function x(l,h){if(l==null)return{};var v={},w=Object.keys(l),j,N;for(N=0;N=0)&&(v[j]=l[j]);return v}function m(l,h){return g(l)||O(l,h)||d(l,h)||T()}function d(l,h){if(l){if(typeof l=="string")return f(l,h);var v=Object.prototype.toString.call(l).slice(8,-1);if(v==="Object"&&l.constructor&&(v=l.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(l,h)}}var s=r.default.forwardRef(function(l,h){var v=l.className,w=l.children,j=C(l,["className","children"]),N,k=(0,a.useTheme)().timelineConnector,A=k.styles,M=A.base,D=m((0,i.useTimelineItem)(),1),L=D[0],B=(0,o.default)(M.line),U=(0,n.twMerge)((0,o.default)(M.container),v);return r.default.createElement("span",b({},j,{ref:h,className:U,style:{top:"".concat(L,"px"),width:"".concat(L,"px"),opacity:L?1:0,height:"calc(100% - ".concat(L,"px)")}}),w&&r.default.isValidElement(w)?r.default.cloneElement(w,{className:(0,n.twMerge)(B,(N=w.props)===null||N===void 0?void 0:N.className)}):r.default.createElement("span",{className:B}))});s.propTypes={children:c.propTypeChildren,className:c.propTypeClassName},s.displayName="MaterialTailwind.TimelineConnector";var u=s})(Ik);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,u){for(var l in u)Object.defineProperty(s,l,{enumerable:!0,get:u[l]})}t(e,{Timeline:function(){return m},TimelineItem:function(){return c.default},TimelineIcon:function(){return f.default},TimelineBody:function(){return g.default},TimelineHeader:function(){return b.default},TimelineConnector:function(){return S.default},default:function(){return d}});var r=T(P),n=rt,o=T(et),a=Ze,i=qo,c=T(Pu),f=T(Ak),g=T(Rk),b=T(Mk),S=T(Ik);function O(){return O=Object.assign||function(s){for(var u=1;u=0)&&Object.prototype.propertyIsEnumerable.call(s,h)&&(l[h]=s[h])}return l}function x(s,u){if(s==null)return{};var l={},h=Object.keys(s),v,w;for(w=0;w=0)&&(l[v]=s[v]);return l}var m=r.default.forwardRef(function(s,u){var l=s.className,h=s.children,v=C(s,["className","children"]),w=(0,a.useTheme)().timeline,j=w.styles,N=j.base,k=(0,n.twMerge)((0,o.default)(N),l);return r.default.createElement("ul",O({ref:u},v,{className:k}),h)});m.propTypes={className:i.propTypeClassName,children:i.propTypeChildren},m.displayName="MaterialTailwind.Timeline";var d=Object.assign(m,{Item:c.default,Icon:f.default,Header:b.default,Body:g.default,Connector:S.default})})(jk);var Dk={},Lk={},Sb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(g,b){for(var S in b)Object.defineProperty(g,S,{enumerable:!0,get:b[S]})}t(e,{propTypesActiveStep:function(){return o},propTypesIsLastStep:function(){return a},propTypesIsFirstStep:function(){return i},propTypesChildren:function(){return c},propTypesClassName:function(){return f}});var r=n(nt);function n(g){return g&&g.__esModule?g:{default:g}}var o=r.default.number,a=r.default.func,i=r.default.func,c=r.default.node,f=r.default.string})(Sb);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(T,C){for(var x in C)Object.defineProperty(T,x,{enumerable:!0,get:C[x]})}t(e,{Step:function(){return S},default:function(){return O}});var r=f(P),n=rt,o=f(et),a=Ze,i=Sb;function c(){return c=Object.assign||function(T){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(T,m)&&(x[m]=T[m])}return x}function b(T,C){if(T==null)return{};var x={},m=Object.keys(T),d,s;for(s=0;s=0)&&(x[d]=T[d]);return x}var S=r.default.forwardRef(function(T,C){var x=T.className;T.activeClassName,T.completedClassName;var m=T.children,d=g(T,["className","activeClassName","completedClassName","children"]),s=(0,a.useTheme)().step,u=s.styles.base,l=(0,n.twMerge)((0,o.default)(u.initial),x);return r.default.createElement("div",c({},d,{ref:C,className:l}),m)});S.propTypes={className:i.propTypesClassName,activeClassName:i.propTypesClassName,completedClassName:i.propTypesClassName,children:i.propTypesChildren},S.displayName="MaterialTailwind.Step";var O=S})(Lk);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(N,k){for(var A in k)Object.defineProperty(N,A,{enumerable:!0,get:k[A]})}t(e,{Stepper:function(){return w},Step:function(){return c.default},default:function(){return j}});var r=T(P),n=pr,o=rt,a=T(et),i=Ze,c=T(Lk),f=Sb;function g(N,k){(k==null||k>N.length)&&(k=N.length);for(var A=0,M=new Array(k);A=0)&&Object.prototype.propertyIsEnumerable.call(N,M)&&(A[M]=N[M])}return A}function l(N,k){if(N==null)return{};var A={},M=Object.keys(N),D,L;for(L=0;L=0)&&(A[D]=N[D]);return A}function h(N,k){return b(N)||C(N,k)||v(N,k)||x()}function v(N,k){if(N){if(typeof N=="string")return g(N,k);var A=Object.prototype.toString.call(N).slice(8,-1);if(A==="Object"&&N.constructor&&(A=N.constructor.name),A==="Map"||A==="Set")return Array.from(A);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return g(N,k)}}var w=r.default.forwardRef(function(N,k){var A=N.activeStep,M=N.isFirstStep,D=N.isLastStep,L=N.className,B=N.lineClassName,U=N.activeLineClassName,Y=N.children,q=u(N,["activeStep","isFirstStep","isLastStep","className","lineClassName","activeLineClassName","children"]),z=(0,i.useTheme)(),$=z.stepper,K=z.step,X=$.styles.base,te=K.styles,me=te.base,de=r.default.useRef(null),ee=h(r.default.useState(0),2),Se=ee[0],pe=ee[1],fe=A===0,be=Array.isArray(Y)&&A===Y.length-1,ye=Array.isArray(Y)&&A>Y.length-1;r.default.useEffect(function(){if(de.current){var qe=Y,Je=de.current.getBoundingClientRect().width,Qe=Je/(qe.length-1);pe(Qe)}},[Y]);var Pe=r.default.useMemo(function(){if(!ye)return Se*A},[A,ye,Se]);(0,n.useMergeRefs)([k,de]);var Me=(0,o.twMerge)((0,a.default)(X.stepper),L),ke=(0,o.twMerge)((0,a.default)(X.line.initial),B),ce=(0,o.twMerge)(ke,(0,a.default)(X.line.active),U),je=(0,a.default)(me.active),He=(0,a.default)(me.completed);return r.default.useEffect(function(){D&&typeof D=="function"&&D(be),M&&typeof M=="function"&&M(fe)},[M,fe,D,be]),r.default.createElement("div",O({},q,{ref:de,className:Me}),r.default.createElement("div",{className:ke}),r.default.createElement("div",{className:ce,style:{width:"".concat(Pe,"px")}}),Array.isArray(Y)?Y.map(function(qe,Je){var Qe,Ge;return r.default.cloneElement(qe,s(m({key:Je},qe.props),{className:(0,o.twMerge)(qe.props.className,Je===A?(0,o.twMerge)(je,(Qe=qe.props)===null||Qe===void 0?void 0:Qe.activeClassName):Je=0)&&Object.prototype.propertyIsEnumerable.call(m,u)&&(s[u]=m[u])}return s}function T(m,d){if(m==null)return{};var s={},u=Object.keys(m),l,h;for(h=0;h=0)&&(s[l]=m[l]);return s}var C=r.default.forwardRef(function(m,d){var s=m.children,u=O(m,["children"]),l,h=(0,o.useSpeedDial)(),v=h.getReferenceProps,w=h.refs,j=(0,n.useMergeRefs)([d,w.setReference]);return r.default.cloneElement(s,g({},v(S(g({},u),{ref:j,className:(0,a.twMerge)(s==null||(l=s.props)===null||l===void 0?void 0:l.className,u==null?void 0:u.className)}))))});C.propTypes={children:i.propTypesChildren},C.displayName="MaterialTailwind.SpeedDialHandler";var x=C}(Ph)),Ph}var kh={},Bw;function Rz(){return Bw||(Bw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(m,d){for(var s in d)Object.defineProperty(m,s,{enumerable:!0,get:d[s]})}t(e,{SpeedDialContent:function(){return C},default:function(){return x}});var r=S(P),n=xr,o=pr,a=Cb(),i=Ze,c=rt,f=S(et),g=ku;function b(){return b=Object.assign||function(m){for(var d=1;d=0)&&Object.prototype.propertyIsEnumerable.call(m,u)&&(s[u]=m[u])}return s}function T(m,d){if(m==null)return{};var s={},u=Object.keys(m),l,h;for(h=0;h=0)&&(s[l]=m[l]);return s}var C=r.default.forwardRef(function(m,d){var s=m.children,u=m.className,l=O(m,["children","className"]),h=(0,i.useTheme)(),v=h.speedDialContent.styles,w=(0,a.useSpeedDial)(),j=w.x,N=w.y,k=w.refs,A=w.open,M=w.strategy,D=w.getFloatingProps,L=w.animation,B=(0,o.useMergeRefs)([d,k.setFloating]),U=(0,c.twMerge)((0,f.default)(v),u),Y=n.AnimatePresence;return r.default.createElement(n.LazyMotion,{features:n.domAnimation},r.default.createElement(Y,null,A&&r.default.createElement("div",b({},l,{ref:B,className:U,style:{position:M,top:N??0,left:j??0}},D()),r.default.Children.map(s,function(q){return r.default.createElement(n.m.div,{initial:"unmount",exit:"unmount",animate:A?"mount":"unmount",variants:L},q)}))))});C.propTypes={children:g.propTypesChildren,className:g.propTypesClassName},C.displayName="MaterialTailwind.SpeedDialContent";var x=C}(kh)),kh}var Fk={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(T,C){for(var x in C)Object.defineProperty(T,x,{enumerable:!0,get:C[x]})}t(e,{SpeedDialAction:function(){return S},default:function(){return O}});var r=f(P),n=Ze,o=rt,a=f(et),i=ku;function c(){return c=Object.assign||function(T){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(T,m)&&(x[m]=T[m])}return x}function b(T,C){if(T==null)return{};var x={},m=Object.keys(T),d,s;for(s=0;s=0)&&(x[d]=T[d]);return x}var S=r.default.forwardRef(function(T,C){var x=T.className,m=T.children,d=g(T,["className","children"]),s=(0,n.useTheme)(),u=s.speedDialAction.styles,l=(0,o.twMerge)((0,a.default)(u),x);return r.default.createElement("button",c({},d,{ref:C,className:l}),m)});S.propTypes={children:i.propTypesChildren,className:i.propTypesClassName},S.displayName="SpeedDialAction";var O=S})(Fk);var Vw;function Cb(){return Vw||(Vw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(h,v){for(var w in v)Object.defineProperty(h,w,{enumerable:!0,get:v[w]})}t(e,{SpeedDialContext:function(){return d},useSpeedDial:function(){return s},SpeedDial:function(){return u},SpeedDialHandler:function(){return c.default},SpeedDialContent:function(){return f.default},SpeedDialAction:function(){return g.default},default:function(){return l}});var r=O(P),n=pr,o=Ze,a=O(Tr),i=ku,c=O(Az()),f=O(Rz()),g=O(Fk);function b(h,v){(v==null||v>h.length)&&(v=h.length);for(var w=0,j=new Array(v);w.");return h}function u(h){var v=h.open,w=h.handler,j=h.placement,N=h.offset,k=h.dismiss,A=h.animate,M=h.children,D=(0,o.useTheme)(),L=D.speedDial.defaultProps,B=x(r.default.useState(!1),2),U=B[0],Y=B[1];v=v??U,w=w??Y,j=j??L.placement,N=N??L.offset,k=k??L.dismiss,A=A??L.animate;var q={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)(q,A),$=(0,n.useFloatingNodeId)(),K=(0,n.useFloating)({open:v,nodeId:$,placement:j,onOpenChange:w,whileElementsMounted:n.autoUpdate,middleware:[(0,n.offset)(N),(0,n.flip)(),(0,n.shift)()]}),X=K.x,te=K.y,me=K.strategy,de=K.refs,ee=K.context,Se=(0,n.useInteractions)([(0,n.useHover)(ee,{handleClose:(0,n.safePolygon)()}),(0,n.useDismiss)(ee,k)]),pe=Se.getReferenceProps,fe=Se.getFloatingProps,be=r.default.useMemo(function(){return{x:X,y:te,strategy:me,refs:de,open:v,context:ee,getReferenceProps:pe,getFloatingProps:fe,animation:z}},[ee,fe,pe,de,me,X,te,v,z]);return r.default.createElement(d.Provider,{value:be},r.default.createElement("div",{className:"group"},r.default.createElement(n.FloatingNode,{id:$},M)))}u.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},u.displayName="MaterialTailwind.SpeedDial";var l=Object.assign(u,{Handler:c.default,Content:f.default,Action:g.default})}(Oh)),Oh}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),t(X5,e),t(QO,e),t(XO,e),t(ZO,e),t(eP,e),t(tP,e),t(aP,e),t(iP,e),t(sP,e),t(Bf,e),t(KP,e),t(YP,e),t(ek,e),t(rk,e),t(ak,e),t(ik,e),t(sk,e),t(uk,e),t(ck,e),t(gk,e),t(mk,e),t(bk,e),t(vk,e),t(xk,e),t(_k,e),t(Sk,e),t(Tk,e),t(Pk,e),t(kk,e),t(Nk,e),t(Ek,e),t(jk,e),t(Dk,e),t(Cb(),e),t(Ze,e),t(Cm,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}})(H);function Mz({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const Iz=P.forwardRef(Mz),Dz=Iz;function Lz({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"}))}const Fz=P.forwardRef(Lz),zz=Fz;function Bz({title:e,titleId:t,...r},n){return P.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?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const Vz=P.forwardRef(Bz),zk=Vz,Tb=xo.createContext(null);Tb.displayName="MaterialTailwindContext";function Uz(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 Ob({children:e}){const t={openSidenav:!1,sidenavColor:"gray",sidenavType:"white",transparentNavbar:!1,fixedNavbar:!0,openConfigurator:!1},[r,n]=xo.useReducer(Uz,t),o=xo.useMemo(()=>[r,n],[r,n]);return y.jsx(Tb.Provider,{value:o,children:e})}function Yf(){const e=xo.useContext(Tb);if(!e)throw new Error("useMaterialTailwindController should be used inside the MaterialTailwindControllerProvider.");return e}Ob.displayName="/src/context/index.jsx";Ob.propTypes={children:sn.node.isRequired};const Bk=(e,t)=>e({type:"OPEN_SIDENAV",value:t}),Wz=(e,t)=>e({type:"SIDENAV_COLOR",value:t}),$z=(e,t)=>e({type:"FIXED_NAVBAR",value:t}),Pb=(e,t)=>e({type:"OPEN_CONFIGURATOR",value:t}),Nh={none:0,read:1,full:2},kb=P.createContext(null);kb.displayName="AuthContext";const Hz=e=>!e||typeof e!="object"||Array.isArray(e)?{}:Object.entries(e).reduce((t,[r,n])=>{if(typeof r!="string"||!r)return t;const o=typeof n=="string"?n:String(n??"").trim();return t[r]=o||"none",t},{});function qz({children:e}){const[t,r]=P.useState({user:null,permissions:{},loading:!1,error:null,lastErrorCode:null,initialized:!1}),n=P.useCallback(g=>{const b=(g==null?void 0:g.user)??null,S=Hz(g==null?void 0:g.permissions);r({user:b,permissions:S,loading:!1,error:null,lastErrorCode:null,initialized:!0})},[]),o=P.useCallback(()=>{r(g=>({user:null,permissions:{},loading:!1,error:null,lastErrorCode:null,initialized:g.initialized||!0}))},[]),a=P.useCallback(async()=>{r(g=>({...g,loading:!0,error:null,lastErrorCode:null}));try{const g=await fetch("/api/auth/session",{credentials:"include"}),b=await g.json().catch(()=>({}));return g.ok?(n(b),{ok:!0,data:b}):(r({user:null,permissions:{},loading:!1,error:(b==null?void 0:b.error)??null,lastErrorCode:(b==null?void 0:b.error)??null,initialized:!0}),{ok:!1,status:g.status,error:(b==null?void 0:b.error)??null})}catch(g){const b=(g==null?void 0:g.message)||"NETWORK_ERROR";return r({user:null,permissions:{},loading:!1,error:b,lastErrorCode:"NETWORK_ERROR",initialized:!0}),{ok:!1,error:b}}},[n]),i=P.useCallback(async()=>{let g=null;try{const b=await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(!b.ok){const S=await b.json().catch(()=>({})),O=new Error((S==null?void 0:S.error)||"LOGOUT_FAILED");throw O.code=(S==null?void 0:S.error)||`STATUS_${b.status}`,O}}catch(b){g=b}finally{o()}if(g)throw g},[o]),c=P.useCallback((g,b="full")=>{var C,x;if(!g||(C=t.user)!=null&&C.isSuperuser)return!0;const S=((x=t.permissions)==null?void 0:x[g])??"none",O=Nh[S]??0,T=Nh[b]??Nh.full;return O>=T},[t.permissions,t.user]),f=P.useMemo(()=>({user:t.user,permissions:t.permissions,loading:t.loading,error:t.error,lastErrorCode:t.lastErrorCode,initialized:t.initialized,isAuthenticated:!!t.user,refreshSession:a,setSession:n,clearSession:o,logout:i,hasPermission:c}),[t,a,n,o,i,c]);return y.jsx(kb.Provider,{value:f,children:e})}function Ur(){const e=P.useContext(kb);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const Gz="/assets/stackpulse-846837e9.png";function Qf({brandImg:e,brandName:t,routes:r}){const[n,o]=Yf(),{sidenavColor:a,sidenavType:i,openSidenav:c}=n,{initialized:f,hasPermission:g}=Ur(),b={dark:"bg-gradient-to-br from-gray-800 to-gray-900",white:"bg-white shadow-sm",transparent:"bg-transparent"};return y.jsxs("aside",{className:`${b[i]} ${c?"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:[y.jsxs("div",{className:"relative py-6 px-8 text-right",children:[y.jsx("img",{src:Gz,alt:"StackPulse",className:"w-auto"}),y.jsx("span",{className:"mt-1 text-xs text-stormGrey-500 block antialiased font-sans",children:"v0.5"}),y.jsx(H.IconButton,{variant:"text",size:"sm",ripple:!1,className:"absolute right-0 top-0 grid rounded-br-none rounded-tl-none",onClick:()=>Bk(o,!1),children:y.jsx(zk,{strokeWidth:2.5,className:"h-5 w-5 text-black"})})]}),y.jsx("div",{className:"m-4",children:r.map(({layout:S,title:O,pages:T},C)=>{const x=T.filter(({permission:m,hidden:d})=>{if(d)return!1;if(!m||!m.key)return!0;if(!f)return!1;const s=m.requiredLevel||m.level||"full";return g(m.key,s)});return S!=="dashboard"&&S!=="auth"||x.length===0&&!O?null:y.jsxs("ul",{className:"mb-4 flex flex-col gap-1",children:[O&&y.jsx("li",{className:"mx-3.5 mt-4 mb-2",children:y.jsx(H.Typography,{variant:"small",color:i==="dark"?"white":"blue-gray",className:"font-black uppercase opacity-75",children:O})}),x.map(({icon:m,name:d,path:s})=>y.jsx("li",{children:y.jsx(VI,{to:`/${S}${s}`,children:({isActive:u})=>y.jsxs(H.Button,{variant:u?"gradient":"text",color:u?a:i==="dark"?"white":"blue-gray",className:"flex items-center gap-4 px-4 capitalize",fullWidth:!0,children:[m,y.jsx(H.Typography,{color:"inherit",className:"font-medium capitalize",children:d})]})})},d))]},C)})})]})}Qf.defaultProps={brandImg:"/img/logo-ct.png",brandName:"Material Tailwind React"};Qf.propTypes={brandImg:sn.string,brandName:sn.string,routes:sn.arrayOf(sn.object).isRequired};Qf.displayName="/src/widgets/layout/sidnave.jsx";function Vk(){const[e,t]=Yf(),{fixedNavbar:r,openSidenav:n}=e,{pathname:o}=Ea();return o.split("/").filter(a=>a!==""),y.jsx(H.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:y.jsxs("div",{className:"flex justify-between gap-6 flex-row items-center",children:[y.jsx("div",{className:"capitalize"}),y.jsxs("div",{className:"flex items-center",children:[y.jsx(H.IconButton,{variant:"text",color:"blue-gray",className:"grid xl:hidden",onClick:()=>Bk(t,!n),children:y.jsx(QI,{strokeWidth:3,className:"h-6 w-6 text-blue-gray-500"})}),y.jsx(H.IconButton,{variant:"text",color:"blue-gray",onClick:()=>Pb(t,!0),children:y.jsx(Q5,{className:"h-5 w-5 text-blue-gray-500 "})})]})]})})}Vk.displayName="/src/widgets/layout/dashboard-navbar.jsx";function Kz(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=>c(Kz(g.stargazers_count,1)))},[]),y.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:[y.jsxs("div",{className:"flex items-start justify-between px-6 pt-8 pb-6",children:[y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:"Dashboard Configurator"}),y.jsx(H.Typography,{className:"font-normal text-blue-gray-600",children:"See our dashboard options."})]}),y.jsx(H.IconButton,{variant:"text",color:"blue-gray",onClick:()=>Pb(t,!1),children:y.jsx(zk,{strokeWidth:2.5,className:"h-5 w-5"})})]}),y.jsxs("div",{className:"py-4 px-6",children:[y.jsxs("div",{className:"mb-12",children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",children:"Sidenav Colors"}),y.jsx("div",{className:"mt-3 flex items-center gap-2",children:Object.keys(f).map(g=>y.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))})]}),y.jsxs("div",{className:"mb-12",children:[y.jsx("hr",{}),y.jsxs("div",{className:"flex items-center justify-between py-5",children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",children:"Navbar Fixed"}),y.jsx(H.Switch,{defaultChecked:!0,id:"navbar-fixed",value:a,onChange:()=>$z(t,!a)})]})]})]})]})}Uk.displayName="/src/widgets/layout/configurator.jsx";function Wk(){const e=new Date().getFullYear();return y.jsx("footer",{children:y.jsx("div",{className:"flex w-full flex-wrap items-center justify-center md:justify-end",children:y.jsxs(H.Typography,{variant:"small",className:"mt-1 text-xs text-stormGrey-500 block antialiased font-sans",children:["StackPulse: © ",e," by Michael Böhmländer"]})})})}Wk.displayName="/src/widgets/layout/footer.jsx";sn.string,sn.arrayOf(sn.object).isRequired,sn.node;const _o=Object.create(null);_o.open="0";_o.close="1";_o.ping="2";_o.pong="3";_o.message="4";_o.upgrade="5";_o.noop="6";const ed=Object.create(null);Object.keys(_o).forEach(e=>{ed[_o[e]]=e});const cg={type:"error",data:"parser error"},$k=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Hk=typeof ArrayBuffer=="function",qk=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Nb=({type:e,data:t},r,n)=>$k&&t instanceof Blob?r?n(t):Uw(t,n):Hk&&(t instanceof ArrayBuffer||qk(t))?r?n(t):Uw(new Blob([t]),n):n(_o[e]+(t||"")),Uw=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function Ww(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Eh;function Yz(e,t){if($k&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ww).then(t);if(Hk&&(e.data instanceof ArrayBuffer||qk(e.data)))return t(Ww(e.data));Nb(e,!1,r=>{Eh||(Eh=new TextEncoder),t(Eh.encode(r))})}const $w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<$w.length;e++)yl[$w.charCodeAt(e)]=e;const Qz=e=>{let t=e.length*.75,r=e.length,n,o=0,a,i,c,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|c>>2,b[o++]=(c&3)<<6|f&63;return g},Xz=typeof ArrayBuffer=="function",Eb=(e,t)=>{if(typeof e!="string")return{type:"message",data:Gk(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:Zz(e.substring(1),t)}:ed[r]?e.length>1?{type:ed[r],data:e.substring(1)}:{type:ed[r]}:cg},Zz=(e,t)=>{if(Xz){const r=Qz(e);return Gk(r,t)}else return{base64:!0,data:e}},Gk=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Kk=String.fromCharCode(30),Jz=(e,t)=>{const r=e.length,n=new Array(r);let o=0;e.forEach((a,i)=>{Nb(a,!1,c=>{n[i]=c,++o===r&&t(n.join(Kk))})})},eB=(e,t)=>{const r=e.split(Kk),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 jh;function Sc(e){return e.reduce((t,r)=>t+r.length,0)}function Cc(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){c.enqueue(cg);break}o=b*Math.pow(2,32)+g.getUint32(4),n=3}else{if(Sc(r)e){c.enqueue(cg);break}}}})}const Yk=4;function lr(e){if(e)return nB(e)}function nB(e){for(var t in lr.prototype)e[t]=lr.prototype[t];return e}lr.prototype.on=lr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};lr.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};lr.prototype.off=lr.prototype.removeListener=lr.prototype.removeAllListeners=lr.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))(),Cn=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),oB="arraybuffer";function Qk(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}const aB=Cn.setTimeout,iB=Cn.clearTimeout;function Zf(e,t){t.useNativeTimers?(e.setTimeoutFn=aB.bind(Cn),e.clearTimeoutFn=iB.bind(Cn)):(e.setTimeoutFn=Cn.setTimeout.bind(Cn),e.clearTimeoutFn=Cn.clearTimeout.bind(Cn))}const sB=1.33;function lB(e){return typeof e=="string"?uB(e):Math.ceil((e.byteLength||e.size)*sB)}function uB(e){let t=0,r=0;for(let n=0,o=e.length;n=57344?r+=3:(n++,r+=4);return r}function Xk(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function cB(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function dB(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)};eB(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,Jz(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]=Xk()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let Zk=!1;try{Zk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hB=Zk;function gB(){}class mB extends pB{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 as=class td extends lr{constructor(t,r,n){super(),this.createRequest=t,Zf(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=Qk(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=td.requestsCount++,td.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=gB,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete td.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()}};as.requestsCount=0;as.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Hw);else if(typeof addEventListener=="function"){const e="onpagehide"in Cn?"pagehide":"unload";addEventListener(e,Hw,!1)}}function Hw(){for(let e in as.requests)as.requests.hasOwnProperty(e)&&as.requests[e].abort()}const bB=function(){const e=Jk({xdomain:!1});return e&&e.responseType!==null}();class vB extends mB{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=bB&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new as(Jk,this.uri(),t)}}function Jk(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hB))return new XMLHttpRequest}catch{}if(!t)try{return new Cn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const eN=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yB extends jb{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,n=eN?{}:Qk(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&&Xf(()=>{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]=Xk()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const Ah=Cn.WebSocket||Cn.MozWebSocket;class xB extends yB{createSocket(t,r,n){return eN?new Ah(t,r,n):r?new Ah(t,r):new Ah(t)}doWrite(t,r){this.ws.send(r)}}class wB extends jb{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=rB(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(r).getReader(),o=tB();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const a=()=>{n.read().then(({done:c,value:f})=>{c||(this.onPacket(f),a())}).catch(c=>{})};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&&Xf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const _B={websocket:xB,webtransport:wB,polling:vB},SB=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,CB=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function dg(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=SB.exec(e||""),a={},i=14;for(;i--;)a[CB[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=TB(a,a.path),a.queryKey=OB(a,a.query),a}function TB(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 OB(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,a){o&&(r[o]=a)}),r}const fg=typeof addEventListener=="function"&&typeof removeEventListener=="function",rd=[];fg&&addEventListener("offline",()=>{rd.forEach(e=>e())},!1);class Sa extends lr{constructor(t,r){if(super(),this.binaryType=oB,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=dg(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=dg(r.host).host);Zf(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=dB(this.opts.query)),fg&&(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"})},rd.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=Yk,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&&Sa.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",Sa.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,Xf(()=>{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(Sa.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(),fg&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=rd.indexOf(this._offlineEventListener);n!==-1&&rd.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}Sa.protocol=Yk;class PB extends Sa{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",S=>{if(!n)if(S.type==="pong"&&S.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Sa.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=S=>{const O=new Error("probe error: "+S);O.transport=r.name,a(),this.emitReserved("upgradeError",O)};function c(){i("transport closed")}function f(){i("socket closed")}function g(S){r&&S.name!==r.name&&a()}const b=()=>{r.removeListener("open",o),r.removeListener("error",i),r.removeListener("close",c),this.off("close",f),this.off("upgrading",g)};r.once("open",o),r.once("error",i),r.once("close",c),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;n_B[o]).filter(o=>!!o)),super(t,n)}};function NB(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=dg(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 EB=typeof ArrayBuffer=="function",jB=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,tN=Object.prototype.toString,AB=typeof Blob=="function"||typeof Blob<"u"&&tN.call(Blob)==="[object BlobConstructor]",RB=typeof File=="function"||typeof File<"u"&&tN.call(File)==="[object FileConstructor]";function Ab(e){return EB&&(e instanceof ArrayBuffer||jB(e))||AB&&e instanceof Blob||RB&&e instanceof File}function nd(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 c=0;c{this.io.clearTimeoutFn(a),r.apply(this,c)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...r){return new Promise((n,o)=>{const a=(i,c)=>i?o(i):n(c);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:wt.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 wt.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 wt.EVENT:case wt.BINARY_EVENT:this.onevent(t);break;case wt.ACK:case wt.BINARY_ACK:this.onack(t);break;case wt.DISCONNECT:this.ondisconnect();break;case wt.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:wt.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:wt.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}Fs.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};Fs.prototype.reset=function(){this.attempts=0};Fs.prototype.setMin=function(e){this.ms=e};Fs.prototype.setMax=function(e){this.max=e};Fs.prototype.setJitter=function(e){this.jitter=e};class gg extends lr{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,Zf(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 Fs({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||BB;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 kB(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const o=Wn(r,"open",function(){n.onopen(),t&&t()}),a=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},i=Wn(r,"error",a);if(this._timeout!==!1){const c=this._timeout,f=this.setTimeoutFn(()=>{o(),a(new Error("timeout")),r.close()},c);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(Wn(t,"ping",this.onping.bind(this)),Wn(t,"data",this.ondata.bind(this)),Wn(t,"error",this.onerror.bind(this)),Wn(t,"close",this.onclose.bind(this)),Wn(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){Xf(()=>{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 rN(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 cl={};function od(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=NB(e,t.path||"/socket.io"),n=r.source,o=r.id,a=r.path,i=cl[o]&&a in cl[o].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let f;return c?f=new gg(n,t):(cl[o]||(cl[o]=new gg(n,t)),f=cl[o]),r.query&&!t.query&&(t.query=r.queryKey),f.socket(r.path,t)}Object.assign(od,{Manager:gg,Socket:rN,io:od,connect:od});const nN=P.createContext(null),Rh={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"}},UB=6e3;function WB({children:e}){const[t,r]=P.useState([]),n=P.useRef(new Map),o=P.useCallback(c=>{r(g=>g.filter(b=>b.id!==c));const f=n.current.get(c);f&&typeof window<"u"&&window.clearTimeout(f),n.current.delete(c)},[]),a=P.useCallback(({id:c,title:f,description:g,variant:b="info",duration:S=UB}={})=>{const O=c??`${Date.now()}-${Math.random().toString(16).slice(2)}`,T=Rh[b]?b:"info";if(r(C=>[...C.filter(m=>m.id!==O),{id:O,title:f,description:g,variant:T}]),S!==null&&S!==1/0&&typeof window<"u"){const C=window.setTimeout(()=>{o(O)},S),x=n.current.get(O);x&&window.clearTimeout(x),n.current.set(O,C)}return O},[o]);P.useEffect(()=>()=>{typeof window>"u"||(n.current.forEach(c=>window.clearTimeout(c)),n.current.clear())},[]);const i=P.useMemo(()=>({showToast:a,dismissToast:o}),[a,o]);return y.jsxs(nN.Provider,{value:i,children:[e,y.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(c=>{const f=Rh[c.variant]??Rh.info;return y.jsx("div",{className:`pointer-events-auto overflow-hidden rounded-lg border px-4 py-3 shadow-xl backdrop-blur ${f.container}`,children:y.jsxs("div",{className:"flex items-start gap-3",children:[y.jsx("span",{className:`mt-1 h-2 flex-shrink-0 w-2 rounded-full ${f.accent}`}),y.jsxs("div",{className:"flex-1",children:[c.title&&y.jsx("p",{className:"text-sm font-semibold",children:c.title}),c.description&&y.jsx("p",{className:"mt-1 text-sm leading-snug text-white/80",children:c.description})]}),y.jsx("button",{type:"button",onClick:()=>o(c.id),className:"ml-2 rounded-md p-1 text-xs uppercase tracking-wide text-white/60 transition hover:text-white/90",children:"Schließen"})]})},c.id)})})]})}function zs(){const e=P.useContext(nN);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}const oN=P.createContext(null),$B={maintenance:null,update:null,script:null,ssh:null,loading:!0,error:"",lastUpdated:null};function HB({children:e}){var k,A;const{isAuthenticated:t,hasPermission:r,user:n}=Ur(),o=!!(t&&(n!=null&&n.isSuperuser||r("maintenance-access","read"))),[a,i]=P.useState($B),c=P.useRef(null),f=P.useRef(!1),g=P.useCallback(M=>{i(D=>({...D,...M}))},[]),b=P.useCallback(async()=>{var M,D;if(!o)return g({loading:!1,error:""}),null;g({loading:!0,error:""});try{const B=(await lt.get("/api/maintenance/config")).data??{};g({maintenance:B.maintenance??null,update:B.update??null,script:B.script??null,ssh:B.ssh??null,loading:!1,error:"",lastUpdated:new Date})}catch(L){const B=((D=(M=L.response)==null?void 0:M.data)==null?void 0:D.error)||L.message||"Fehler beim Laden der Wartungsdaten";g({loading:!1,error:B})}},[g,o]),S=P.useCallback(async()=>{var M,D;if(o)try{const B=(await lt.get("/api/maintenance/update-status")).data??{};i(U=>({...U,maintenance:B.maintenance??U.maintenance,update:B.update??U.update,error:""}))}catch(L){const B=((D=(M=L.response)==null?void 0:M.data)==null?void 0:D.error)||L.message||"Fehler beim Aktualisieren des Wartungsstatus";i(U=>({...U,error:B}))}},[o]);P.useEffect(()=>{if(!o){g({loading:!1,error:""});return}b()},[g,b,o]),P.useEffect(()=>{var M;if(o){if((M=a.update)!=null&&M.running){S();const D=setInterval(()=>{S()},5e3);return c.current=D,()=>clearInterval(D)}c.current&&(clearInterval(c.current),c.current=null)}},[o,(k=a.update)==null?void 0:k.running,S]),P.useEffect(()=>{var D;const M=!!((D=a.update)!=null&&D.running);o&&!M&&f.current&&b(),f.current=M},[o,(A=a.update)==null?void 0:A.running,b]);const O=P.useCallback(async(M={})=>{await lt.post("/api/maintenance/portainer-update",M),await S()},[S]),T=P.useCallback(async M=>{await lt.put("/api/maintenance/update-script",{script:M}),await b()},[b]),C=P.useCallback(async()=>{await lt.delete("/api/maintenance/update-script"),await b()},[b]),x=P.useCallback(async M=>{await lt.put("/api/maintenance/ssh-config",M),await b()},[b]),m=P.useCallback(async()=>{await lt.delete("/api/maintenance/ssh-config"),await b()},[b]),d=P.useCallback(async({active:M,message:D}={})=>{var Y;const L={active:!!M};D!==void 0&&(L.message=D);const U=((Y=(await lt.post("/api/maintenance/mode",L)).data)==null?void 0:Y.maintenance)??null;return g({maintenance:U,error:""}),U},[g]),s=P.useCallback(async M=>(await lt.post("/api/maintenance/test-ssh",M??{})).data,[]),u=P.useCallback(async()=>{const D=(await lt.get("/api/auth/superuser/status")).data??{};return{exists:!!D.exists,user:D.user??null}},[]),l=P.useCallback(async()=>(await lt.get("/api/setup/status")).data??{},[]),h=P.useCallback(async M=>(await lt.delete(`/api/setup/servers/${M}`)).data??{success:!1},[]),v=P.useCallback(async(M,D)=>(await lt.put(`/api/setup/servers/${M}/api-key`,{apiKey:D})).data??{success:!1},[]),w=P.useCallback(async M=>(await lt.put("/api/setup/self-stack",{selfStackId:M})).data??{success:!1},[]),j=P.useCallback(async()=>(await lt.delete("/api/auth/superuser")).data??{success:!1},[]),N=P.useMemo(()=>({maintenance:a.maintenance,update:a.update,script:a.script,ssh:a.ssh,loading:a.loading,error:a.error,lastUpdated:a.lastUpdated,refreshConfig:b,refreshUpdateStatus:S,setMaintenanceMode:d,triggerUpdate:O,saveScript:T,resetScript:C,saveSshConfig:x,deleteSshConfig:m,testSshConnection:s,fetchSuperuserStatus:u,fetchSetupStatus:l,deleteSetupServer:h,updateSetupApiKey:v,updateSelfStackId:w,removeSuperuserAccount:j}),[a,b,S,d,O,T,C,x,m,s,u,l,h,v,w,j]);return y.jsx(oN.Provider,{value:N,children:e})}function Aa(){const e=P.useContext(oN);if(!e)throw new Error("useMaintenance must be used within a MaintenanceProvider");return e}const qB=[{value:"10",label:"10"},{value:"25",label:"25"},{value:"50",label:"50"},{value:"100",label:"100"},{value:"all",label:"Alle"}],Gw="50",aN=P.createContext(null),GB=(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 KB({children:e,initialPage:t=1,initialPerPage:r=Gw,perPageOptions:n=qB}){const[o,a]=P.useState(t),[i,c]=P.useState(r),[f,g]=P.useState(0),[b,S]=P.useState(0),O=P.useRef(t),T=P.useRef(r),C=P.useMemo(()=>new Set(n.map(A=>String(A.value))),[n]),x=i==="all",m=P.useCallback(()=>x?null:GB(i,r),[i,x,r]),d=P.useCallback((A,M)=>{g(Math.max(0,Number(A)||0)),S(Math.max(0,Number(M)||0))},[]),s=P.useCallback(()=>{a(O.current??1),c(T.current??Gw),g(0),S(0)},[]),u=P.useCallback((A,{resetPage:M=!0}={})=>{if(A==null)return;const D=String(A);C.has(D)&&(c(D),M&&a(1))},[C]),l=P.useCallback(A=>{var D;const M=typeof A=="string"?A:(D=A==null?void 0:A.target)==null?void 0:D.value;u(M,{resetPage:!0})},[u]),h=P.useCallback(A=>{if(x)return;const M=Number(A);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)},[x,m,f]),v=P.useMemo(()=>{if(x)return 1;const A=m();return A?Math.max(1,Math.ceil((f||0)/A)):1},[x,m,f]),w=P.useMemo(()=>{if(!f)return 0;if(x)return 1;const A=m();return(o-1)*A+1},[f,x,m,o]),j=P.useMemo(()=>{if(!f)return 0;if(x)return f;const A=m(),M=(o-1)*A+(b||A);return Math.min(f,M)},[f,x,m,o,b]),N=P.useMemo(()=>f?x?`Zeige alle ${f.toLocaleString()} Einträge`:`Zeige ${w.toLocaleString()} – ${j.toLocaleString()} von ${f.toLocaleString()} Einträgen`:"Keine Einträge",[f,x,w,j]),k=P.useMemo(()=>({page:o,perPage:i,perPageOptions:n,perPageIsAll:x,totalItems:f,visibleItems:b,totalPages:v,rangeStart:w,rangeEnd:j,summaryLabel:N,setPage:a,setPerPage:u,setTotals:d,setTotalItems:g,setVisibleItems:S,handlePageChange:h,handlePerPageChange:l,validPerPageValues:C,resetPagination:s}),[o,i,n,x,f,b,v,w,j,N,d,u,h,l,C,s]);return y.jsx(aN.Provider,{value:k,children:e})}function Nu(){const e=P.useContext(aN);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}=Nu();return y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[y.jsx("span",{children:t}),!r&&y.jsxs("div",{className:"flex items-center gap-2",children:[y.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:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4",children:y.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"})})}),y.jsxs("p",{className:"text-slate-600",children:["Seite ",y.jsx("strong",{className:"text-slate-800",children:n})," / ",y.jsx("strong",{className:"text-slate-800",children:o})]}),y.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:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4",children:y.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 Tc="stackSelectionPreference",YB=30*1e3,QB=30*1e3;let Qa={data:null,timestamp:0},Oc=null;const St={QUEUED:"queued",STARTED:"started",SUCCESS:"success",ERROR:"error",INFO:"info"},XB={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},ZB=()=>!!Qa.data&&Date.now()-Qa.timestamp{Qa={data:e,timestamp:Date.now()}},JB=e=>Array.isArray(e)?[...e].sort((t,r)=>((t==null?void 0:t.Name)||"").localeCompare((r==null?void 0:r.Name)||"")):[];function eV(){const[e,t]=P.useState(()=>JB(Qa.data)),[r,n]=P.useState(()=>!Qa.data),[o,a]=P.useState(""),[i,c]=P.useState([]),[f,g]=P.useState("all"),[b,S]=P.useState(""),[O,T]=P.useState(!1),[C,x]=P.useState(!1),[m,d]=P.useState(!1),{showToast:s}=zs(),{maintenance:u,update:l,script:h,ssh:v}=Aa(),{hasPermission:w}=Ur(),j=w("stacks-redeploy-single","full"),N=w("stacks-redeploy-selection","full"),k=w("stacks-redeploy-all","full"),A=!!(u!=null&&u.active),M=u==null?void 0:u.message,D=!!(l!=null&&l.running),L=A||D,B=l!=null&&l.stage?XB[l.stage]??l.stage:"–",{page:U,perPage:Y,perPageOptions:q,setPage:z,setTotals:$,handlePerPageChange:K,resetPagination:X}=Nu(),te=P.useCallback(()=>{},[]);P.useEffect(()=>()=>X(),[X]),P.useEffect(()=>{L&&(n(!1),t([]),c([]))},[L]);const me=P.useRef(new Map),de=P.useCallback((ae,ge)=>{const oe=new Map(ae.map(se=>[se.Id,se]));return[...ge].sort((se,ie)=>se.Name.localeCompare(ie.Name)).map(se=>{const ie=oe.get(se.Id);if(ie&&ie.updateStatus==="✅"&&se.updateStatus==="⚠️"){const Fe=se.Name?`${se.Name} (ID: ${se.Id})`:`Stack ${se.Id}`;s({variant:"warning",title:"Aktualisierung gefunden",description:Fe})}let he=se.redeployPhase??(ie==null?void 0:ie.redeployPhase)??null;!he&&(se.redeploying||ie!=null&&ie.redeploying)&&(he=St.STARTED);const Oe=he===St.QUEUED,Ce=he===St.STARTED;return{...se,redeployPhase:he,redeployQueued:Oe,redeploying:Oe||Ce,redeployDisabled:se.redeployDisabled??(ie==null?void 0:ie.redeployDisabled)??!1,duplicateName:se.duplicateName??(ie==null?void 0:ie.duplicateName)??!1}})},[s]);P.useEffect(()=>{const ae=od("/",{path:"/socket.io",transports:["websocket"]});return console.log("🔌 Socket connected"),ae.on("redeployStatus",async(ge={})=>{const{stackId:oe}=ge;if(!oe)return;let ve=oe;if(typeof oe=="string"){const Fe=Number(oe);Number.isNaN(Fe)||(ve=Fe)}const se=ge.redeployPhase??ge.phase;let ie=se;ie?se==="started"||se==="running"?ie=St.STARTED:se==="queued"?ie=St.QUEUED:se==="success"?ie=St.SUCCESS:se==="error"?ie=St.ERROR:se==="info"&&(ie=St.INFO):ge.isRedeploying===!0?ie=St.STARTED:ge.isRedeploying===!1&&(ie=St.SUCCESS);const he=me.current.get(ve)??me.current.get(String(ve)),Oe=ge.stackName??(he==null?void 0:he.Name),Ce=Oe?`${Oe} (ID: ${ve})`:`Stack ${ve}`;if(console.log(`🔄 Stack ${ve} Redeploy Update: ${ie??"unbekannt"}`),ie===St.STARTED)s({variant:"info",title:"Redeploy gestartet",description:Ce});else if(ie===St.SUCCESS)s({variant:"success",title:"Redeploy abgeschlossen",description:Ce});else if(ie===St.ERROR){const Fe=ge.message?` – ${ge.message}`:"";s({variant:"error",title:"Redeploy fehlgeschlagen",description:`${Ce}${Fe}`})}if(t(Fe=>Fe.map(Ie=>{if(String(Ie.Id)!==String(ve))return Ie;const Ee=ie??Ie.redeployPhase??null,dt=Ee===St.QUEUED,ft=Ee===St.STARTED,Ft=Ee===St.SUCCESS,Kt=Ee===St.ERROR,Pt=dt||ft,Rt={...Ie,redeployPhase:Ee,redeployQueued:dt,redeploying:Pt};return Ft&&(Rt.updateStatus="✅",Rt.redeploying=!1,Rt.redeployQueued=!1),Kt&&(Rt.redeploying=!1,Rt.redeployQueued=!1),!Pt&&!Ft&&!Kt&&ie===void 0&&(Rt.redeploying=!1,Rt.redeployQueued=!1,Rt.redeployPhase=Ie.redeployPhase??null),Rt})),ie===St.SUCCESS||ie===St.ERROR||ge.isRedeploying===!1&&!ie)try{const Fe=await lt.get("/api/stacks");Kw(Fe.data),t(Ie=>de(Ie,Fe.data))}catch(Fe){console.error("Fehler beim Aktualisieren nach Redeploy:",Fe)}}),()=>ae.disconnect()},[]);const ee=P.useCallback(async({force:ae=!1,silent:ge=!1}={})=>{if(A||D){ge||n(!1);return}const oe=!!Qa.data;if(!ae&&oe&&(t(se=>de(se,Qa.data)),!ge&&(n(!1),ZB())))return;const ve=!ge&&(!oe||ae);ve&&n(!0);try{(ae||!Oc)&&(Oc=lt.get("/api/stacks").then(ie=>(Kw(ie.data),ie.data)).finally(()=>{Oc=null}));const se=await Oc;t(ie=>de(ie,se)),a("")}catch(se){console.error("❌ Fehler beim Abrufen der Stacks:",se),!oe&&!ge&&a("Fehler beim Laden der Stacks")}finally{ve&&n(!1)}},[A,D,de]);P.useEffect(()=>{ee()},[ee]),P.useEffect(()=>{if(typeof document>"u"||A||D)return;const ae=setInterval(()=>{document.hidden||ee({force:!0,silent:!0})},QB);return()=>clearInterval(ae)},[ee,A,D]),P.useEffect(()=>{if(typeof document>"u"||A||D)return;const ae=()=>{document.hidden||ee({force:!0,silent:!0})};return document.addEventListener("visibilitychange",ae),()=>{document.removeEventListener("visibilitychange",ae)}},[ee,A,D]),P.useEffect(()=>{c(ae=>{const ge=ae.filter(oe=>{const ve=e.find(ie=>ie.Id===oe);if(!ve||ve.updateStatus==="✅"||ve.redeployDisabled)return!1;const se=ve.redeployPhase;return!(se===St.STARTED||se===St.QUEUED)});return ge.length===ae.length?ae:ge})},[e]),P.useEffect(()=>{const ae=new Map;e.forEach(ge=>{ae.set(ge.Id,ge),ae.set(String(ge.Id),ge)}),me.current=ae},[e]);const Se=b.trim().toLowerCase(),pe=P.useMemo(()=>e.filter(ae=>!(f==="current"&&ae.updateStatus!=="✅"||f==="outdated"&&ae.updateStatus==="✅"||Se&&!`${ae.Name??""} ${ae.Id??""}`.toLowerCase().includes(Se))),[e,f,Se]),fe=P.useMemo(()=>pe.filter(ae=>{if(ae.updateStatus==="✅"||ae.redeployDisabled)return!1;const ge=ae.redeployPhase;return!(ge===St.STARTED||ge===St.QUEUED)}),[pe]),be=P.useMemo(()=>{const ae=new Map;return e.forEach(ge=>{ae.set(ge.Id,ge)}),ae},[e]);P.useMemo(()=>new Set(pe.map(ae=>ae.Id)),[pe]);const ye=P.useMemo(()=>{if(Y==="all")return pe;const ae=Number(Y),ge=(U-1)*ae;return pe.slice(ge,ge+ae)},[pe,Y,U]);P.useEffect(()=>{$(pe.length,ye.length)},[pe.length,ye.length,$]);const Pe=P.useRef({action:"keep",remember:!1}),Me=P.useRef({status:f,search:Se}),ke=P.useRef(!1);P.useEffect(()=>{if(!(typeof window>"u"))try{const ae=window.sessionStorage.getItem(Tc);if(!ae)return;const ge=JSON.parse(ae);ge&&(ge.action==="keep"||ge.action==="clear")&&(Pe.current={action:ge.action,remember:!0},d(!0))}catch(ae){console.error("⚠️ Konnte gespeicherte Auswahl-Einstellung nicht laden:",ae),Pe.current={action:"keep",remember:!1}}},[]),P.useEffect(()=>{const ae=Se;if(!ke.current){ke.current=!0,Me.current={status:f,search:ae};return}const ge=Me.current;if(!(ge.status!==f||ge.search!==ae)){f==="all"&&ae.length===0&&O&&T(!1);return}if(Me.current={status:f,search:ae},i.length===0){T(!1);return}if(!(f!=="all"||ae.length>0)){T(!1);return}const se=Pe.current;if(se!=null&&se.remember){se.action==="clear"&&c([]),T(!1);return}x(!!(se!=null&&se.remember)),T(!0)},[f,Se,i.length,O]),P.useEffect(()=>{i.length===0&&O&&T(!1)},[i.length,O]);const ce=f!=="all"||Se.length>0;P.useEffect(()=>{z(1)},[f,Se,z]),P.useEffect(()=>{if(Y==="all"){U!==1&&z(1);return}const ae=Number(Y)||1,ge=Math.max(1,Math.ceil(pe.length/ae));U>ge&&z(ge)},[pe.length,Y,U,z]);const je=(ae,ge)=>{N&&(ge||c(oe=>oe.includes(ae)?oe.filter(ve=>ve!==ae):[...oe,ae]))};P.useEffect(()=>{N||(i.length&&c([]),O&&T(!1))},[N,i.length,O]);const He=ae=>{if(!N)return;const ge=C;if(typeof window<"u")try{if(ge){const oe={action:ae,remember:!0};window.sessionStorage.setItem(Tc,JSON.stringify(oe)),Pe.current=oe}else window.sessionStorage.removeItem(Tc),Pe.current={action:ae,remember:!1}}catch(oe){console.error("⚠️ Konnte Auswahl-Einstellung nicht speichern:",oe),Pe.current={action:ae,remember:!1}}else Pe.current={action:ae,remember:!1};d(ge),x(ge),ae==="clear"&&c([]),T(!1)},qe=()=>{if(N){if(typeof window<"u")try{window.sessionStorage.removeItem(Tc)}catch(ae){console.error("⚠️ Konnte gespeicherte Auswahl-Einstellung nicht löschen:",ae)}Pe.current={action:"keep",remember:!1},d(!1),x(!1),ce&&i.length>0&&T(!0)}},Je=()=>{N&&(c([]),T(!1))},Qe=ae=>{N&&c(ge=>ge.filter(oe=>oe!==ae))},Ge=async ae=>{if(!j)return;const ge=me.current.get(ae),oe=ge==null?void 0:ge.redeployPhase;if(!(oe===St.STARTED||oe===St.QUEUED)){c(ve=>ve.filter(se=>se!==ae)),t(ve=>ve.map(se=>se.Id===ae?{...se,redeployPhase:St.STARTED,redeploying:!0,redeployQueued:!1}:se));try{await lt.put(`/api/stacks/${ae}/redeploy`)}catch(ve){if(console.error("❌ Fehler beim Redeploy:",ve),t(se=>se.map(ie=>ie.Id===ae?{...ie,redeployPhase:null,redeploying:!1,redeployQueued:!1}:ie)),!ve.response){const se=me.current.get(ae),ie=se!=null&&se.Name?`${se.Name} (ID: ${ae})`:`Stack ${ae}`,he=ve.message||"Unbekannter Fehler";s({variant:"error",title:"Redeploy fehlgeschlagen",description:`${ie} – ${he}`})}}}},Xe=async()=>{var oe,ve;if(!k||!fe.length)return;const ae=fe.map(se=>se.Id),ge=new Set(ae.map(se=>String(se)));t(se=>se.map(ie=>{const he=String(ie.Id);return ge.has(he)?{...ie,redeployPhase:St.QUEUED,redeploying:!0,redeployQueued:!0}:ie}));try{ce?await lt.put("/api/stacks/redeploy-selection",{stackIds:ae}):await lt.put("/api/stacks/redeploy-all"),c(se=>se.filter(ie=>!ge.has(String(ie))))}catch(se){console.error("❌ Fehler beim Redeploy ALL:",se),t(he=>he.map(Oe=>{const Ce=String(Oe.Id);return ge.has(Ce)?{...Oe,redeployPhase:null,redeploying:!1,redeployQueued:!1}:Oe}));const ie=((ve=(oe=se.response)==null?void 0:oe.data)==null?void 0:ve.error)||se.message||"Unbekannter Fehler";s({variant:"error",title:"Redeploy ALL fehlgeschlagen",description:ie})}},ht=async()=>{var oe,ve;if(!N||!i.length)return;const ae=i.filter(se=>{const ie=e.find(Oe=>Oe.Id===se);if(!ie||ie.updateStatus==="✅"||ie.redeployDisabled)return!1;const he=ie.redeployPhase;return!(he===St.STARTED||he===St.QUEUED)});if(!ae.length){c([]);return}const ge=new Set(ae);t(se=>se.map(ie=>ge.has(ie.Id)?{...ie,redeployPhase:St.QUEUED,redeploying:!0,redeployQueued:!0}:ie));try{await lt.put("/api/stacks/redeploy-selection",{stackIds:ae}),c(se=>se.filter(ie=>!ge.has(ie)))}catch(se){console.error("❌ Fehler beim Redeploy Auswahl:",se),t(he=>he.map(Oe=>ge.has(Oe.Id)?{...Oe,redeployPhase:null,redeploying:!1,redeployQueued:!1}:Oe));const ie=((ve=(oe=se.response)==null?void 0:oe.data)==null?void 0:ve.error)||se.message||"Unbekannter Fehler";s({variant:"error",title:"Redeploy Auswahl fehlgeschlagen",description:ie})}},Ve=N&&i.length>0,ot=fe.length>0,_t=N&&Ve||k,Ne=N&&Ve?`Redeploy Auswahl (${i.length})`:"Redeploy Alle",at=L||(N&&Ve?O||i.every(ae=>{const ge=e.find(ve=>ve.Id===ae);if(!ge||ge.updateStatus==="✅"||ge.redeployDisabled)return!0;const oe=ge.redeployPhase;return oe===St.STARTED||oe===St.QUEUED}):!k||!ot),Te=()=>{if(L){s({variant:"warning",title:"Wartungsmodus aktiv",description:"Redeploy-Aktionen sind während des Wartungsmodus deaktiviert."});return}N&&Ve?ht():k&&Xe()};return y.jsxs("div",{className:"mt-12 mb-8 flex flex-col gap-12",children:[(A||D)&&y.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("span",{children:["Wartungsmodus aktiv",M?` – ${M}`:D?" – Portainer-Update läuft":"","."]}),D&&y.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",B]})]})}),y.jsxs(H.Card,{children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"p-4 pt-2 pb-2",children:!r&&!o?y.jsx(H.Typography,{variant:"h6",color:"white",children:y.jsx("span",{className:"flex items-center gap-2",children:y.jsx("span",{children:"Filter und Optionen"})})}):y.jsx(H.Typography,{variant:"h6",color:"white",children:y.jsx("span",{className:"flex items-center gap-2",children:y.jsx("span",{children:"Lade Stacks"})})})}),y.jsxs(H.CardBody,{children:[r?y.jsxs("p",{className:"flex py-6 text-center text-sm font-medium text-gray-400",children:[y.jsx(H.Spinner,{className:"mr-2 h-4 w-4 flex"}),"Lade Stacks..."]}):o?y.jsx("p",{className:"py-6 text-sm font-medium text-red-400",children:o}):y.jsxs("div",{className:"gap-4",children:[y.jsx("div",{className:"w-full",children:y.jsxs(H.ButtonGroup,{fullWidth:!0,children:[y.jsx(H.Button,{onClick:()=>g("all"),children:"Alle"}),y.jsx(H.Button,{onClick:()=>g("current"),children:"Aktuell"}),y.jsx(H.Button,{onClick:()=>g("outdated"),children:"Veraltet"})]})}),y.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between mt-8",children:[y.jsx("div",{className:"md:flex-1",children:y.jsx(H.Input,{value:b,onChange:ae=>S(ae.target.value),variant:"static",placeholder:"Name oder ID"})}),y.jsx("div",{className:"md:mt-0 mt-8 md:flex-1",children:y.jsx(H.Select,{variant:"static",label:"Einträge pro Seite",onChange:te,value:Y,children:q.map(({value:ae,label:ge})=>y.jsx(H.Option,{value:ae,onClick:()=>K(ae),children:ge},ae))})})]}),y.jsx("div",{className:"flex items-center justify-end gap-3 mt-5",children:N&&m&&y.jsx("button",{onClick:qe,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"})})]}),N&&O&&y.jsx("div",{className:"flex flex-col mt-5",children:y.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:[y.jsxs("div",{className:"space-y-2 block antialiased font-sans text-sm font-light leading-normal text-inherit",children:[y.jsxs("p",{children:[i.length===1?"1 Stack ist weiterhin ausgewählt.":`${i.length} Stacks sind weiterhin ausgewählt.`," ","Soll die Auswahl entfernt werden?"]}),y.jsxs("label",{className:"flex items-center gap-2",children:[y.jsx("input",{type:"checkbox",checked:C,onChange:ae=>x(ae.target.checked),className:"h-4 w-4 rounded border border-arcticBlue-400 bg-arcticBlue-900 text-arcticBlue-400 focus:ring-arcticBlue-300"}),y.jsx("span",{className:"text-xs",children:"Einstellung merken (bis Browser geschlossen wird)"})]})]}),y.jsxs("div",{className:"flex gap-2",children:[y.jsx(H.Button,{onClick:()=>He("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"}),y.jsx(H.Button,{onClick:()=>He("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&&y.jsxs("div",{id:"collect",className:"mt-8 flex flex-col gap-4 md:flex-row md:items-start md:gap-6",children:[N&&i.length>0&&y.jsx("div",{className:"w-full md:order-first order-last md:w-3/4",children:y.jsxs("div",{className:"flex flex-col gap-3 text-sm text-gray-300",children:[y.jsx("div",{className:"flex flex-wrap items-center gap-2",children:i.map(ae=>{const ge=be.get(ae),oe=(ge==null?void 0:ge.Name)||`Stack ${ae}`;return y.jsxs("button",{type:"button",onClick:()=>Qe(ae),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:[y.jsx("span",{children:oe}),y.jsx("span",{className:"text-xs font-semibold text-lavenderSmoke-200",children:"x"})]},ae)})}),y.jsx("button",{type:"button",onClick:Je,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"})]})}),y.jsx("div",{className:"w-full md:w-1/4 md:ml-auto",children:y.jsx(H.Button,{className:"w-full bg-arcticBlue-500 hover:bg-arcticBlue-600",onClick:Te,disabled:at,children:Ne})})]})]})]}),y.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:ye.map(ae=>{const ge=ae.redeployPhase,oe=ge===St.QUEUED,ve=ge===St.STARTED,se=oe||ve,ie=i.includes(ae.Id),he=ae.updateStatus==="✅",Oe=!!ae.redeployDisabled,Ce=!se&&!he&&!Oe,Ue=N&&Ce;return y.jsx(H.Card,{children:y.jsxs(H.CardBody,{className:`flex w-full text-stormGrey-500 items-center justify-between gap-4 rounded-xl shadow-lg transition border ${ie?"border-purple-500 ring-1 ring-purple-500/40":"border-transparent"} ${!Ce||se?"opacity-75 bg-stormGrey-200/20":""}`,children:[y.jsxs("div",{className:"flex items-center space-x-4",id:"left",children:[N&&y.jsx("input",{type:"checkbox",checked:ie,onChange:()=>je(ae.Id,!Ue),className:`h-5 w-5 text-purple-500 focus:ring-purple-400 border-gray-600 bg-gray-900 rounded ${Ue?"":"opacity-40 cursor-not-allowed"}`,disabled:!Ue}),y.jsx("div",{className:`w-12 h-12 flex items-center justify-center rounded-full ${ae.updateStatus==="✅"?"bg-mossGreen-600":ae.updateStatus==="⚠️"?"bg-warmAmberGlow-400":"bg-sunsetCoral-500"}`}),y.jsxs("div",{children:[y.jsx("p",{className:"text-lg antialiased font-sans font-semibold leading-normal text-inherit",children:ae.Name}),y.jsxs("p",{className:"text-sm antialiased font-sans font-light leading-normal text-inherit",children:["ID: ",ae.Id]}),ae.duplicateName&&y.jsx("p",{className:"text-xs text-amber-700",children:"⚠️ Doppelter Name erkannt"})]})]}),y.jsx("div",{className:"ml-auto flex flex-col items-end gap-1 text-sm",id:"right",children:ve?y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"antialiased font-sans font-light leading-normal text-xs uppercase tracking-wide text-warmAmberGlow-600",children:"Redeploy"}),y.jsx("span",{className:"text-warmAmberGlow-500",children:"läuft…"})]}):oe?y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"antialiased font-sans font-light leading-normal text-xs uppercase tracking-wide text-warmAmberGlow-600",children:"Redeploy"}),y.jsx("span",{className:"text-warmAmberGlow-500",children:"in Warteliste…"})]}):Oe?y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"antialiased font-sans font-light leading-normal text-xs uppercase tracking-wide text-stormGrey-500",children:"System"}),y.jsx("span",{className:"text-gray-300",children:"Redeploy deaktiviert"})]}):he?y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"antialiased font-sans font-light leading-normal text-xs uppercase tracking-wide text-stormGrey-500",children:"Status"}),y.jsx("span",{className:"text-mossGreen-600",children:"Aktuell"})]}):j?y.jsx(H.Button,{onClick:()=>Ge(ae.Id),disabled:L||se,className:"disabled:opacity-50 disabled:cursor-not-allowed",children:"Redeploy"}):null})]})},ae.Id)})}),y.jsx(Jf,{disabled:r||!!o})]})}const tV={idle:"Bereit",running:"Läuft",success:"Erfolgreich",error:"Fehlgeschlagen"},dl={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"},rV={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},nV={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"},oV=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"})},Ua=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"})},Yw=e=>e===1?"Git":e===2?"Compose":e??"-",Mh=()=>({host:"",port:"22",username:"",password:"",extraSshArgs:""});function aV(){var Ws,Vu,Uu,$s;const{hasPermission:e,user:t}=Ur(),r=P.useCallback(()=>{},[]),{maintenance:n,update:o,script:a,ssh:i,loading:c,error:f,setMaintenanceMode:g,triggerUpdate:b,saveScript:S,resetScript:O,saveSshConfig:T,deleteSshConfig:C,testSshConnection:x,fetchSuperuserStatus:m,fetchSetupStatus:d,deleteSetupServer:s,updateSetupApiKey:u,updateSelfStackId:l,removeSuperuserAccount:h}=Aa(),v=!!(t!=null&&t.isSuperuser),w=!!(v||e("maintenance-access","read")),j=!!(v||e("maintenance-access","full")),N=!!(v||e("maintenance-server-manage","read")),k=!!(v||e("maintenance-server-manage","full")),A=!!(v||e("maintenance-server-delete","full")),M=!!(v||e("maintenance-superuser-delete","full")),D=!!(v||e("maintenance-portainer","read")),L=!!(v||e("maintenance-update","full")),B=!!(v||e("maintenance-ssh-update","read")),U=!!(v||e("maintenance-ssh-update","full")),Y=!!(v||e("maintenance-duplicates","read")),q=!!(v||e("maintenance-duplicates","full")),z=!!(n!=null&&n.active),$=n==null?void 0:n.message,K=(Ws=n==null?void 0:n.extra)==null?void 0:Ws.type,X=!!(o!=null&&o.running),te=z||X,[me,de]=P.useState(""),[ee,Se]=P.useState(!1),[pe,fe]=P.useState(!1),[be,ye]=P.useState(""),[Pe,Me]=P.useState(!1),[ke,ce]=P.useState(()=>Mh()),[je,He]=P.useState(!1),[qe,Je]=P.useState(!1),[Qe,Ge]=P.useState(!1),[Xe,ht]=P.useState(!1),[Ve,ot]=P.useState(!1),[_t,Ne]=P.useState(null);P.useEffect(()=>{if(!a)return;const xe=a.custom??a.default??a.effective??"";de(xe)},[a]),P.useEffect(()=>{if(!i){ce(Mh()),He(!1),Je(!1),Ne(null);return}ce({host:i.host??"",port:String(i.port??"22"),username:i.username??"",password:"",extraSshArgs:Array.isArray(i.extraSshArgs)?i.extraSshArgs.join(` `):""}),He(!!i.passwordStored),Je(!1),Ne(null)},[i]);const at=P.useMemo(()=>a?a.source==="custom"&&typeof a.custom=="string"?a.custom:a.default??a.effective??"":"",[a]),Te=a?me!==at:!1,ae=(a==null?void 0:a.source)==="custom"?"Benutzerdefiniert":"Standard",[ge,oe]=P.useState(!0),[ve,se]=P.useState(!1),[ie,he]=P.useState(null),[Oe,Ce]=P.useState(""),[Ue,Fe]=P.useState(!1),[Ie,Ee]=P.useState(null),[dt,ft]=P.useState(!0),[Ft,Kt]=P.useState(""),[Pt,Rt]=P.useState({}),[hr,ir]=P.useState(null),[Jr,jn]=P.useState(null),[Mr,en]=P.useState(""),[wr,no]=P.useState(!1),[An,J]=P.useState(""),[Ae,Be]=P.useState([]),[Mt,yt]=P.useState(!0),[Et,It]=P.useState(""),[or,kt]=P.useState(!1),[Rn,Ir]=P.useState(null),[gr,Mn]=P.useState(null),oo=P.useRef(null),[Ct,Ra]=P.useState(null),[To,ao]=P.useState(!0),[io,Oo]=P.useState(""),[Ma,xi]=P.useState(!1),[wi,Ia]=P.useState(null),mn=P.useRef(null),jt=P.useCallback(async({silent:xe=!1}={})=>{var Le,ze;oe(!0),Ce("");try{const We=await m(),it=!!(We!=null&&We.exists);se(it),he(it?We.user??null:null)}catch(We){const it=((ze=(Le=We.response)==null?void 0:Le.data)==null?void 0:ze.error)||We.message||"Superuser-Status konnte nicht geladen werden";se(!1),he(null),Ce(it),xe||r({variant:"error",title:"Statusabfrage fehlgeschlagen",description:it})}finally{oe(!1)}},[m,r]),Nt=P.useCallback(async({silent:xe=!1}={})=>{var Le,ze;xe||ft(!0),Kt("");try{const We=await d();Ee(We),Rt({})}catch(We){const it=((ze=(Le=We.response)==null?void 0:Le.data)==null?void 0:ze.error)||We.message||"Setup-Daten konnten nicht geladen werden";Kt(it),xe||r({variant:"error",title:"Setup-Daten",description:it})}finally{ft(!1)}},[d,r]),zt=P.useCallback(async({silent:xe=!1}={})=>{if(mn.current)return mn.current;const Le=(async()=>{var ze,We;xe?xi(!0):ao(!0),Oo("");try{const Wt=(await lt.get("/api/maintenance/portainer-status")).data??{};Ra(Wt),Ia(new Date)}catch(it){const Wt=((We=(ze=it.response)==null?void 0:ze.data)==null?void 0:We.error)||it.message||"Fehler beim Prüfen des Portainer-Status";Oo(Wt),r({variant:"error",title:"Statusaktualisierung fehlgeschlagen",description:Wt})}finally{xe?xi(!1):ao(!1),mn.current=null}})();return mn.current=Le,Le},[r]),Or=P.useCallback(async({silent:xe=!1}={})=>{if(z||X){Be([]),It("Wartungsmodus aktiv – Duplikat-Verwaltung ist vorübergehend deaktiviert."),yt(!1),kt(!1);return}if(oo.current)return oo.current;const Le=(async()=>{var ze,We,it;xe?kt(!0):yt(!0),It("");try{const Vt=(await lt.get("/api/maintenance/duplicates")).data,rn=Array.isArray(Vt)?Vt:(Vt==null?void 0:Vt.items)??[];Be(rn),Mn(new Date)}catch(Wt){if(((ze=Wt.response)==null?void 0:ze.status)===423){const Vt="Wartungsmodus aktiv – Duplikat-Verwaltung ist vorübergehend deaktiviert.";Be([]),It(Vt),r({variant:"warning",title:"Duplikat-Verwaltung gesperrt",description:Vt})}else{const Vt=((it=(We=Wt.response)==null?void 0:We.data)==null?void 0:it.error)||Wt.message||"Fehler beim Laden der Wartungsdaten";It(Vt),r({variant:"error",title:"Duplikate konnten nicht geladen werden",description:Vt})}}finally{xe?kt(!1):yt(!1),oo.current=null}})();return oo.current=Le,Le},[z,X,r]);P.useEffect(()=>{jt({silent:!0})},[jt]),P.useEffect(()=>{Nt()},[Nt]),P.useEffect(()=>{zt()},[zt]),P.useEffect(()=>{Or()},[Or]);const tn=P.useMemo(()=>{var xe;return((xe=Ie==null?void 0:Ie.servers)==null?void 0:xe.items)??[]},[Ie]),so=P.useMemo(()=>{var Le;const xe=((Le=Ie==null?void 0:Ie.apiKeys)==null?void 0:Le.items)??[];return new Map(xe.map(ze=>[ze.serverId,ze]))},[Ie]),Da=P.useMemo(()=>!!(Ie!=null&&Ie.setupComplete),[Ie]),In=(Ie==null?void 0:Ie.selfStack)??null,Dn=(In==null?void 0:In.current)??"",_i=((Vu=Ie==null?void 0:Ie.envDefaults)==null?void 0:Vu.selfStackId)??"";P.useEffect(()=>{en(Dn||""),J("")},[Dn]);const Bs=Mr!==Dn,Si=P.useMemo(()=>{const xe=Array.isArray(Ae)?Ae.length:0,Le=Array.isArray(Ae)?Ae.reduce((ze,We)=>{var it;return ze+(((it=We==null?void 0:We.duplicates)==null?void 0:it.length)||0)},0):0;return{groups:xe,duplicateCount:Le}},[Ae]),La=P.useCallback((xe,Le)=>{U&&(ce(ze=>({...ze,[xe]:Le})),xe==="password"&&He(!1))},[U]),Ci=P.useMemo(()=>{const xe={host:ke.host.trim(),port:Number.parseInt(ke.port,10)||22,username:ke.username.trim(),extraSshArgs:(ke.extraSshArgs||"").split(/\r?\n/).map(ze=>ze.trim()).filter(Boolean)},Le=ke.password??"";return Le?xe.password=Le:je||(xe.password=""),xe},[ke,je]),ep=P.useCallback(async()=>{var xe,Le;if(U&&a)try{Se(!0),await S(me),r({variant:"success",title:"Skript gespeichert",description:"Das benutzerdefinierte Portainer-Update-Skript wurde aktualisiert."})}catch(ze){const We=((Le=(xe=ze.response)==null?void 0:xe.data)==null?void 0:Le.error)||ze.message||"Skript konnte nicht gespeichert werden";r({variant:"error",title:"Speichern fehlgeschlagen",description:We})}finally{Se(!1)}},[U,S,me,a,r]),Eu=P.useCallback(async()=>{var xe,Le;if(U)try{Se(!0),await O(),r({variant:"info",title:"Standardskript wiederhergestellt",description:"Es wird wieder das Standard-Update-Skript verwendet."})}catch(ze){const We=((Le=(xe=ze.response)==null?void 0:xe.data)==null?void 0:Le.error)||ze.message||"Standardskript konnte nicht wiederhergestellt werden";r({variant:"error",title:"Zurücksetzen fehlgeschlagen",description:We})}finally{Se(!1)}},[U,O,r]),Po=P.useCallback(async()=>{var xe,Le;if(U)try{Ge(!0),await T(Ci),Ne(null),Je(!1),r({variant:"success",title:"SSH-Konfiguration gespeichert",description:"Verbindungseinstellungen wurden aktualisiert."})}catch(ze){const We=((Le=(xe=ze.response)==null?void 0:xe.data)==null?void 0:Le.error)||ze.message||"SSH-Konfiguration konnte nicht gespeichert werden";r({variant:"error",title:"Speichern fehlgeschlagen",description:We})}finally{Ge(!1)}},[U,Ci,T,r]),Ti=P.useCallback(async()=>{var xe,Le;if(U)try{ht(!0);const ze=await x(Ci);Ne({success:!0,timestamp:new Date,details:ze==null?void 0:ze.result}),r({variant:"success",title:"SSH-Verbindung erfolgreich",description:"Verbindung zum Portainer-Host wurde hergestellt."})}catch(ze){const We=((Le=(xe=ze.response)==null?void 0:xe.data)==null?void 0:Le.error)||ze.message||"SSH-Verbindung fehlgeschlagen";Ne({success:!1,timestamp:new Date,error:We}),r({variant:"error",title:"SSH-Test fehlgeschlagen",description:We})}finally{ht(!1)}},[U,Ci,x,r]),ju=P.useCallback(async()=>{var xe,Le;if(U)try{ot(!0),await C(),ce(Mh()),He(!1),Je(!1),Ne(null),r({variant:"info",title:"SSH-Konfiguration gelöscht",description:"Die Verbindungseinstellungen wurden zurückgesetzt."})}catch(ze){const We=((Le=(xe=ze.response)==null?void 0:xe.data)==null?void 0:Le.error)||ze.message||"SSH-Konfiguration konnte nicht gelöscht werden";r({variant:"error",title:"Löschen fehlgeschlagen",description:We})}finally{ot(!1)}},[U,C,r]),Au=P.useCallback(async()=>{var xe,Le,ze;if(!(!M||Ue||ge||!ve)&&!(typeof window<"u"&&!window.confirm(`Superuser und zugehörige Gruppe wirklich löschen? Dies setzt die Superuser-Einrichtung zurück.`)))try{Fe(!0);const We=await h(),it=Number((We==null?void 0:We.usersRemoved)??0);r({variant:"success",title:"Superuser gelöscht",description:it>1?`${it} Konten aus der Superuser-Gruppe wurden entfernt.`:"Superuser-Konto wurde entfernt."}),await jt({silent:!0})}catch(We){if(((xe=We.response)==null?void 0:xe.status)===404)await jt({silent:!0}),r({variant:"info",title:"Kein Superuser vorhanden",description:"Es ist kein Superuser mehr vorhanden."});else{const Wt=((ze=(Le=We.response)==null?void 0:Le.data)==null?void 0:ze.error)||We.message||"Superuser konnte nicht gelöscht werden";r({variant:"error",title:"Löschen fehlgeschlagen",description:Wt})}}finally{Fe(!1)}},[M,Ue,ge,ve,h,jt,r]),Ru=P.useCallback(async xe=>{var it,Wt;if(!A||Jr===xe)return;const Le=tn.find(Vt=>Vt.id===xe);if(!Le)return;const ze=Le.name||Le.url||`Server ${xe}`,We=[`Server "${ze}" wirklich löschen?`,"Das System benötigt anschließend erneut einen gültigen Server im Setup."].filter(Boolean).join(` `);if(!(typeof window<"u"&&!window.confirm(We))){jn(xe);try{await s(xe),r({variant:"success",title:"Server gelöscht",description:`Server "${ze}" wurde entfernt.`}),await Nt({silent:!0})}catch(Vt){const rn=((Wt=(it=Vt.response)==null?void 0:it.data)==null?void 0:Wt.error)||Vt.message||"Server konnte nicht gelöscht werden.";r({variant:"error",title:"Server löschen fehlgeschlagen",description:rn})}finally{jn(null)}}},[A,s,Nt,Jr,tn,r]),Mu=P.useCallback((xe,Le)=>{k&&Rt(ze=>({...ze,[xe]:Le}))},[k]),Vs=P.useCallback(async xe=>{var ze,We;if(!k)return;const Le=(Pt[xe]??"").trim();if(!Le){r({variant:"warning",title:"API-Key fehlt",description:"Bitte gib einen API-Key ein."});return}if(hr!==xe){ir(xe);try{await u(xe,Le),r({variant:"success",title:"API-Key aktualisiert",description:"Der API-Key wurde gespeichert."}),Rt(it=>({...it,[xe]:""})),await Nt({silent:!0})}catch(it){const Wt=((We=(ze=it.response)==null?void 0:ze.data)==null?void 0:We.error)||it.message||"API-Key konnte nicht aktualisiert werden.";r({variant:"error",title:"Aktualisierung fehlgeschlagen",description:Wt})}finally{ir(null)}}},[Pt,hr,k,Nt,r,u]),Iu=P.useCallback(xe=>{k&&(en(xe),J(""))},[k]),tp=P.useCallback(async()=>{var Le,ze;if(!k||!Bs)return;no(!0),J("");const xe=typeof Mr=="string"?Mr.trim():"";try{await l(xe),r({variant:"success",title:"Self-Stack-ID gespeichert",description:xe?`Self-Stack-ID wurde auf "${xe}" gesetzt.`:"Self-Stack-ID wurde entfernt."}),await Nt({silent:!0})}catch(We){const it=((ze=(Le=We.response)==null?void 0:Le.data)==null?void 0:ze.error)||We.message||"Self-Stack-ID konnte nicht aktualisiert werden.";J(it),r({variant:"error",title:"Self-Stack-ID",description:it})}finally{no(!1)}},[k,Nt,Bs,Mr,r,l]),Du=P.useCallback(async()=>{var xe,Le;if(k&&!(!Mr&&!Dn)&&!(typeof window<"u"&&!window.confirm("Self-Stack-ID wirklich entfernen?"))){no(!0),J("");try{await l(""),en(""),r({variant:"success",title:"Self-Stack-ID entfernt",description:"Die Self-Stack-ID wurde gelöscht."}),await Nt({silent:!0})}catch(ze){const We=((Le=(xe=ze.response)==null?void 0:xe.data)==null?void 0:Le.error)||ze.message||"Self-Stack-ID konnte nicht entfernt werden.";J(We),r({variant:"error",title:"Self-Stack-ID",description:We})}finally{no(!1)}}},[k,Dn,Nt,Mr,r,l]),Oi=P.useCallback(async xe=>{var Le,ze;if(j&&!(c||Pe)&&xe!==z){if(X){r({variant:"warning",title:"Aktion nicht möglich",description:"Während eines laufenden Updates kann der Wartungsmodus nicht geändert werden."});return}Me(!0);try{const We=xe&&!!K,it={active:xe};We&&$?it.message=$:it.message=null,await g(it),r({variant:xe?"info":"success",title:xe?"Wartungsmodus aktiviert":"Wartungsmodus deaktiviert",description:xe?"Benutzer sehen jetzt die Wartungsseite.":"StackPulse steht wieder zur Verfügung."})}catch(We){const it=((ze=(Le=We.response)==null?void 0:Le.data)==null?void 0:ze.error)||We.message||"Wartungsmodus konnte nicht geändert werden";r({variant:"error",title:"Änderung fehlgeschlagen",description:it})}finally{Me(!1)}}},[j,c,Pe,z,X,g,$,K,r]),rp=P.useCallback(async()=>{var Le,ze;if(!L)return;if(z||X){r({variant:"warning",title:"Update nicht möglich",description:"Während eines aktiven Wartungsmodus kann kein weiteres Update gestartet werden."});return}const xe=(Ct==null?void 0:Ct.latestVersion)??(Ct==null?void 0:Ct.currentVersion)??"unbekannt";if(!(typeof window<"u"&&!window.confirm(`Portainer-Update starten? Zielversion: ${xe}. Während des Updates befindet sich StackPulse im Wartungsmodus. Fortfahren?`)))try{ye(""),fe(!0),await b(),r({variant:"info",title:"Update gestartet",description:"Das Portainer-Update wurde gestartet."})}catch(We){const it=((ze=(Le=We.response)==null?void 0:Le.data)==null?void 0:ze.error)||We.message||"Portainer-Update konnte nicht gestartet werden";ye(it),r({variant:"error",title:"Update fehlgeschlagen",description:it})}finally{fe(!1)}},[L,z,X,Ct,b,r]),Lu=P.useCallback(async xe=>{var it,Wt,Vt,rn;if(!q||!xe)return;if(z||X){r({variant:"warning",title:"Aktion nicht möglich",description:"Während des Wartungsmodus sind Bereinigungen deaktiviert."});return}const Le=(it=xe.canonical)==null?void 0:it.Id;if(!Le)return;const ze=(xe.duplicates||[]).map(ko=>ko.Id).filter(Boolean);if(!ze.length)return;const We=((Wt=xe.canonical)==null?void 0:Wt.Name)||xe.name||`Stack ${Le}`;if(!(typeof window<"u"&&!window.confirm(`Bereinigung für "${We}" starten? Es werden ${ze.length} Duplikate entfernt: ${ze.join(", ")}`))){Ir(String(Le));try{const Wr=(await lt.post("/api/maintenance/duplicates/cleanup",{canonicalId:Le,duplicateIds:ze})).data??{};if(Wr.success===!1)throw new Error(Wr.error||"Bereinigung fehlgeschlagen");const Pi=Array.isArray(Wr.results)?Wr.results.filter(za=>za.status==="deleted").map(za=>za.id):ze;r({variant:"success",title:"Bereinigung abgeschlossen",description:`${We} – entfernte IDs: ${Pi.join(", ")}`}),await Or({silent:!0})}catch(ko){const Wr=((rn=(Vt=ko.response)==null?void 0:Vt.data)==null?void 0:rn.error)||ko.message||"Bereinigung fehlgeschlagen";r({variant:"error",title:"Bereinigung fehlgeschlagen",description:Wr})}finally{Ir(null)}}},[q,Or,z,r,X]);n!=null&&n.activatedAt&&Ua(n.activatedAt),n!=null&&n.updatedAt&&Ua(n.updatedAt);const Ln=z||X,Fa=(o==null?void 0:o.status)??(X?"running":"idle"),Us=tV[Fa]??Fa,np=dl[Fa]??dl.idle,Fu=o!=null&&o.stage?rV[o.stage]??o.stage:"–",zu=(o==null?void 0:o.logs)??[],op=(o==null?void 0:o.targetVersion)??"-",ap=(o==null?void 0:o.resultVersion)??"-",ip=o!=null&&o.startedAt?Ua(o.startedAt):"-",sp=o!=null&&o.finishedAt?Ua(o.finishedAt):"-",Bu=(o==null?void 0:o.message)??(X?"Update läuft…":""),lo=X||ee||c;return w?y.jsxs("div",{className:"mt-12 mb-8 flex flex-col gap-12",children:[(z||X)&&y.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("span",{children:["Wartungsmodus aktiv",$?` – ${$}`:X?" – Portainer-Update läuft":"","."]}),X&&y.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",Fu]})]})}),w&&y.jsxs(H.Card,{children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:y.jsx(H.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:y.jsx("span",{children:"Wartungsmodus"})})}),y.jsxs(H.CardBody,{className:"flex flex-col gap-4 p-4",children:[y.jsxs("div",{className:"flex items-start justify-between gap-4",children:[y.jsx("div",{className:"space-y-1",children:y.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."})}),y.jsx(H.Switch,{checked:z,disabled:!j||Pe||c||X,onChange:xe=>Oi(xe.target.checked),ripple:!1,color:"amber"})]}),Pe&&y.jsx("p",{className:"text-xs text-stormGrey-500",children:"Wartungsmodus wird aktualisiert…"})]})]}),N&&y.jsxs(H.Card,{children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:y.jsx(H.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:y.jsx("span",{children:"Server & API-Keys"})})}),y.jsxs(H.CardBody,{className:"flex flex-col gap-4 p-4",children:[dt&&y.jsx("p",{className:"text-sm text-stormGrey-500",children:"Daten werden geladen…"}),!dt&&Ft&&y.jsx(H.Alert,{color:"red",className:"border border-red-200 bg-red-50 text-red-700",children:Ft}),!dt&&!Ft&&y.jsxs("div",{className:"flex flex-col gap-6",children:[y.jsxs("div",{className:"flex flex-col gap-3",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx(H.Typography,{variant:"small",color:"blue-gray",className:"font-semibold uppercase",children:"Server"}),y.jsxs(H.Typography,{variant:"small",color:"blue-gray",children:[tn.length," vorhanden"]})]}),tn.length===0?y.jsx("p",{className:"text-sm text-stormGrey-500",children:"Es sind derzeit keine Server hinterlegt."}):y.jsx("div",{className:"flex flex-col gap-3",children:tn.map(xe=>{const Le=so.get(xe.id)||null,ze=!!(Le!=null&&Le.hasKey),We=Le!=null&&Le.updatedAt?new Date(Le.updatedAt).toLocaleString("de-DE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):null;return y.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:[y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("p",{className:"text-sm font-medium text-stormGrey-900",children:xe.name||"Ohne Namen"}),y.jsx("p",{className:"text-xs text-stormGrey-500 break-all",children:xe.url}),y.jsxs("p",{className:"text-xs text-stormGrey-500",children:["API-Key: ",ze?"vorhanden":"nicht hinterlegt",We?` (aktualisiert am ${We})`:""]})]}),y.jsxs("div",{className:"flex w-full flex-col gap-2 md:max-w-xs",children:[y.jsx(H.Input,{type:"password",label:"Neuer API-Key",value:Pt[xe.id]??"",onChange:it=>Mu(xe.id,it.target.value),disabled:!k||dt||hr===xe.id}),y.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[y.jsx(H.Button,{variant:"text",color:"red",size:"sm",onClick:()=>Ru(xe.id),disabled:te||!A||dt||Jr===xe.id||hr===xe.id,children:Jr===xe.id?"Lösche…":"Löschen"}),y.jsx(H.Button,{color:"blue",size:"sm",onClick:()=>Vs(xe.id),disabled:te||!k||dt||hr===xe.id,children:hr===xe.id?"Speichere…":"API-Key speichern"})]})]})]},xe.id)})})]}),y.jsxs("div",{className:"flex flex-col gap-3 border-t border-blue-gray-50 pt-4",children:[y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx(H.Typography,{variant:"small",color:"blue-gray",className:"font-semibold uppercase",children:"Self-Stack-ID"}),y.jsx("p",{className:"text-xs text-stormGrey-500",children:"Optional – lass das Feld leer, wenn keine Self-Stack-ID benötigt wird."})]}),(In==null?void 0:In.envProvided)&&y.jsx("p",{className:"text-xs text-stormGrey-500",children:"Hinweis: Eine Umgebungsvariable liefert bereits einen Standardwert."}),y.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[y.jsx("div",{className:"flex-1",children:y.jsx(H.Input,{label:"Self-Stack-ID",value:Mr,onChange:xe=>Iu(xe.target.value),disabled:!k||dt||wr})}),k&&y.jsxs("div",{className:"flex items-center justify-end gap-2",children:[y.jsx(H.Button,{variant:"text",color:"red",size:"sm",onClick:Du,disabled:te||wr||!Dn&&!Mr,children:"Entfernen"}),y.jsx(H.Button,{color:"blue",size:"sm",onClick:tp,disabled:te||wr||dt||!Bs,children:wr?"Speichere…":"Self-Stack-ID speichern"})]})]}),!k&&y.jsx("p",{className:"text-xs text-stormGrey-500",children:"Bearbeitung benötigt das Gruppenrecht „Server-Sektion“."}),y.jsxs("p",{className:"text-xs text-stormGrey-500",children:["Aktuell gespeichert: ",Dn||"nicht gesetzt"]}),_i&&y.jsxs("p",{className:"text-xs text-stormGrey-500",children:["Vorgabe aus Umgebung: ",_i]}),An&&y.jsx(H.Alert,{color:"red",className:"border border-red-200 bg-red-50 text-red-700",children:An})]}),!Da&&y.jsx(H.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 und API-Key erneut festzulegen."}),y.jsx("div",{className:"flex items-center justify-end",children:y.jsx(H.Button,{variant:"outlined",color:"gray",size:"sm",onClick:()=>Nt(),disabled:te||dt,children:"Aktualisieren"})})]})]})]}),N&&y.jsxs(H.Card,{children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:y.jsx(H.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:y.jsx("span",{children:"Superuser"})})}),y.jsxs(H.CardBody,{className:"flex flex-col gap-4 p-4",children:[y.jsxs("div",{className:"space-y-2",children:[ge&&y.jsx("p",{className:"text-sm text-stormGrey-500",children:"Status wird geladen…"}),!ge&&Oe&&y.jsx("p",{className:"text-sm text-sunsetCoral-600",children:Oe}),!ge&&!Oe&&ve&&y.jsxs("div",{className:"space-y-1",children:[y.jsx("p",{className:"text-sm",children:"Superuser ist angelegt."}),y.jsxs("p",{className:"text-xs text-stormGrey-500",children:["Benutzername: ",y.jsx("span",{className:"font-medium text-stormGrey-900",children:(ie==null?void 0:ie.username)??"unbekannt"}),ie!=null&&ie.email?` - ${ie.email}`:""]})]}),!ge&&!Oe&&!ve&&y.jsx("p",{className:"text-sm",children:"Es ist kein Superuser vorhanden."})]}),y.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[y.jsx(H.Button,{variant:"outlined",color:"gray",onClick:()=>jt(),disabled:te||ge||Ue,className:"w-full sm:w-auto",children:"Status aktualisieren"}),y.jsx(H.Button,{color:"red",onClick:Au,disabled:te||!M||ge||Ue||!ve,className:"w-full sm:w-auto",children:Ue?"Wird gelöscht…":"Superuser löschen"})]}),y.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."})]})]}),D&&y.jsxs(H.Card,{children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:y.jsx(H.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:y.jsx("span",{children:"Portainer"})})}),y.jsxs(H.CardBody,{className:"flex flex-col gap-4 p-4 pt-0",children:[y.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"block antialiased font-sans text-lg font-semibold",children:"Portainer Status"}),y.jsx("p",{className:"block antialiased font-sans text-sm font-light leading-normal text-inherit",children:To?"Status wird geprüft…":io||(X?"Portainer wird aktuell aktualisiert.":(Ct==null?void 0:Ct.updateAvailable)===!0?"Es ist ein Update für Portainer verfügbar.":"Portainer ist auf dem aktuellen Stand.")}),wi&&!To&&y.jsxs("p",{className:"mt-1 text-xs text-stormGrey-500 block antialiased font-sans",children:["Stand: ",wi.toLocaleString("de-DE",{hour:"2-digit",minute:"2-digit",second:"2-digit"})]})]}),y.jsx("div",{className:"flex items-center gap-3",children:y.jsx(H.Button,{onClick:()=>zt({silent:!1}),disabled:te||To||Ma,className:"w-full",children:"Status aktualisieren"})})]}),y.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:!To&&!io&&Ct&&y.jsxs("div",{className:"",children:[y.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[y.jsx("span",{children:"Installierte Version"}),y.jsx("span",{className:"font-medium",children:Ct.currentVersion??"Unbekannt"})]}),y.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[y.jsx("span",{children:"Neueste Version"}),y.jsx("span",{className:"font-medium",children:Ct.latestVersion??"Unbekannt"})]}),y.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[y.jsx("span",{children:"Status"}),y.jsx("span",{className:`rounded-full px-3 py-0.5 text-xs font-semibold ${Ct.updateAvailable===!0?dl.error:Ct.updateAvailable===!1?dl.success:dl.idle}`,children:Ct.updateAvailable===!0?"Update verfügbar":Ct.updateAvailable===!1?"Aktuell":"Unbekannt"})]}),Ct.edition&&y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{className:"text-stormGrey-400",children:"Edition"}),y.jsx("span",{className:"font-medium",children:Ct.edition})]}),Ct.build&&y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{className:"text-stormGrey-400",children:"Build"}),y.jsx("span",{className:"font-medium",children:Ct.build})]}),((Uu=Ct.errors)==null?void 0:Uu.latestVersion)&&y.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: ",Ct.errors.latestVersion]}),(($s=Ct.errors)==null?void 0:$s.container)&&y.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: ",Ct.errors.container]})]})}),y.jsxs("div",{className:"mt-6 grid gap-6 lg:grid-cols-2 xl:grid-cols-3",children:[B&&y.jsxs("div",{className:"rounded-md border border-gray-700/20 p-4",children:[y.jsx("div",{className:"flex items-center justify-between",children:y.jsx("h3",{className:"text-sm font-semibold",children:"SSH-Verbindung"})}),y.jsxs("div",{className:"mt-3 grid gap-3 text-sm",children:[y.jsxs("label",{className:"grid gap-1",children:[y.jsx("span",{className:"text-xs uppercase tracking-wide",children:"Host"}),y.jsx("input",{type:"text",value:ke.host,onChange:xe=>La("host",xe.target.value),disabled:!U||Qe||Xe||Ve||X,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"})]}),y.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[y.jsxs("label",{className:"grid gap-1",children:[y.jsx("span",{className:"text-xs uppercase tracking-wide ",children:"Port"}),y.jsx("input",{type:"number",min:"1",value:ke.port,onChange:xe=>La("port",xe.target.value),disabled:!U||Qe||Xe||Ve||X,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"})]}),y.jsxs("label",{className:"grid gap-1",children:[y.jsx("span",{className:"text-xs uppercase tracking-wide ",children:"Benutzer"}),y.jsx("input",{type:"text",value:ke.username,onChange:xe=>La("username",xe.target.value),disabled:!U||Qe||Xe||Ve||X,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"})]})]}),y.jsxs("div",{className:"grid gap-1",children:[y.jsxs("div",{className:"flex items-center justify-between text-xs uppercase tracking-wide ",children:[y.jsx("label",{htmlFor:"maintenance-ssh-password",className:"cursor-pointer",children:"Passwort"}),y.jsx("button",{type:"button",onClick:()=>Je(xe=>!xe),disabled:!U||Qe||Xe||Ve||X,className:"text-[11px] font-medium text-blue-500 transition hover:text-blue-800 disabled:opacity-50",children:qe?"Verbergen":"Anzeigen"})]}),y.jsx("input",{id:"maintenance-ssh-password",type:qe?"text":"password",value:ke.password,onChange:xe=>La("password",xe.target.value),disabled:!U||Qe||Xe||Ve||X,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}),je&&!ke.password&&y.jsx("span",{className:"text-[11px] ",children:"Ein Passwort ist gespeichert. Neuer Inhalt ersetzt es oder lösche die Konfiguration unten."})]}),y.jsxs("label",{className:"grid gap-1",children:[y.jsx("span",{className:"text-xs uppercase tracking-wide ",children:"Weitere SSH-Argumente"}),y.jsx("textarea",{rows:3,value:ke.extraSshArgs,onChange:xe=>La("extraSshArgs",xe.target.value),disabled:!U||Qe||Xe||Ve||X,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)"})]})]}),y.jsxs("div",{className:"mt-4 grid gap-2",children:[y.jsx(H.Button,{onClick:Po,disabled:!U||Qe||Xe||Ve||te,className:"mt-3 w-full",children:Qe?"Speichern…":"SSH-Konfiguration speichern"}),y.jsx(H.Button,{onClick:Ti,disabled:!U||Qe||Xe||Ve||te,className:"w-full bg-arcticBlue-500 hover:bg-arcticBlue-600",children:Xe?"Test läuft…":"Verbindung testen"}),y.jsx(H.Button,{onClick:ju,disabled:!U||Qe||Xe||Ve||te,className:"w-full hover:bg-sunsetCoral-600 bg-sunsetCoral-500",children:Ve?"Löschen…":"SSH-Einstellungen löschen"})]}),_t&&y.jsx("p",{className:`mt-3 text-xs ${_t.success?"text-mossGreen-600":"text-sunsetCoral-500"}`,children:_t.success?"SSH-Verbindung erfolgreich.":`SSH-Verbindung fehlgeschlagen: ${_t.error}`})]}),B&&y.jsxs("div",{className:"rounded-md border border-gray-700/20 p-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("h3",{className:"text-sm font-semibold",children:"Update-Skript"}),y.jsxs("span",{className:"text-xs",children:["Quelle: ",ae]})]}),y.jsx("textarea",{value:me,onChange:xe=>de(xe.target.value),rows:10,disabled:!U||ee||X,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"}),y.jsxs("div",{className:"mt-3 grid gap-2",children:[y.jsx(H.Button,{onClick:ep,disabled:!U||!Te||ee||te,className:"mt-3 w-full",children:"Speichern"}),y.jsx(H.Button,{color:"purple",onClick:Eu,disabled:!U||!a||a.source!=="custom"||ee||te,className:"w-full hover:bg-sunsetCoral-600 bg-sunsetCoral-500",children:"Standard wiederherstellen"})]}),(a==null?void 0:a.customUpdatedAt)&&y.jsxs("p",{className:"mt-2 text-xs text-stormGrey-500",children:["Zuletzt geändert: ",Ua(a.customUpdatedAt)]})]}),B&&y.jsxs("div",{className:"rounded-md border border-gray-700/20 p-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("h3",{className:"text-sm font-semibold",children:"Update-Status"}),y.jsx("span",{className:`rounded-full px-3 py-0.5 text-xs font-semibold ${np}`,children:Us})]}),y.jsxs("div",{className:"mt-3 grid gap-2 text-xs",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{children:"Phase"}),y.jsx("span",{className:"font-medium",children:Fu})]}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{children:"Ziel-Version"}),y.jsx("span",{className:"font-medium",children:op})]}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{children:"Installierte Version"}),y.jsx("span",{className:"font-medium",children:ap})]}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{children:"Gestartet"}),y.jsx("span",{children:ip})]}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{children:"Beendet"}),y.jsx("span",{children:sp})]}),Bu&&y.jsx("div",{className:"rounded-md border border-mossGreen-700 bg-mossGreen-800 px-3 py-2 text-xs text-white",children:Bu}),(o==null?void 0:o.error)&&y.jsx("div",{className:"rounded-md border border-sunsetCoral-500/60 bg-sunsetCoral-900/40 px-3 py-2 text-xs text-white",children:o.error}),be&&y.jsx("div",{className:"rounded-md border border-sunsetCoral-500/60 bg-sunsetCoral-900/40 px-3 py-2 text-xs text-white",children:be})]}),y.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:zu.length===0?y.jsx("p",{className:"text-stormGrey-500",children:"Noch keine Protokolle vorhanden."}):zu.map((xe,Le)=>y.jsxs("div",{className:"mb-2 last:mb-0",children:[y.jsxs("span",{className:"text-gray-500",children:["[",oV(xe.timestamp),"]"]})," ",y.jsx("span",{className:(nV[xe.level]??"text-stormGrey-300")+" whitespace-normal break-words",style:{overflowWrap:"anywhere",wordBreak:"normal"},children:xe.message})]},`${xe.timestamp}-${Le}`))}),y.jsx(H.Button,{onClick:rp,disabled:te||!L||lo||pe,className:"mt-3 w-full",children:pe?"Update wird gestartet…":"Portainer aktualisieren"})]})]})]})]}),Y&&y.jsxs(H.Card,{children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:y.jsx(H.Typography,{variant:"h6",color:"white",className:"flex items-center justify-between",children:y.jsx("span",{children:"Doppelte Stacks"})})}),y.jsxs(H.CardBody,{className:"flex flex-col gap-4 p-4",children:[y.jsx("div",{className:"rounded-lg border border-warmAmberGlow-600 bg-warmAmberGlow-700 px-4 py-3 text-sm text-white",children:"Das Entfernen von doppelten Stacks ist noch nicht getestet. Bitte nicht in Produktivumgebungen einsetzen."}),y.jsxs("div",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{className:"space-y-1",children:[y.jsx("p",{className:"text-sm antialiased font-sans text-sm font-light leading-normal text-inherit",children:Ln?"Wartungsmodus aktiv – Duplikat-Verwaltung ist vorübergehend deaktiviert.":Mt?"Analyse läuft…":Si.groups===0?"Keine Duplikate gefunden":`${Si.groups} Stack-Namen mit insgesamt ${Si.duplicateCount} Duplikaten gefunden`}),gr&&!Mt&&!Ln&&y.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:["Stand: ",gr.toLocaleString("de-DE",{hour:"2-digit",minute:"2-digit",second:"2-digit"})]})]}),y.jsx(H.Button,{onClick:()=>Or({silent:!1}),disabled:Ln||Mt||or||Rn!==null,className:"",children:"Aktualisieren"}),Et&&!Ln&&y.jsx("div",{className:"rounded-lg border border-sunsetCoral-500/60 bg-sunsetCoral-900/40 px-4 py-3 text-sm text-white",children:Et})]}),Mt?y.jsx("div",{className:"flex flex-col gap-4 p-4",children:"Daten werden geladen…"}):Si.groups===0||Ln?y.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:Ln?"Wartungsmodus aktiv – Duplikat-Verwaltung ist vorübergehend deaktiviert.":"Es wurden keine doppelten Stacks gefunden."}):y.jsx("div",{className:"space-y-5",children:Ae.map(xe=>{var it,Wt,Vt;const Le=(it=xe==null?void 0:xe.canonical)==null?void 0:it.Id,ze=(xe==null?void 0:xe.duplicates)||[],We=Rn===String(Le);return y.jsxs("div",{className:"rounded-xl border border-gray-700 bg-gray-800/70 p-6 shadow",children:[y.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[y.jsxs("div",{className:"space-y-1",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("h3",{className:"text-lg font-semibold text-white",children:xe.name}),y.jsxs("span",{className:"rounded-full bg-amber-500/20 px-3 py-0.5 text-xs font-medium text-amber-200",children:[ze.length," Duplikat",ze.length===1?"":"e"]})]}),y.jsxs("p",{className:"text-sm text-gray-300",children:["Behaltener Stack: ID ",Le]}),y.jsxs("p",{className:"text-xs text-gray-500",children:["Typ: ",Yw((Wt=xe==null?void 0:xe.canonical)==null?void 0:Wt.Type)," • Erstellt: ",Ua((Vt=xe==null?void 0:xe.canonical)==null?void 0:Vt.Created)]})]}),y.jsx("button",{type:"button",onClick:()=>Lu(xe),disabled:!q||Ln||We||or||Mt,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:We?"Bereinigung läuft…":`Bereinigen (${ze.length})`})]}),y.jsx("div",{className:"mt-5 grid gap-3",children:ze.map(rn=>y.jsx("div",{className:"rounded-lg border border-sunsetCoral-500/40 bg-sunsetCoral-900/20 p-4 text-sm text-white",children:y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[y.jsxs("span",{className:"font-semibold text-white",children:["ID: ",rn.Id]}),y.jsxs("span",{children:["Typ: ",Yw(rn.Type)]}),y.jsxs("span",{children:["Erstellt: ",Ua(rn.Created)]})]})},rn.Id))})]},Le||xe.name)})})]})]})]}):null}const iV={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},Ha=xo.forwardRef(({value:e,onClick:t,onKeyDown:r,...n},o)=>{const{setOpen:a}=H.useSelect(),i=P.useCallback(()=>{(typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame:b=>setTimeout(b,0))(()=>{a(!0)})},[a]),c=P.useCallback(g=>{typeof t=="function"&&t(g),i()},[t,i]),f=P.useCallback(g=>{typeof r=="function"&&r(g),(g.key==="Enter"||g.key===" ")&&i()},[r,i]);return y.jsx(H.Option,{...n,value:e,ref:o,onClick:c,onKeyDown:f})});Ha.displayName="StickyOption";const sV={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"},lV=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"})},Qw=e=>{if(e)return e.replace("T"," ")},Xw="eventLogFilters",po="__all__",uV="- Alle -",cV=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()),dV=e=>{if(e==null)return"-";if(typeof e=="object")try{return JSON.stringify(e)}catch{return"[Objekt]"}return String(e)},fV=e=>{if(!e||typeof e!="object")return"";const t=Object.entries(e);return t.length?t.map(([r,n])=>`${r}: ${dV(n)}`).join(" • "):""};function pV(){const[e,t]=P.useState([]),[r,n]=P.useState(!0),[o,a]=P.useState(""),[i,c]=P.useState(!1),[f,g]=P.useState([]),[b,S]=P.useState([]),[O,T]=P.useState([]),[C,x]=P.useState([]),[m,d]=P.useState([]),[s,u]=P.useState([]),[l,h]=P.useState([]),[v,w]=P.useState([]),[j,N]=P.useState([]),[k,A]=P.useState([]),[M,D]=P.useState([]),[L,B]=P.useState([]),[U,Y]=P.useState(""),[q,z]=P.useState(""),[$,K]=P.useState(""),[X,te]=P.useState(""),[me,de]=P.useState(""),[ee,Se]=P.useState(!1),[pe,fe]=P.useState(!1),[be,ye]=P.useState(!1),[Pe,Me]=P.useState(0),{maintenance:ke,update:ce}=Aa(),je=!!(ke!=null&&ke.active),He=ke==null?void 0:ke.message,qe=!!(ce!=null&&ce.running),Je=je||qe,Qe=ce!=null&&ce.stage?iV[ce.stage]??ce.stage:"–",{hasPermission:Ge}=Ur(),Xe=Ge("logs-delete","full"),ht=Ge("logs-export","full"),{page:Ve,perPage:ot,perPageOptions:_t,setPage:Ne,setPerPage:at,setTotals:Te,handlePerPageChange:ae,validPerPageValues:ge,resetPagination:oe}=Nu(),ve=P.useCallback(()=>{},[]);P.useEffect(()=>()=>oe(),[oe]);const se=P.useCallback(J=>{const Ae=Array.isArray(J)?J:(J==null?void 0:J.items)??[],Be=new Set,Mt=new Set,yt=new Set,Et=new Set,It=new Set,or=new Set;Ae.forEach(kt=>{kt.category&&Be.add(kt.category),kt.eventType&&Mt.add(kt.eventType),kt.action&&yt.add(kt.action),kt.status&&Et.add(kt.status),kt.entityType&&It.add(kt.entityType),kt.contextType&&or.add(kt.contextType)}),g(Array.from(Be).sort()),S(Array.from(Mt).sort()),T(Array.from(yt).sort()),x(Array.from(Et).sort()),d(Array.from(It).sort()),u(Array.from(or).sort()),ye(!0)},[]);P.useEffect(()=>{be&&h(J=>{const Ae=J.filter(Be=>f.includes(Be));return Ae.length===J.length?J:Ae})},[be,f]),P.useEffect(()=>{be&&w(J=>{const Ae=J.filter(Be=>b.includes(Be));return Ae.length===J.length?J:Ae})},[be,b]),P.useEffect(()=>{be&&N(J=>{const Ae=J.filter(Be=>O.includes(Be));return Ae.length===J.length?J:Ae})},[be,O]),P.useEffect(()=>{be&&A(J=>{const Ae=J.filter(Be=>C.includes(Be));return Ae.length===J.length?J:Ae})},[be,C]),P.useEffect(()=>{be&&D(J=>{const Ae=J.filter(Be=>m.includes(Be));return Ae.length===J.length?J:Ae})},[be,m]),P.useEffect(()=>{be&&B(J=>{const Ae=J.filter(Be=>s.includes(Be));return Ae.length===J.length?J:Ae})},[be,s]),P.useEffect(()=>{if(typeof window>"u"){fe(!0);return}try{const J=window.localStorage.getItem(Xw);if(J){const Ae=JSON.parse(J),Be=(Ae==null?void 0:Ae.filters)??Ae??{},Mt=(Ae==null?void 0:Ae.pagination)??{};h(Be.categories||[]),w(Be.eventTypes||[]),N(Be.actions||[]),A(Be.statuses||[]),D(Be.entityTypes||[]),B(Be.contextTypes||[]),Y(Be.entityId||""),z(Be.contextId||""),K(Be.search||""),te(Be.from||""),de(Be.to||""),Se(cV(Be));const yt=Mt.perPage;if(yt!==void 0){const It=String(yt);ge.has(It)&&at(It,{resetPage:!1})}const Et=Mt.page;typeof Et=="number"&&Et>0&&Ne(Et)}}catch(J){console.error("❌ Fehler beim Laden der gespeicherten Log-Filter:",J)}finally{fe(!0)}},[Ne,at,ge]);const ie=P.useCallback(()=>{const J={};l.length&&(J.categories=l.join(",")),v.length&&(J.eventTypes=v.join(",")),j.length&&(J.actions=j.join(",")),k.length&&(J.statuses=k.join(",")),M.length&&(J.entityTypes=M.join(",")),L.length&&(J.contextTypes=L.join(",")),U.trim()&&(J.entityId=U.trim()),q.trim()&&(J.contextId=q.trim()),$.trim()&&(J.search=$.trim());const Ae=Qw(X);Ae&&(J.from=Ae);const Be=Qw(me);return Be&&(J.to=Be),J},[l,v,j,k,M,L,U,q,$,X,me]);P.useEffect(()=>{if(!pe)return;let J=!1;return lt.get("/api/logs",{params:{perPage:"all",page:1}}).then(Ae=>{J||se(Ae.data)}).catch(Ae=>{J||console.error("⚠️ Konnte Filteroptionen nicht aktualisieren:",Ae)}),()=>{J=!0}},[pe,se,Pe]);const he=P.useMemo(()=>({categories:l,eventTypes:v,actions:j,statuses:k,entityTypes:M,contextTypes:L,entityId:U,contextId:q,search:$,from:X,to:me}),[l,v,j,k,M,L,U,q,$,X,me]);P.useEffect(()=>{if(!pe)return;const J={...ie()};ot==="all"?(J.perPage="all",J.page=1):(J.perPage=ot,J.page=Ve);let Ae=!1;return n(!0),a(""),lt.get("/api/logs",{params:J}).then(Be=>{if(Ae)return;const Mt=Be.data||{},yt=Array.isArray(Mt)?Mt:Mt.items??[],Et=Array.isArray(Mt)?yt.length:Mt.total??yt.length;if(t(yt),Te(Et,yt.length),ot==="all")Ve!==1&&Ne(1);else{const It=Math.max(1,Math.ceil((Et||0)/Number(ot))),or=Math.min(Math.max(Ve,1),It);or!==Ve&&Ne(or)}}).catch(Be=>{Ae||(console.error("❌ Fehler beim Laden der Logs:",Be),a("Fehler beim Laden der Logs"))}).finally(()=>{Ae||n(!1)}),()=>{Ae=!0}},[pe,ie,se,Pe,ot,Ve,Te]),P.useEffect(()=>{if(pe&&!(typeof window>"u"))try{window.localStorage.setItem(Xw,JSON.stringify({filters:he,pagination:{perPage:ot,page:Ve}}))}catch(J){console.error("⚠️ Konnte Filter nicht speichern:",J)}},[pe,he,ot,Ve]);const Oe=P.useCallback(J=>Ae=>{var yt;if(typeof Ae=="string"){const Et=Ae;if(Et==="")return;J(It=>Et===po?[]:It.includes(Et)?It.filter(or=>or!==Et):[...It,Et]),Ne(1);return}const Be=(yt=Ae==null?void 0:Ae.target)==null?void 0:yt.selectedOptions;if(!Be)return;const Mt=Array.from(Be).map(Et=>Et.value);Mt.includes(po)?J([]):J(Mt),Ne(1)},[Ne]),Ce=P.useMemo(()=>Oe(h),[Oe]),Ue=P.useMemo(()=>Oe(w),[Oe]),Fe=P.useMemo(()=>Oe(N),[Oe]),Ie=P.useMemo(()=>Oe(A),[Oe]),Ee=P.useMemo(()=>Oe(D),[Oe]),dt=P.useMemo(()=>Oe(B),[Oe]),ft=(J,Ae)=>{J(Be=>Be.filter(Mt=>Mt!==Ae)),Ne(1)},Ft=()=>{h([]),w([]),N([]),A([]),D([]),B([]),Y(""),z(""),K(""),te(""),de(""),Se(!1),Ne(1)},Kt=()=>{Se(J=>!J)},Pt=P.useCallback(J=>[{value:po,label:uV},...J.filter(Ae=>Ae!==po).map(Ae=>({value:Ae,label:Ae}))],[]),Rt=P.useMemo(()=>Pt(f),[Pt,f]),hr=P.useMemo(()=>Pt(b),[Pt,b]),ir=P.useMemo(()=>Pt(O),[Pt,O]),Jr=P.useMemo(()=>Pt(C),[Pt,C]),jn=P.useMemo(()=>Pt(m),[Pt,m]),Mr=P.useMemo(()=>Pt(s),[Pt,s]),en=P.useMemo(()=>{let J=0;return l.length&&(J+=l.length),v.length&&(J+=v.length),j.length&&(J+=j.length),k.length&&(J+=k.length),M.length&&(J+=M.length),L.length&&(J+=L.length),U.trim()&&(J+=1),q.trim()&&(J+=1),$.trim()&&(J+=1),X&&(J+=1),me&&(J+=1),J},[l,v,j,k,M,L,U,q,$,X,me]),wr=async J=>{if(!Xe){a("Dir fehlt die Berechtigung, einzelne Logeinträge zu löschen.");return}if(window.confirm("Diesen Log-Eintrag dauerhaft löschen?")){c(!0),a("");try{await lt.delete(`/api/logs/${J}`),Me(Ae=>Ae+1)}catch(Ae){console.error("❌ Fehler beim Löschen des Logs:",Ae),a("Fehler beim Löschen des Logs")}finally{c(!1)}}},no=async()=>{if(!Xe){a("Dir fehlt die Berechtigung, Logs zu löschen.");return}if(e.length&&window.confirm("Alle angezeigten Logs (entsprechend Filter) löschen?")){c(!0),a("");try{const J={...ie(),ids:e.map(Ae=>Ae.id).join(",")};await lt.delete("/api/logs",{params:J}),Me(Ae=>Ae+1)}catch(J){console.error("❌ Fehler beim Löschen der gefilterten Logs:",J),a("Fehler beim Löschen der gefilterten Logs")}finally{c(!1)}}},An=async J=>{if(!ht){a("Dir fehlt die Berechtigung, Logs zu exportieren.");return}c(!0),a("");try{const Ae=await lt.get("/api/logs/export",{params:{...ie(),format:J},responseType:"blob"}),Be=Ae.headers["content-type"]||(J==="sql"?"application/sql":"text/plain"),yt=(Ae.headers["content-disposition"]||"").match(/filename="?([^";]+)"?/i),Et=(yt==null?void 0:yt[1])||`event-logs.${J}`,It=new Blob([Ae.data],{type:Be}),or=window.URL.createObjectURL(It),kt=document.createElement("a");kt.href=or,kt.download=Et,document.body.appendChild(kt),kt.click(),kt.remove(),window.URL.revokeObjectURL(or)}catch(Ae){console.error("❌ Fehler beim Export der Logs:",Ae),a("Fehler beim Export der Logs")}finally{c(!1)}};return xo.useState(!1),y.jsxs("div",{className:"mt-12 mb-8 flex flex-col gap-12",children:[(je||qe)&&y.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("span",{children:["Wartungsmodus aktiv",He?` – ${He}`:qe?" – Portainer-Update läuft":"","."]}),qe&&y.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",Qe]})]})}),y.jsxs(H.Card,{children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:y.jsx(H.Typography,{variant:"h6",color:"white",children:y.jsxs("button",{onClick:Kt,className:"flex w-full items-center justify-between",children:[y.jsxs("span",{className:"flex items-center gap-2",children:[y.jsx("span",{children:"Logs"}),en>0&&y.jsxs("span",{className:"rounded-full bg-blue-gray-500/80 px-2 py-0.5 text-xs text-white",children:[en," aktiv"]})]}),y.jsx("span",{className:"text-xs uppercase tracking-wide text-gray-400",children:ee?"Filter ausblenden":"Filter anzeigen"})]})})}),y.jsxs(H.CardBody,{className:"pt-0",children:[ee&&y.jsxs("div",{className:"mb-8",children:[(ht||Xe)&&y.jsxs("div",{className:"flex flex-wrap gap-2",children:[ht&&y.jsxs(y.Fragment,{children:[y.jsx(H.Button,{onClick:()=>An("txt"),disabled:Je||i||r,className:"w-full md:flex-1",children:"Export TXT"}),y.jsx(H.Button,{onClick:()=>An("sql"),disabled:Je||i||r,className:"w-full md:flex-1",children:"Export SQL"})]}),Xe&&y.jsx(H.Button,{onClick:no,disabled:Je||i||r||e.length===0,className:"w-full md:flex-1 bg-sunsetCoral-500 hover:bg-sunsetCoral-600",children:"Angezeigte löschen"})]}),y.jsxs("div",{className:"grid gap-6 mt-10",children:[y.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[y.jsxs("div",{className:"grid gap-3",children:[y.jsx(H.Select,{multiple:!0,onChange:ve,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Kategorien",children:Rt.map(({value:J,label:Ae})=>y.jsx(Ha,{value:J,onClick:()=>Ce(J),onKeyDown:Be=>{(Be.key==="Enter"||Be.key===" ")&&(Be.preventDefault(),Ce(J))},className:`text-black-600 ${J===po?"font-semibold text-black-800":""}`,children:Ae},J))}),y.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:l.length===0?y.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Kategorien"}):y.jsx("span",{children:l.map(J=>y.jsx("button",{type:"button",onClick:()=>ft(h,J),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:J},J))})})]}),y.jsxs("div",{className:"grid gap-3",children:[y.jsx(H.Select,{multiple:!0,onChange:ve,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Event-Typen",children:hr.map(({value:J,label:Ae})=>y.jsx(Ha,{value:J,onClick:()=>Ue(J),onKeyDown:Be=>{(Be.key==="Enter"||Be.key===" ")&&(Be.preventDefault(),Ue(J))},className:`text-black-600 ${J===po?"font-semibold text-black-800":""}`,children:Ae},J))}),y.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:v.length===0?y.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Event-Typen"}):y.jsx("span",{children:v.map(J=>y.jsx("button",{type:"button",onClick:()=>ft(w,J),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:J},J))})})]})]}),y.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[y.jsxs("div",{className:"grid gap-3",children:[y.jsx(H.Select,{multiple:!0,onChange:ve,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Aktionen",children:ir.map(({value:J,label:Ae})=>y.jsx(Ha,{value:J,onClick:()=>Fe(J),onKeyDown:Be=>{(Be.key==="Enter"||Be.key===" ")&&(Be.preventDefault(),Fe(J))},className:`text-black-600 ${J===po?"font-semibold text-black-800":""}`,children:Ae},J))}),y.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:j.length===0?y.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Aktionen"}):y.jsx("span",{children:j.map(J=>y.jsx("button",{type:"button",onClick:()=>ft(N,J),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:J},J))})})]}),y.jsxs("div",{className:"grid gap-3",children:[y.jsx(H.Select,{multiple:!0,onChange:ve,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Status",children:Jr.map(({value:J,label:Ae})=>y.jsx(Ha,{value:J,onClick:()=>Ie(J),onKeyDown:Be=>{(Be.key==="Enter"||Be.key===" ")&&(Be.preventDefault(),Ie(J))},className:`text-black-600 ${J===po?"font-semibold text-black-800":""}`,children:Ae},J))}),y.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:k.length===0?y.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Status"}):y.jsx("span",{children:k.map(J=>y.jsx("button",{type:"button",onClick:()=>ft(A,J),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:J},J))})})]})]}),y.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[y.jsxs("div",{className:"grid gap-3",children:[y.jsx(H.Select,{multiple:!0,onChange:ve,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Entitäts-Typen",children:jn.map(({value:J,label:Ae})=>y.jsx(Ha,{value:J,onClick:()=>Ee(J),onKeyDown:Be=>{(Be.key==="Enter"||Be.key===" ")&&(Be.preventDefault(),Ee(J))},className:`text-black-600 ${J===po?"font-semibold text-black-800":""}`,children:Ae},J))}),y.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:M.length===0?y.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Entitäten"}):y.jsx("span",{children:M.map(J=>y.jsx("button",{type:"button",onClick:()=>ft(D,J),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:J},J))})})]}),y.jsxs("div",{className:"grid gap-3",children:[y.jsx(H.Select,{multiple:!0,onChange:ve,className:"text-stormGrey-500",variant:"static",dismiss:{itemPress:!1},label:"Kontext",children:Mr.map(({value:J,label:Ae})=>y.jsx(Ha,{value:J,onClick:()=>dt(J),onKeyDown:Be=>{(Be.key==="Enter"||Be.key===" ")&&(Be.preventDefault(),dt(J))},className:`text-black-600 ${J===po?"font-semibold text-black-800":""}`,children:Ae},J))}),y.jsx("div",{className:"mt-2 mb-2 min-h-[1.5rem] text-xs text-stormGrey-400",children:L.length===0?y.jsx("span",{className:"rounded-full bg-stormGrey-700/60 px-2 py-0.5 text-white",children:"Alle Kontexte"}):y.jsx("span",{children:L.map(J=>y.jsx("button",{type:"button",onClick:()=>ft(B,J),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:J},J))})})]})]}),y.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[y.jsx("div",{className:"md:flex-1",children:y.jsx(H.Input,{value:U,onChange:J=>{Y(J.target.value),Ne(1)},variant:"static",label:"Entitäts-ID",placeholder:"z. B. Stack-ID"})}),y.jsx("div",{className:"md:flex-1",children:y.jsx(H.Input,{value:q,onChange:J=>{z(J.target.value),Ne(1)},variant:"static",label:"Kontext-ID",placeholder:"z. B. Server-ID"})})]}),y.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[y.jsx("div",{className:"md:flex-1",children:y.jsx(H.Input,{value:$,onChange:J=>{K(J.target.value),Ne(1)},variant:"static",label:"Suche (Nachricht & Details)",placeholder:"Freitext"})}),y.jsx("div",{className:"md:mt-0 mt-8 md:flex-1",children:y.jsx(H.Select,{variant:"static",label:"Einträge pro Seite",onChange:ve,value:ot,children:_t.map(({value:J,label:Ae})=>y.jsx(H.Option,{value:J,onClick:()=>ae(J),children:Ae},J))})})]}),y.jsxs("div",{className:"flex flex-col md:flex-row flex-wrap gap-4",children:[y.jsx("div",{className:"flex-1 min-w-[200px]",children:y.jsx(H.Input,{type:"datetime-local",variant:"static",label:"Von",value:X,onChange:J=>{te(J.target.value),Ne(1)},className:"w-full"})}),y.jsx("div",{className:"flex-1 min-w-[200px]",children:y.jsx(H.Input,{type:"datetime-local",variant:"static",label:"Bis",value:me,onChange:J=>{de(J.target.value),Ne(1)},className:"w-full"})}),y.jsx("div",{className:"flex-1 min-w-[180px]",children:y.jsx(H.Button,{onClick:Ft,disabled:Je||i||r,className:"w-full",children:"Zurücksetzen"})})]})]})]}),y.jsx("div",{className:"overflow-x-auto rounded-lg border border-blue-gray-50",children:y.jsxs("table",{className:"w-full min-w-[860px] table-auto text-left",children:[y.jsx("thead",{children:y.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(J=>y.jsx("th",{className:"px-6 py-4 font-semibold",children:J},J))})}),y.jsx("tbody",{children:r?y.jsx("tr",{children:y.jsx("td",{colSpan:8,className:"px-6 py-8 text-center text-stormGrey-400",children:"Logs werden geladen ..."})}):e.length===0?y.jsx("tr",{children:y.jsx("td",{colSpan:8,className:"px-6 py-8 text-center text-stormGrey-400",children:"Keine Logs gefunden."})}):e.map((J,Ae)=>{const Be=sV[J.status]||"text-blue-300",Mt=Ae===e.length-1?"":"border-b border-blue-gray-50",yt=J.category||"-",Et=J.entityName||J.entityId||"-",It=[];J.entityName&&J.entityId?It.push(`ID: ${J.entityId}`):!J.entityName&&J.entityId&&It.push(`ID: ${J.entityId}`),J.entityType&&It.push(J.entityType);const or=J.contextLabel||J.contextType||(J.contextId?`#${J.contextId}`:"-"),kt=[];J.contextType&&kt.push(J.contextType),J.contextId&&kt.push(`#${J.contextId}`);const Rn=fV(J.metadata),Ir=[];if(J.actorName||J.actorId){const gr=J.actorName?J.actorName:`#${J.actorId}`,Mn=J.actorName&&J.actorId?` (#${J.actorId})`:"";Ir.push(`Akteur: ${gr}${Mn}`)}return J.source&&Ir.push(`Quelle: ${J.source}`),Rn&&Ir.push(Rn),Ir.length||Ir.push("-"),y.jsxs("tr",{className:`text-sm text-stormGrey-700 ${Mt}`,children:[y.jsx("td",{className:"px-6 py-4 align-top",children:y.jsx(H.Typography,{variant:"small",className:"block text-xs font-medium text-stormGrey-600",children:lV(J.timestamp)})}),y.jsx("td",{className:"px-6 py-4 align-top",children:y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx("span",{className:"font-medium",children:yt}),y.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-stormGrey-400",children:[J.eventType&&y.jsx("span",{className:"rounded-full bg-citrusPunch-600/80 px-2 py-0.5 text-white",children:J.eventType}),J.action&&y.jsx("span",{className:"rounded-full bg-emeraldMist-500/80 px-2 py-0.5 text-white",children:J.action})]})]})}),y.jsxs("td",{className:"px-6 py-4 align-top",children:[y.jsx(H.Typography,{variant:"small",className:`font-semibold ${Be}`,children:J.status||"-"}),J.severity&&y.jsx(H.Typography,{variant:"small",className:"text-xs text-stormGrey-400",children:J.severity})]}),y.jsx("td",{className:"px-6 py-4 align-top",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("span",{className:"font-medium break-words",children:Et}),It.length>0&&y.jsx("div",{className:"flex flex-col text-xs text-stormGrey-400",children:It.map(gr=>y.jsx("span",{className:"break-words",children:gr},gr))})]})}),y.jsx("td",{className:"px-6 py-4 align-top",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("span",{className:"font-medium break-words",children:or}),kt.length>0&&y.jsx("div",{className:"flex flex-col text-xs text-stormGrey-400",children:kt.map(gr=>y.jsx("span",{className:"break-words",children:gr},gr))})]})}),y.jsx("td",{className:"px-6 py-4 align-top",children:y.jsx(H.Typography,{variant:"small",className:"break-words",children:J.message||"-"})}),y.jsx("td",{className:"px-6 py-4 align-top",children:y.jsx("div",{className:"flex flex-col gap-1 text-xs text-stormGrey-500",children:Ir.map((gr,Mn)=>y.jsx("span",{className:"break-words",children:gr},Mn))})}),y.jsx("td",{className:"px-6 py-4 align-top",children:Xe&&y.jsx(H.Typography,{variant:"small",children:y.jsx("button",{onClick:()=>wr(J.id),disabled:Je||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"})})})]},J.id)})})]})}),y.jsxs("div",{className:"mt-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[y.jsx(H.Typography,{variant:"small",color:"gray",children:""}),y.jsx(Jf,{disabled:r&&e.length===0})]})]})]})]})}const hV={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},gV=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 mV(){const[e,t]=P.useState([]),[r,n]=P.useState(!1),[o,a]=P.useState(""),[i,c]=P.useState(""),[f,g]=P.useState([]),[b,S]=P.useState(!1),[O,T]=P.useState(""),[C,x]=P.useState(""),[m,d]=P.useState(""),[s,u]=P.useState(""),[l,h]=P.useState(""),[v,w]=P.useState(""),[j,N]=P.useState(!1),[k,A]=P.useState(null),[M,D]=P.useState(null),{showToast:L}=zs(),{maintenance:B,update:U}=Aa(),Y=!!(B!=null&&B.active),q=B==null?void 0:B.message,z=!!(U!=null&&U.running),$=U!=null&&U.stage?hV[U.stage]??U.stage:"–",K=Y||z,X=So(),te=P.useCallback(()=>{},[]),{hasPermission:me}=Ur(),de=me("users-edit","full"),ee=me("users-delete","full"),{page:Se,perPage:pe,perPageOptions:fe,perPageIsAll:be,handlePerPageChange:ye,setPage:Pe,setTotals:Me,resetPagination:ke}=Nu();P.useEffect(()=>()=>ke(),[ke]);const ce=P.useCallback(async()=>{var oe,ve,se;n(!0),a("");try{const ie=await lt.get("/api/users"),Oe=(Array.isArray((oe=ie.data)==null?void 0:oe.items)?ie.data.items:[]).map(Ce=>({id:Ce.id,username:Ce.username||"",email:Ce.email||"",isActive:!!Ce.isActive,avatarColor:typeof Ce.avatarColor=="string"?Ce.avatarColor.trim():null,lastLogin:Ce.lastLogin||null,createdAt:Ce.createdAt||null,updatedAt:Ce.updatedAt||null,groups:gV(Ce.groups)})).sort((Ce,Ue)=>Ce.username.localeCompare(Ue.username,"de-DE"));t(Oe)}catch(ie){const he=((se=(ve=ie.response)==null?void 0:ve.data)==null?void 0:se.error)||ie.message||"Unbekannter Fehler";a(he),L({variant:"error",title:"Benutzer konnten nicht geladen werden",description:he})}finally{n(!1)}},[L]),je=P.useCallback(async()=>{var oe,ve,se;S(!0),T("");try{const ie=await lt.get("/api/groups"),Oe=(Array.isArray((oe=ie.data)==null?void 0:oe.items)?ie.data.items:[]).map(Ce=>({id:Number(Ce.id),name:Ce.name||""})).filter(Ce=>Number.isFinite(Ce.id)&&Ce.id>0&&Ce.name).filter(Ce=>Ce.name.toLowerCase()!=="superuser").sort((Ce,Ue)=>Ce.name.localeCompare(Ue.name,"de-DE"));g(Oe)}catch(ie){const he=((se=(ve=ie.response)==null?void 0:ve.data)==null?void 0:se.error)||ie.message||"Benutzergruppen konnten nicht geladen werden.";T(he),L({variant:"error",title:"Benutzergruppen",description:he})}finally{S(!1)}},[L]);P.useEffect(()=>{ce()},[ce]),P.useEffect(()=>{je()},[je]),P.useCallback(()=>{ce(),je()},[ce,je]);const He=P.useCallback(oe=>{c(oe.target.value)},[]);P.useCallback(()=>{c("")},[]),P.useEffect(()=>{Se!==1&&Pe(1)},[i,Se,Pe]);const qe=P.useMemo(()=>{const oe=i.trim().toLowerCase();return oe?e.filter(ve=>[ve.username,ve.email,...ve.groups.map(ie=>ie.name)].map(ie=>String(ie||"").toLowerCase()).some(ie=>ie.includes(oe))):e},[e,i]),Je=P.useMemo(()=>{if(be)return null;const oe=Number(pe);return Number.isFinite(oe)&&oe>0?oe:null},[pe,be]),Qe=P.useMemo(()=>{if(be||!Je)return qe;const oe=(Se-1)*Je;return qe.slice(oe,oe+Je)},[qe,Se,be,Je]),Ge=qe.length,Xe=Qe.length;P.useEffect(()=>{if(be){Me(Ge,Ge),Se!==1&&Pe(1);return}const oe=Number(pe);if(!Number.isFinite(oe)||oe<=0){Me(Ge,Ge);return}const ve=Math.max(1,Math.ceil(Ge/oe));if(Se>ve){Pe(ve);return}Me(Ge,Xe)},[Ge,Xe,Se,pe,be,Pe,Me]);const ht=P.useCallback(oe=>{if(!oe)return"–";const ve=typeof oe=="string"?oe.replace(" ","T"):oe,se=new Date(ve);return Number.isNaN(se.getTime())?oe:new Intl.DateTimeFormat("de-DE",{dateStyle:"short",timeStyle:"short"}).format(se)},[]),Ve=P.useCallback(()=>{x(""),d(""),u(""),h(""),w("")},[]),ot=P.useCallback(async oe=>{var he,Oe;if(K||!(oe!=null&&oe.id)||!ee)return;if(Array.isArray(oe==null?void 0:oe.groups)?oe.groups.some(Ce=>((Ce==null?void 0:Ce.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 "${oe.username}" wirklich löschen?`))return;const ie=Number(oe.id);if(!Number.isFinite(ie)||ie<=0){L({variant:"error",title:"Löschen fehlgeschlagen",description:"Ungültige Benutzer-ID."});return}A(ie);try{await lt.delete(`/api/users/${ie}`),L({variant:"success",title:"Benutzer gelöscht",description:`Der Benutzer "${oe.username}" wurde entfernt.`}),ce()}catch(Ce){const Ue=(Oe=(he=Ce.response)==null?void 0:he.data)==null?void 0:Oe.error;let Fe="Der Benutzer konnte nicht gelöscht werden.";Ue==="INVALID_USER_ID"?Fe="Die Benutzer-ID ist ungültig.":Ue==="USER_NOT_FOUND"?Fe="Der Benutzer wurde bereits entfernt.":Ue==="USER_SUPERUSER_PROTECTED"&&(Fe="Der Superuser kann nicht gelöscht werden."),L({variant:"error",title:"Löschen fehlgeschlagen",description:Fe})}finally{A(null)}},[K,ee,L,ce]),_t=P.useCallback(async oe=>{var he,Oe;if(!(oe!=null&&oe.id)||!de)return;if(K){L({variant:"error",title:"Aktion nicht möglich",description:"Im Wartungsmodus oder während eines Updates sind Statusänderungen gesperrt."});return}if((Array.isArray(oe==null?void 0:oe.groups)?oe.groups.some(Ce=>((Ce==null?void 0:Ce.name)||"").toLowerCase()==="superuser"):!1)&&oe.isActive){L({variant:"error",title:"Änderung nicht möglich",description:"Der Superuser kann nicht deaktiviert werden."});return}const se=Number(oe.id);if(!Number.isFinite(se)||se<=0){L({variant:"error",title:"Statusänderung fehlgeschlagen",description:"Ungültige Benutzer-ID."});return}const ie=!oe.isActive;D(se);try{await lt.put(`/api/users/${se}/active`,{isActive:ie}),ce(),L({variant:"success",title:"Status aktualisiert",description:`Der Benutzer wurde ${ie?"aktiviert":"deaktiviert"}.`})}catch(Ce){const Ue=(Oe=(he=Ce.response)==null?void 0:he.data)==null?void 0:Oe.error;let Fe="Der Benutzerstatus konnte nicht geändert werden.";Ue==="INVALID_USER_ID"?Fe="Die Benutzer-ID ist ungültig.":Ue==="USER_NOT_FOUND"?Fe="Der Benutzer wurde nicht gefunden.":Ue==="USER_SUPERUSER_PROTECTED"&&(Fe="Der Superuser kann nicht deaktiviert werden."),L({variant:"error",title:"Statusänderung fehlgeschlagen",description:Fe})}finally{D(null)}},[K,de,L,ce]),Ne=P.useCallback(async()=>{var se,ie,he,Oe;if(K){w("Im Wartungsmodus oder während eines Updates können keine Benutzer angelegt werden.");return}if(!de){w("Du verfügst nicht über die Berechtigung zum Anlegen von Benutzern.");return}const oe=C.trim();if(!oe){w("Benutzername ist erforderlich.");return}const ve=typeof s=="string"?s.trim():"";if(ve.length<8){w("Passwort muss mindestens 8 Zeichen enthalten.");return}if(!l){w("Bitte eine globale Rolle auswählen.");return}N(!0),w("");try{const Ce={username:oe,password:ve,groupId:Number(l)},Ue=m.trim();Ue&&(Ce.email=Ue);const Fe=await lt.post("/api/users",Ce);Ve(),ce(),L({variant:"success",title:"Benutzer angelegt",description:`Der Benutzer "${((ie=(se=Fe.data)==null?void 0:se.item)==null?void 0:ie.username)??oe}" wurde erstellt.`})}catch(Ce){const Ue=(Oe=(he=Ce.response)==null?void 0:he.data)==null?void 0:Oe.error;let Fe="Benutzer konnte nicht angelegt werden.";switch(Ue){case"USERNAME_REQUIRED":Fe="Benutzername ist erforderlich.";break;case"INVALID_EMAIL":Fe="Bitte eine gültige E-Mail-Adresse angeben.";break;case"INVALID_PASSWORD":case"PASSWORD_TOO_SHORT":Fe="Passwort muss mindestens 8 Zeichen enthalten.";break;case"INVALID_GROUP_ID":case"GROUP_NOT_FOUND":Fe="Bitte eine gültige globale Rolle auswählen.";break;case"USERNAME_TAKEN":Fe="Benutzername wird bereits verwendet.";break;case"EMAIL_TAKEN":Fe="E-Mail-Adresse wird bereits verwendet.";break}w(Fe),L({variant:"error",title:"Erstellen fehlgeschlagen",description:Fe})}finally{N(!1)}},[K,de,C,m,s,l,L,Ve,ce]),at=f.length>0,Te=K||j||b||!at,ae=K||j||b||!at,ge=P.useCallback(oe=>{if(oe&&oe.props&&oe.props.children)return oe.props.children;if(!l)return"Bitte auswählen";const ve=f.find(se=>String(se.id)===l);return ve?ve.name:"Bitte auswählen"},[f,l]);return y.jsxs("div",{className:"mt-12 mb-8 flex flex-col gap-12",children:[(Y||z)&&y.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("span",{children:["Wartungsmodus aktiv",q?` – ${q}`:z?" – Portainer-Update läuft":"","."]}),z&&y.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",$]})]})}),y.jsxs(H.Card,{children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:y.jsx(H.Typography,{variant:"h6",color:"white",children:y.jsx("span",{children:"Benutzerverwaltung"})})}),y.jsxs(H.CardBody,{className:"pt-0",children:[de&&y.jsxs("div",{className:"mb-8 rounded-lg border border-blue-gray-100 bg-white p-4 shadow-sm",children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",className:"mb-2",children:"Neuen Benutzer anlegen"}),at?y.jsxs(y.Fragment,{children:[y.jsx(H.Typography,{variant:"small",className:"text-sm text-stormGrey-500 mb-4",children:"Benutzername, Passwort (mindestens 8 Zeichen) und eine globale Rolle sind Pflichtfelder."}),v&&y.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&&y.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}),y.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[y.jsx(H.Input,{label:"Benutzername",value:C,onChange:oe=>x(oe.target.value),disabled:K||j,crossOrigin:""}),y.jsx(H.Input,{label:"E-Mail (optional)",value:m,onChange:oe=>d(oe.target.value),disabled:K||j,crossOrigin:""}),y.jsx(H.Input,{type:"password",label:"Passwort",value:s,onChange:oe=>u(oe.target.value),disabled:K||j,crossOrigin:""}),y.jsxs(H.Select,{label:"Globale Rolle",variant:"outlined",value:l,onChange:h,disabled:ae,selected:ge,children:[y.jsx(H.Option,{value:"",children:"Bitte auswählen"}),f.map(oe=>y.jsx(H.Option,{value:String(oe.id),children:oe.name},oe.id))]})]}),y.jsx("div",{className:"mt-4 text-sm text-stormGrey-500",children:b?"Benutzergruppen werden geladen ...":""}),y.jsxs("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[y.jsx(H.Button,{color:"green",onClick:Ne,disabled:Te,children:j?"Speichert ...":"Benutzer anlegen"}),y.jsx(H.Button,{variant:"text",color:"blue-gray",onClick:Ve,disabled:j||K,children:"Formular zurücksetzen"})]})]}):y.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."})]}),y.jsx("div",{className:"mb-8",children:y.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between mt-8",children:[y.jsx("div",{className:"md:flex-1",children:y.jsx(H.Input,{label:"Suchen nach Name, E-Mail oder Gruppe",value:i,onChange:He,disabled:r&&!e.length,crossOrigin:""})}),y.jsx("div",{className:"md:mt-0 mt-8 md:flex-1",children:y.jsx(H.Select,{variant:"static",label:"Einträge pro Seite",onChange:te,value:pe,children:fe.map(({value:oe,label:ve})=>y.jsx(H.Option,{value:oe,children:ve},oe))})})]})}),o&&y.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}),y.jsx("div",{className:"overflow-x-auto rounded-lg border border-blue-gray-50",children:y.jsxs("table",{className:"w-full min-w-[720px] table-auto text-left",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"bg-blue-gray-50/50 text-xs uppercase tracking-wide text-stormGrey-400",children:[y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Benutzername"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"E-Mail"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Gruppen"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Status"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Letzte Anmeldung"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Erstellt am"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Aktionen"})]})}),y.jsx("tbody",{children:r&&e.length===0?y.jsx("tr",{children:y.jsx("td",{colSpan:7,className:"px-6 py-8 text-center text-blue-gray-400",children:"Benutzerdaten werden geladen ..."})}):Qe.length===0?y.jsx("tr",{children:y.jsx("td",{colSpan:7,className:"px-6 py-8 text-center text-blue-gray-400",children:"Keine Benutzer gefunden."})}):Qe.map((oe,ve)=>{const se=ve===Qe.length-1?"":"border-b border-blue-gray-50",ie=Array.isArray(oe==null?void 0:oe.groups)?oe.groups.some(he=>((he==null?void 0:he.name)||"").toLowerCase()==="superuser"):!1;return y.jsxs("tr",{className:`text-sm text-stormGrey-700 ${se}`,children:[y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",className:"font-medium text-stormGrey-900",children:oe.username||"–"})}),y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",children:oe.email||"–"})}),y.jsx("td",{className:"px-6 py-4",children:oe.groups.length>0?y.jsx("div",{className:"flex flex-wrap gap-2",children:oe.groups.map(he=>y.jsx(H.Chip,{value:he.name,size:"sm",color:"blue-gray",variant:"ghost"},he.id??he.name))}):y.jsx("span",{className:"text-stormGrey-400",children:"–"})}),y.jsx("td",{className:"px-6 py-4",children:de?y.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 ${K?"cursor-not-allowed":"cursor-pointer"}`,onClick:()=>_t(oe),disabled:K||M===oe.id||Array.isArray(oe.groups)&&oe.groups.some(he=>((he==null?void 0:he.name)||"").toLowerCase()==="superuser"&&oe.isActive),children:y.jsx(H.Chip,{value:M===oe.id?"Wechselt ...":oe.isActive?"Aktiv":"Deaktiviert",size:"sm",color:oe.isActive?"green":"red",variant:"ghost",className:"pointer-events-none"})}):y.jsx(H.Chip,{value:oe.isActive?"Aktiv":"Deaktiviert",size:"sm",color:oe.isActive?"green":"red",variant:"ghost"})}),y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:ht(oe.lastLogin)})}),y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:ht(oe.createdAt)})}),y.jsx("td",{className:"px-6 py-4",children:y.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-2",children:[y.jsx(H.Button,{size:"sm",variant:"outlined",color:"blue-gray",onClick:()=>X(`/dashboard/users/${oe.id}`),children:"Details"}),ee&&!ie&&y.jsx(H.Button,{size:"sm",variant:"text",color:"red",onClick:()=>ot(oe),disabled:K||k===oe.id,children:k===oe.id?"Löscht ...":"Löschen"})]})})]},oe.id)})})]})}),y.jsxs("div",{className:"mt-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[y.jsx(H.Typography,{variant:"small",color:"gray",children:""}),y.jsx(Jf,{disabled:r&&e.length===0})]})]})]})]})}const bV={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"};function vV(){const[e,t]=P.useState([]),[r,n]=P.useState(!1),[o,a]=P.useState(""),[i,c]=P.useState(""),[f,g]=P.useState(""),[b,S]=P.useState(""),[O,T]=P.useState(""),[C,x]=P.useState(!1),[m,d]=P.useState(null),{showToast:s}=zs(),{maintenance:u,update:l}=Aa(),h=!!(u!=null&&u.active),v=u==null?void 0:u.message,w=!!(l!=null&&l.running),j=l!=null&&l.stage?bV[l.stage]??l.stage:"–",N=h||w,k=So(),{hasPermission:A}=Ur(),M=A("user-groups-edit","full"),D=A("user-groups-delete","full"),{page:L,perPage:B,perPageOptions:U,perPageIsAll:Y,handlePerPageChange:q,setPage:z,setTotals:$,resetPagination:K}=Nu();P.useEffect(()=>()=>K(),[K]);const X=P.useCallback(()=>{},[]),te=P.useCallback(async()=>{var ce,je,He;n(!0),a("");try{const qe=await lt.get("/api/groups"),Qe=(Array.isArray((ce=qe.data)==null?void 0:ce.items)?qe.data.items:[]).map(Ge=>({id:Ge.id,name:Ge.name||"",description:Ge.description||"",avatarColor:Ge.avatarColor||null,memberCount:Number(Ge.memberCount)||0,members:Array.isArray(Ge.members)?Ge.members.map(Xe=>({id:Xe.id,username:Xe.username||""})).filter(Xe=>Xe.username):[],createdAt:Ge.createdAt||null,updatedAt:Ge.updatedAt||null})).sort((Ge,Xe)=>Ge.name.localeCompare(Xe.name,"de-DE"));t(Qe)}catch(qe){const Je=((He=(je=qe.response)==null?void 0:je.data)==null?void 0:He.error)||qe.message||"Unbekannter Fehler";a(Je),s({variant:"error",title:"Benutzergruppen konnten nicht geladen werden",description:Je})}finally{n(!1)}},[s]);P.useEffect(()=>{te()},[te]),P.useCallback(()=>{te()},[te]);const me=P.useCallback(ce=>{c(ce.target.value)},[]);P.useCallback(()=>{c("")},[]),P.useEffect(()=>{L!==1&&z(1)},[i,L,z]);const de=P.useMemo(()=>{const ce=i.trim().toLowerCase();return ce?e.filter(je=>[je.name,je.description,...je.members.map(qe=>qe.username)].map(qe=>String(qe||"").toLowerCase()).some(qe=>qe.includes(ce))):e},[e,i]),ee=P.useMemo(()=>{if(Y)return null;const ce=Number(B);return Number.isFinite(ce)&&ce>0?ce:null},[B,Y]),Se=P.useMemo(()=>{if(Y||!ee)return de;const ce=(L-1)*ee;return de.slice(ce,ce+ee)},[de,L,Y,ee]),pe=de.length,fe=Se.length;P.useEffect(()=>{if(Y){$(pe,pe),L!==1&&z(1);return}const ce=Number(B);if(!Number.isFinite(ce)||ce<=0){$(pe,pe);return}const je=Math.max(1,Math.ceil(pe/ce));if(L>je){z(je);return}$(pe,fe)},[pe,fe,L,B,Y,z,$]);const be=P.useCallback(ce=>{if(!ce)return"–";const je=typeof ce=="string"?ce.replace(" ","T"):ce,He=new Date(je);return Number.isNaN(He.getTime())?ce:new Intl.DateTimeFormat("de-DE",{dateStyle:"short",timeStyle:"short"}).format(He)},[]),ye=P.useCallback(()=>{g(""),S(""),T("")},[]),Pe=P.useCallback(async()=>{var je,He,qe,Je;if(N){T("Im Wartungsmodus oder während eines Updates können keine Gruppen angelegt werden.");return}if(!M){T("Du verfügst nicht über die Berechtigung zum Anlegen von Gruppen.");return}const ce=f.trim();if(!ce){T("Gruppenname ist erforderlich.");return}x(!0),T("");try{const Qe={name:ce},Ge=b.trim();Ge&&(Qe.description=Ge);const Xe=await lt.post("/api/groups",Qe);s({variant:"success",title:"Gruppe angelegt",description:`Die Benutzergruppe "${((He=(je=Xe.data)==null?void 0:je.item)==null?void 0:He.name)??ce}" wurde erstellt.`}),ye(),te()}catch(Qe){const Ge=(Je=(qe=Qe.response)==null?void 0:qe.data)==null?void 0:Je.error;let Xe="Benutzergruppe konnte nicht angelegt werden.";Ge==="GROUP_NAME_REQUIRED"?Xe="Gruppenname ist erforderlich.":Ge==="GROUP_NAME_TAKEN"&&(Xe="Der Gruppenname wird bereits verwendet."),T(Xe),s({variant:"error",title:"Erstellen fehlgeschlagen",description:Xe})}finally{x(!1)}},[N,M,f,b,s,ye,te]),Me=N||C,ke=P.useCallback(async ce=>{var Qe,Ge;if(N||!(ce!=null&&ce.id)||!D)return;if(((ce==null?void 0:ce.name)||"").toLowerCase()==="superuser"){s({variant:"error",title:"Löschen nicht möglich",description:"Die Superuser-Gruppe kann nicht gelöscht werden."});return}if((Number(ce.memberCount)||0)>0){s({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 "${ce.name}" wirklich löschen?`))return;const Je=Number(ce.id);if(!Number.isFinite(Je)||Je<=0){s({variant:"error",title:"Löschen fehlgeschlagen",description:"Ungültige Gruppen-ID."});return}d(Je);try{await lt.delete(`/api/groups/${Je}`),s({variant:"success",title:"Gruppe gelöscht",description:`Die Benutzergruppe "${ce.name}" wurde entfernt.`}),te()}catch(Xe){const ht=(Ge=(Qe=Xe.response)==null?void 0:Qe.data)==null?void 0:Ge.error;let Ve="Die Benutzergruppe konnte nicht gelöscht werden.";ht==="INVALID_GROUP_ID"?Ve="Die Gruppen-ID ist ungültig.":ht==="GROUP_NOT_FOUND"?Ve="Die Benutzergruppe wurde bereits entfernt.":ht==="GROUP_HAS_MEMBERS"?Ve="Die Gruppe enthält noch Benutzer. Bitte entfernen Sie diese zuerst.":ht==="GROUP_SUPERUSER_PROTECTED"&&(Ve="Die Superuser-Gruppe kann nicht gelöscht werden."),s({variant:"error",title:"Löschen fehlgeschlagen",description:Ve})}finally{d(null)}},[N,D,s,te]);return y.jsxs("div",{className:"mt-12 mb-8 flex flex-col gap-12",children:[(h||w)&&y.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("span",{children:["Wartungsmodus aktiv",v?` – ${v}`:w?" – Portainer-Update läuft":"","."]}),w&&y.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",j]})]})}),y.jsxs(H.Card,{className:"border border-blue-gray-100 shadow-sm",children:[y.jsx(H.CardHeader,{variant:"gradient",color:"gray",className:"mb-5 p-4",children:y.jsx(H.Typography,{variant:"h6",color:"white",children:y.jsx("span",{children:"Benutzergruppen"})})}),y.jsxs(H.CardBody,{className:"pt-0",children:[M&&y.jsxs("div",{className:"mb-8 rounded-lg border border-blue-gray-100 bg-white p-4 shadow-sm",children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",className:"mb-2",children:"Neue Benutzergruppe anlegen"}),y.jsx(H.Typography,{variant:"small",className:"text-sm text-stormGrey-500 mb-4",children:"Der Gruppenname ist Pflicht, die Beschreibung optional."}),O&&y.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}),y.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[y.jsx(H.Input,{label:"Gruppenname",value:f,onChange:ce=>g(ce.target.value),disabled:Me,crossOrigin:""}),y.jsx(H.Input,{label:"Beschreibung (optional)",value:b,onChange:ce=>S(ce.target.value),disabled:Me,crossOrigin:""})]}),y.jsxs("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[y.jsx(H.Button,{color:"green",onClick:Pe,disabled:Me,children:C?"Speichert ...":"Gruppe anlegen"}),y.jsx(H.Button,{variant:"text",color:"blue-gray",onClick:ye,disabled:C||N,children:"Formular zurücksetzen"})]})]}),y.jsx("div",{className:"mb-8",children:y.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[y.jsx("div",{className:"md:flex-1",children:y.jsx(H.Input,{label:"Suchen nach Name, E-Mail oder Gruppe",value:i,onChange:me,disabled:r&&!e.length,crossOrigin:""})}),y.jsx("div",{className:"md:mt-0 mt-8 md:flex-1",children:y.jsx(H.Select,{variant:"static",label:"Einträge pro Seite",onChange:X,value:B,children:U.map(({value:ce,label:je})=>y.jsx(H.Option,{value:ce,children:je},ce))})})]})}),o&&y.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&&y.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}),y.jsx("div",{className:"overflow-x-auto rounded-lg border border-blue-gray-50",children:y.jsxs("table",{className:"w-full min-w-[720px] table-auto text-left",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"bg-blue-gray-50/50 text-xs uppercase tracking-wide text-stormGrey-400",children:[y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Gruppenname"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Beschreibung"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Mitglieder"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Erstellt am"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Zuletzt aktualisiert"}),y.jsx("th",{className:"px-6 py-4 font-semibold",children:"Aktionen"})]})}),y.jsx("tbody",{children:r&&e.length===0?y.jsx("tr",{children:y.jsx("td",{colSpan:6,className:"px-6 py-8 text-center text-stormGrey-400",children:"Gruppen werden geladen ..."})}):Se.length===0?y.jsx("tr",{children:y.jsx("td",{colSpan:6,className:"px-6 py-8 text-center text-stormGrey-400",children:"Keine Gruppen gefunden."})}):Se.map((ce,je)=>{const He=je===Se.length-1?"":"border-b border-blue-gray-50",qe=((ce==null?void 0:ce.name)||"").toLowerCase()==="superuser";return y.jsxs("tr",{className:`text-sm text-stormGrey-700 ${He}`,children:[y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",className:"font-medium text-stormGrey-900",children:ce.name||"–"})}),y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",children:ce.description?ce.description:y.jsx("span",{className:"text-stormGrey-400",children:"–"})})}),y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:ce.memberCount.toLocaleString("de-DE")})}),y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:be(ce.createdAt)})}),y.jsx("td",{className:"px-6 py-4",children:y.jsx(H.Typography,{variant:"small",className:"antialiased font-sans mb-1 block text-xs font-medium text-stormGrey-600",children:be(ce.updatedAt)})}),y.jsx("td",{className:"px-6 py-4",children:y.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-2",children:[y.jsx(H.Button,{size:"sm",variant:"outlined",color:"blue-gray",onClick:()=>k(`/dashboard/usergroups/${ce.id}`),children:"Details"}),D&&!qe&&y.jsx(H.Button,{size:"sm",variant:"text",color:"red",onClick:()=>ke(ce),disabled:N||m===ce.id||Number(ce.memberCount)>0,children:m===ce.id?"Löscht ...":"Löschen"})]})})]},ce.id)})})]})}),y.jsxs("div",{className:"mt-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[y.jsx(H.Typography,{variant:"small",color:"gray",children:!r&&e.length===0?"Noch keine Gruppen angelegt.":`${pe.toLocaleString("de-DE")} Gruppen gefunden`}),y.jsx(Jf,{disabled:r&&e.length===0})]})]})]})]})}const ws={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"}};({...ws,xaxis:{...ws.xaxis}});({...ws,xaxis:{...ws.xaxis}});({...ws,xaxis:{...ws.xaxis}});const yV=[{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"}]}],iN=["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"],xV={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},wV=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):[],Zw=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:wV(e==null?void 0:e.groups),securityPhraseDownloadedAt:(e==null?void 0:e.securityPhraseDownloadedAt)||null}),_V=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},ta=e=>{if(!e)return{username:"",email:"",password:"",groupId:null,avatarColor:""};const t=_V(e);return{username:e.username||"",email:e.email||"",password:"",groupId:Number.isFinite(t)?t:null,avatarColor:e.avatarColor||""}};function SV(){const{userId:e}=H5(),{showToast:t}=zs(),{maintenance:r,update:n}=Aa(),{hasPermission:o,user:a}=Ur(),[i,c]=P.useState(null),[f,g]=P.useState(ta(null)),b=P.useRef(ta(null)),[S,O]=P.useState(!1),[T,C]=P.useState(""),[x,m]=P.useState(!1),[d,s]=P.useState([]),[u,l]=P.useState(!1),[h,v]=P.useState(""),[w,j]=P.useState(!1),[N,k]=P.useState(""),[A,M]=P.useState([]),[D,L]=P.useState(null),[B,U]=P.useState(!1),[Y,q]=P.useState(""),[z,$]=P.useState(!1),K=!!(r!=null&&r.active),X=r==null?void 0:r.message,te=!!(n!=null&&n.running),me=n!=null&&n.stage?xV[n.stage]??n.stage:"–",de=K||te,ee=!!(a!=null&&a.isSuperuser||o("users-edit","full")),Se=!!(a!=null&&a.isSuperuser||o("users-edit","read")),pe=!!(a!=null&&a.isSuperuser||o("users-security-phrase","full")),fe=pe;if(!Se)return null;const be=P.useMemo(()=>Array.isArray(i==null?void 0:i.groups)?i.groups.some(he=>((he==null?void 0:he.name)||"").toLowerCase()==="superuser"):!1,[i]),ye=(a==null?void 0:a.isSuperuser)&&(i==null?void 0:i.id)&&Number(a.id)===Number(i.id),Pe=be&&!ye,Me=P.useMemo(()=>{const he=Number(e);return Number.isFinite(he)?he:null},[e]),ke=P.useCallback(async()=>{var he,Oe,Ce,Ue;if(!Me){C("Ungültige Benutzer-ID."),c(null),g(ta(null)),b.current=ta(null),m(!0);return}O(!0),C("");try{const Fe=await lt.get(`/api/users/${Me}`),Ie=Zw((he=Fe.data)==null?void 0:he.item);if(!Ie.id)throw new Error("USER_NOT_FOUND");c(Ie),M([]),L(Ie.securityPhraseDownloadedAt||null),q("");const Ee=ta(Ie);b.current={...Ee},g(Ee),k("")}catch(Fe){const Ie=(Ce=(Oe=Fe.response)==null?void 0:Oe.data)==null?void 0:Ce.error;let Ee="Benutzerdetails konnten nicht geladen werden.";Ie==="USER_NOT_FOUND"?Ee="Der angeforderte Benutzer wurde nicht gefunden.":Ie==="INVALID_USER_ID"?Ee="Die angegebene Benutzer-ID ist ungültig.":((Ue=Fe.response)==null?void 0:Ue.status)===404&&(Ee="Der angeforderte Benutzer existiert nicht."),c(null),b.current=ta(null),g(ta(null)),C(Ee),t({variant:"error",title:"Fehler beim Laden",description:Ee})}finally{O(!1),m(!0)}},[Me,t]),ce=P.useCallback(async()=>{var he,Oe,Ce;l(!0),v("");try{const Ue=await lt.get("/api/groups"),Ie=(Array.isArray((he=Ue.data)==null?void 0:he.items)?Ue.data.items:[]).map(Ee=>({id:Number(Ee.id),name:Ee.name||"",description:Ee.description||"",memberCount:Number.isFinite(Number(Ee.memberCount))?Number(Ee.memberCount):0})).filter(Ee=>Number.isFinite(Ee.id)&&Ee.id>0&&Ee.name).sort((Ee,dt)=>Ee.name.localeCompare(dt.name,"de-DE"));s(Ie)}catch(Ue){const Fe=((Ce=(Oe=Ue.response)==null?void 0:Oe.data)==null?void 0:Ce.error)||Ue.message||"Benutzergruppen konnten nicht geladen werden.";v(Fe),t({variant:"error",title:"Benutzergruppen",description:Fe})}finally{l(!1)}},[t]);P.useEffect(()=>{ke()},[ke]),P.useEffect(()=>{ce()},[ce]);const je=P.useMemo(()=>{if(!x||!i)return!1;const he=b.current;if(!he)return!1;const Oe=he.username||"",Ce=f.username||"",Ue=he.email||"",Fe=f.email||"",Ie=Number.isFinite(he.groupId)?Number(he.groupId):null,Ee=Number.isFinite(f.groupId)?Number(f.groupId):null,dt=he.avatarColor||"",ft=f.avatarColor||"",Ft=!!(f.password&&f.password.trim().length>0);return Oe!==Ce||Ue!==Fe||!be&&Ie!==Ee||dt!==ft||Ft},[f,x,i,be]),He=P.useCallback(he=>{var Oe;return(Oe=he==null?void 0:he.props)!=null&&Oe.children?he.props.children:f.avatarColor?f.avatarColor:"Standardfarbe"},[f.avatarColor]),qe=P.useCallback(he=>{if(!ee)return;const{value:Oe}=he.target;g(Ce=>({...Ce,username:Oe}))},[ee]),Je=P.useCallback(he=>{if(!ee)return;const{value:Oe}=he.target;g(Ce=>({...Ce,email:Oe}))},[ee]),Qe=P.useCallback(he=>{if(!ee)return;const{value:Oe}=he.target;g(Ce=>({...Ce,password:Oe}))},[ee]),Ge=P.useCallback(he=>{if(!ee)return;if(!he){g(Ce=>({...Ce,groupId:null}));return}const Oe=Number(he);g(Ce=>({...Ce,groupId:Number.isFinite(Oe)&&Oe>0?Oe:null}))},[ee]),Xe=P.useCallback(he=>{ee&&g(Oe=>({...Oe,avatarColor:he||""}))},[ee]),ht=P.useCallback(async()=>{var he,Oe,Ce,Ue;if(!(!ee||!i||!je)){j(!0),k("");try{const Fe={username:f.username,email:f.email,password:f.password,avatarColor:f.avatarColor};be||(Fe.groupId=f.groupId);const Ie=await lt.put(`/api/users/${i.id}`,Fe),Ee=Zw(((he=Ie.data)==null?void 0:he.item)||((Oe=Ie.data)==null?void 0:Oe.user));c(Ee);const dt=ta(Ee);b.current={...dt},g(dt),v(""),t({variant:"success",title:"Benutzer gespeichert",description:"Die Änderungen wurden erfolgreich gespeichert."})}catch(Fe){const Ie=(Ue=(Ce=Fe.response)==null?void 0:Ce.data)==null?void 0:Ue.error;let Ee="Die Benutzerdaten konnten nicht gespeichert werden.";Ie==="USERNAME_REQUIRED"?Ee="Bitte einen Benutzernamen angeben.":Ie==="USERNAME_TAKEN"?Ee="Der Benutzername wird bereits verwendet.":Ie==="INVALID_EMAIL"?Ee="Bitte eine gültige E-Mail-Adresse eingeben.":Ie==="EMAIL_TAKEN"?Ee="Die E-Mail-Adresse wird bereits verwendet.":Ie==="INVALID_PASSWORD"?Ee="Das Passwort ist ungültig.":Ie==="PASSWORD_TOO_SHORT"?Ee="Das Passwort muss mindestens 8 Zeichen enthalten.":Ie==="INVALID_AVATAR_COLOR"?Ee="Bitte eine gültige Avatar-Farbe auswählen.":Ie==="GROUP_NOT_FOUND"&&(Ee="Die ausgewählte Benutzergruppe existiert nicht mehr.",v(Ee)),k(Ee),t({variant:"error",title:"Speichern fehlgeschlagen",description:Ee})}finally{j(!1)}}},[ee,i,je,f,t,be]),Ve=P.useCallback(async()=>{var he,Oe,Ce,Ue,Fe,Ie;if(!(!pe||!Me)){U(!0),q("");try{const Ee=await lt.get(`/api/users/${Me}/security-phrase`),dt=Array.isArray((Oe=(he=Ee.data)==null?void 0:he.item)==null?void 0:Oe.words)?Ee.data.item.words:[];M(dt),L(((Ue=(Ce=Ee.data)==null?void 0:Ce.item)==null?void 0:Ue.downloadedAt)||null)}catch(Ee){const dt=(Ie=(Fe=Ee.response)==null?void 0:Fe.data)==null?void 0:Ie.error;let ft="Sicherheitsschlüssel konnte nicht geladen werden.";dt==="USER_NOT_FOUND"?ft="Der Benutzer wurde nicht gefunden.":dt==="INVALID_USER_ID"?ft="Die Benutzer-ID ist ungültig.":dt==="INSUFFICIENT_PERMISSIONS"&&(ft="Keine Berechtigung zum Anzeigen des Sicherheitsschlüssels."),q(ft),M([]),L(null)}finally{U(!1)}}},[pe,Me]),ot=P.useCallback(()=>{fe&&(B||z||Ve())},[fe,Ve,z,B]),_t=P.useCallback(async()=>{var he,Oe,Ce,Ue,Fe,Ie;if(!(!fe||!Me||de||z)){$(!0),q("");try{const Ee=await lt.post(`/api/users/${Me}/security-phrase/renew`),dt=Array.isArray((Oe=(he=Ee.data)==null?void 0:he.item)==null?void 0:Oe.words)?Ee.data.item.words:[];M(dt),L(((Ue=(Ce=Ee.data)==null?void 0:Ce.item)==null?void 0:Ue.downloadedAt)||null),t({variant:"success",title:"Sicherheitsschlüssel erneuert",description:"Der Benutzer muss den neuen Schlüssel erneut herunterladen."})}catch(Ee){const dt=(Ie=(Fe=Ee.response)==null?void 0:Fe.data)==null?void 0:Ie.error;let ft="Der Sicherheitsschlüssel konnte nicht erneuert werden.";dt==="USER_NOT_FOUND"?ft="Der Benutzer wurde nicht gefunden.":dt==="INVALID_USER_ID"?ft="Die Benutzer-ID ist ungültig.":dt==="INSUFFICIENT_PERMISSIONS"&&(ft="Keine Berechtigung zum Erneuern des Sicherheitsschlüssels."),q(ft)}finally{$(!1)}}},[fe,Me,de,z,t]),Ne=P.useMemo(()=>{const he=(f.username||f.email||"").trim();return he?he.charAt(0).toUpperCase():"?"},[f.username,f.email]),at=P.useMemo(()=>f.avatarColor?f.avatarColor:(i==null?void 0:i.avatarColor)||"",[f.avatarColor,i]),Te=P.useMemo(()=>{if(!Array.isArray(A)||A.length===0)return[];const he=[];for(let Oe=0;Oe{if(!D)return{text:"Noch nicht heruntergeladen",tone:"text-red-500"};const he=new Date(D);return Number.isNaN(he.getTime())?{text:"Zuletzt heruntergeladen: unbekannt",tone:"text-blue-gray-500"}:{text:`Zuletzt heruntergeladen: ${he.toLocaleString("de-DE")}`,tone:"text-blue-gray-500"}},[D]),ge=P.useMemo(()=>Array.isArray(d)?d.filter(he=>((he==null?void 0:he.name)||"").toLowerCase()!=="superuser"):[],[d]);P.useEffect(()=>{if(be)return;const he=f.groupId?Number(f.groupId):null;ge.some(Ce=>Number(Ce.id)===he)||g(Ce=>({...Ce,groupId:null}))},[ge,f.groupId,be]),P.useEffect(()=>{if(x){if(!pe||!Me){M([]),L(null),q(""),U(!1);return}Ve()}},[x,pe,Ve,Me]);const oe=de||w||!i||!ee,ve=de||w||!i||u||!ee||be,se=de||w||!i||!ee||Pe,ie=f.groupId?String(f.groupId):"";return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"mt-12 flex flex-col gap-12",children:[(K||te)&&y.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("span",{children:["Wartungsmodus aktiv",X?` – ${X}`:te?" – Portainer-Update läuft":"","."]}),te&&y.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",me]})]})}),y.jsx("div",{className:"relative h-72 w-full overflow-hidden rounded-xl bg-[url('/img/background-image.png')] bg-cover\\tbg-center",children:y.jsx("div",{className:"absolute inset-0 h-full w-full bg-gray-900/75"})}),y.jsx(H.Card,{className:"mx-3 -mt-16 mb-6 lg:mx-4 border border-blue-gray-100",children:y.jsxs(H.CardBody,{className:"p-4",children:[y.jsxs("div",{className:"mb-10 flex flex-wrap items-center justify-between gap-6",children:[y.jsxs("div",{className:"flex items-center gap-6",children:[y.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 ${at}`,"aria-label":f.username||"Benutzeravatar",children:Ne}),y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:f.username||"–"}),y.jsx(H.Typography,{className:"text-xs font-semibold tracking-wide text-stormGrey-400",children:f.email||"–"})]})]}),je&&y.jsx(H.Button,{color:"green",className:"normal-case",onClick:ht,disabled:de||w,children:w?"Speichert ...":"Änderungen speichern"})]}),S&&!i&&y.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:[y.jsx(H.Spinner,{className:"h-4 w-4"}),y.jsx("span",{children:"Benutzerdaten werden geladen ..."})]}),T&&!S&&y.jsx("div",{className:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:T}),N&&!S&&y.jsx("div",{className:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:N}),y.jsxs("div",{className:"grid-cols-1 mb-12 grid gap-12 px-4 lg:grid-cols-2 xl:grid-cols-3",children:[y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",className:"mb-4",children:"Allgemeine Einstellungen"}),be&&y.jsxs("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:["Systemgruppe – Name und Beschreibung sind geschützt.",Pe&&y.jsx("span",{className:"mt-1 block text-xs text-amber-600",children:"Nur der Superuser selbst kann Benutzername, E-Mail-Adresse und Passwort ändern."})]}),y.jsxs("div",{className:"mb-6",children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Benutzername"}),y.jsx(H.Input,{value:f.username,onChange:qe,placeholder:"Benutzername",disabled:oe||Pe,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),y.jsxs("div",{className:"mb-6",children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"E-Mail-Adresse"}),y.jsx(H.Input,{type:"email",value:f.email,onChange:Je,placeholder:"benutzer@example.com",disabled:oe||Pe,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),y.jsxs("div",{className:"mb-6",children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Neues Passwort"}),y.jsx(H.Input,{type:"password",value:f.password,onChange:Qe,placeholder:"Passwort setzen",disabled:oe||Pe,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}}),y.jsx(H.Typography,{className:"mt-1 text-xs text-blue-gray-400",children:"Das Passwort wird nur geändert, wenn ein neuer Wert eingetragen wird."})]}),y.jsxs("div",{className:"mb-6",children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Globale Rolle"}),be?y.jsx(H.Typography,{className:"block text-xs font-semibold uppercase text-blue-gray-500",children:"Die Rolle für den Superuser kann nicht geändert werden."}):u&&d.length===0?y.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:[y.jsx(H.Spinner,{className:"h-4 w-4"}),y.jsx("span",{children:"Benutzergruppen werden geladen ..."})]}):ge.length===0?y.jsx(H.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."}):y.jsx(H.Select,{label:"Benutzergruppe wählen",value:ie,onChange:Ge,disabled:ve,variant:"outlined",children:ge.map(he=>y.jsx(H.Option,{value:String(he.id),children:he.name},he.id))})]}),y.jsxs("div",{className:"mb-6",children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Avatar-Farbe"}),y.jsxs(H.Select,{label:"Avatar-Farbe auswählen",variant:"outlined",value:f.avatarColor,onChange:Xe,disabled:se,selected:He,children:[y.jsx(H.Option,{value:"",children:y.jsxs("span",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"h-4 w-4 rounded border border-blue-gray-100"}),y.jsx("span",{className:"text-xs",children:"Keine"})]})}),iN.map(he=>y.jsx(H.Option,{value:he,children:y.jsxs("span",{className:"flex items-center gap-2",children:[y.jsx("span",{className:`h-4 w-4 rounded border border-blue-gray-100 ${he}`}),y.jsx("span",{className:"text-xs",children:he})]})},he))]})]})]}),y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",className:"mb-3",children:"Platform Settings"}),y.jsx("div",{className:"flex flex-col gap-12",children:yV.map(({title:he,options:Oe})=>y.jsxs("div",{children:[y.jsx(H.Typography,{className:"mb-4 block text-xs font-semibold uppercase text-blue-gray-500",children:he}),y.jsx("div",{className:"flex flex-col gap-6",children:Oe.map(({checked:Ce,label:Ue})=>y.jsx(H.Switch,{id:Ue,label:Ue,defaultChecked:Ce,labelProps:{className:"text-sm font-normal text-blue-gray-500"}},Ue))})]},he))})]})]}),pe&&y.jsxs("div",{className:"mt-10 border-t border-blue-gray-50 pt-8",children:[y.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-4",children:[y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",children:"Sicherheitsschlüssel"}),y.jsx(H.Typography,{className:`text-sm ${ae.tone}`,children:ae.text})]}),y.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[y.jsx(H.Button,{variant:"outlined",color:"blue",className:"normal-case",onClick:ot,disabled:!fe||de||B||z,children:"Aktualisieren"}),y.jsx(H.Button,{color:"red",className:"normal-case",onClick:_t,disabled:!fe||de||B||z,children:z?"Erneuert ...":"Schlüssel erneuern"})]})]}),B?y.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:[y.jsx(H.Spinner,{className:"h-4 w-4"}),y.jsx("span",{children:"Sicherheitsschlüssel wird geladen ..."})]}):Y?y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:[y.jsx("span",{children:Y}),y.jsx(H.Button,{variant:"text",size:"sm",color:"red",className:"normal-case",onClick:ot,disabled:!fe||de||B||z,children:"Erneut laden"})]}):Te.length>0?y.jsx("div",{className:"rounded-lg border border-blue-gray-100 bg-blue-gray-50/60 p-4",children:y.jsx("div",{className:"space-y-2 text-center font-mono text-base tracking-wide text-blue-gray-900 md:text-lg",children:Te.map((he,Oe)=>y.jsx("div",{className:"flex flex-wrap items-center justify-center gap-4",children:he.map((Ce,Ue)=>y.jsx("span",{className:"uppercase",children:Ce},`security-phrase-${Oe}-${Ue}`))},`security-phrase-row-${Oe}`))})}):y.jsx(H.Typography,{className:"text-sm text-blue-gray-500",children:"Kein Sicherheitsschlüssel verfügbar."}),y.jsx(H.Typography,{className:"mt-3 text-sm text-blue-gray-500",children:"Nach dem Erneuern muss der Benutzer den neuen Sicherheitsschlüssel erneut herunterladen."})]})]})})]})})}const CV={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},Jw=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):[]}),ra=e=>e?{name:e.name||"",description:e.description||"",avatarColor:e.avatarColor||""}:{name:"",description:"",avatarColor:""},Ih=[{value:"full",label:"Vollzugriff"},{value:"read",label:"Nur lesen"},{value:"none",label:"Kein Zugriff"}],e_={none:0,read:1,full:2},Dh=(e,t)=>e==="maintenance-server-delete"&&t!=="full"?"none":t;function TV(){const{groupId:e}=H5(),{showToast:t}=zs(),{maintenance:r,update:n}=Aa(),{hasPermission:o,user:a}=Ur(),[i,c]=P.useState(null),[f,g]=P.useState(ra(null)),b=P.useRef(ra(null)),[S,O]=P.useState({}),[T,C]=P.useState(!1),[x,m]=P.useState(""),[d,s]=P.useState(!1),[u,l]=P.useState(!1),[h,v]=P.useState(""),[w,j]=P.useState([]),[N,k]=P.useState({}),[A,M]=P.useState({}),[D,L]=P.useState(!1),[B,U]=P.useState(""),Y=!!(r!=null&&r.active),q=r==null?void 0:r.message,z=!!(n!=null&&n.running),$=n!=null&&n.stage?CV[n.stage]??n.stage:"–",K=Y||z,X=P.useMemo(()=>((i==null?void 0:i.name)||"").toLowerCase()==="superuser",[i]),te=!!(a!=null&&a.isSuperuser),me=!!(te||o("user-groups-edit","full")),de=!!(te||o("user-groups-edit","read")),ee=!!(te||o("user-groups-edit","full")),Se=X&&!te,pe=P.useMemo(()=>{const Te=Number(e);return Number.isFinite(Te)?Te:null},[e]),fe=P.useCallback(async Te=>{var ge,oe,ve,se;const ae=Number(Te);if(!Number.isFinite(ae)||ae<=0){j([]),k({}),M({}),U(""),O({}),L(!1);return}L(!0),U("");try{const ie=await lt.get(`/api/groups/${ae}/permissions`),he=Array.isArray((ge=ie.data)==null?void 0:ge.sections)?ie.data.sections:[],Oe=(oe=ie.data)!=null&&oe.values&&typeof ie.data.values=="object"?ie.data.values:{},Ce={},Ue={},Fe=(Ee,dt)=>{if(!Ee||typeof Ee!="object")return null;const ft=Ee.key||"",Ft=typeof Ee.defaultLevel=="string"&&Ee.defaultLevel?Ee.defaultLevel:"none";Ce[ft]=Ft;const Kt=Oe[ft];let Pt=typeof Kt=="string"&&Kt?Kt:Ft;const Rt=Array.isArray(Ee.availableLevels)&&Ee.availableLevels.length?Ee.availableLevels:Ih.map(ir=>ir.value);Rt.includes(Pt)||(Pt=Ft),Ue[ft]=Pt;const hr=Array.isArray(Ee.dependencies)?Ee.dependencies:[];return{...Ee,availableLevels:Rt,dependencies:hr,sortOrder:typeof Ee.sortOrder=="number"?Ee.sortOrder:dt}},Ie=he.map((Ee,dt)=>{const ft=Array.isArray(Ee.items)?Ee.items.map((Kt,Pt)=>Fe(Kt,Pt)).filter(Boolean):[],Ft=Array.isArray(Ee.groups)?Ee.groups.map((Kt,Pt)=>{const Rt=Array.isArray(Kt.items)?Kt.items.map((hr,ir)=>Fe(hr,ir)).filter(Boolean):[];return{...Kt,sortOrder:typeof Kt.sortOrder=="number"?Kt.sortOrder:Pt,items:Rt}}):[];return{...Ee,sortOrder:typeof Ee.sortOrder=="number"?Ee.sortOrder:dt,hasNavigation:!!Ee.hasNavigation,items:ft,groups:Ft}});j(Ie),M(Ce),k({...Ue}),O({...Ue})}catch(ie){let he="Die Berechtigungen konnten nicht geladen werden.";((se=(ve=ie.response)==null?void 0:ve.data)==null?void 0:se.error)==="GROUP_NOT_FOUND"&&(he="Die angeforderte Benutzergruppe wurde nicht gefunden."),U(he),j([]),k({}),M({}),O({}),t({variant:"error",title:"Fehler beim Laden",description:he})}finally{L(!1)}},[t]),be=P.useCallback(async()=>{var Te,ae,ge,oe;if(!pe){m("Ungültige Gruppen-ID."),c(null),g(ra(null)),b.current=ra(null),j([]),k({}),M({}),U(""),s(!0);return}C(!0),m("");try{const ve=await lt.get(`/api/groups/${pe}`),se=Jw((Te=ve.data)==null?void 0:Te.item);if(!se.id)throw new Error("GROUP_NOT_FOUND");c(se);const ie=ra(se);b.current={...ie},g(ie),v(""),(se.name||"").toLowerCase()==="superuser"?(j([]),k({}),M({}),U(""),O({}),L(!1)):de?fe(se.id):(j([]),k({}),M({}),U(""),O({}),L(!1))}catch(ve){const se=(ge=(ae=ve.response)==null?void 0:ae.data)==null?void 0:ge.error;let ie="Gruppendetails konnten nicht geladen werden.";se==="GROUP_NOT_FOUND"?ie="Die angeforderte Benutzergruppe wurde nicht gefunden.":se==="INVALID_GROUP_ID"?ie="Die angegebene Gruppen-ID ist ungültig.":((oe=ve.response)==null?void 0:oe.status)===404&&(ie="Die angeforderte Benutzergruppe existiert nicht."),c(null),b.current=ra(null),g(ra(null)),j([]),k({}),M({}),U(""),L(!1),m(ie),t({variant:"error",title:"Fehler beim Laden",description:ie})}finally{C(!1),s(!0)}},[pe,t,fe,de]);P.useEffect(()=>{be()},[be]);const ye=P.useMemo(()=>{if(!d||!i)return!1;const Te=b.current;if(!Te)return!1;const ae=Te.name||"",ge=f.name||"",oe=Te.description||"",ve=f.description||"",se=Te.avatarColor||"",ie=f.avatarColor||"";return ae!==ge||oe!==ve||se!==ie},[f,d,i]),Pe=P.useMemo(()=>{if(X)return!1;const Te=S||{},ae=N||{},ge=new Set([...Object.keys(Te),...Object.keys(ae)]);for(const oe of ge){const ve=Te[oe]??null,se=ae[oe]??null;if(ve!==se)return!0}return!1},[N,S,X]),Me=P.useMemo(()=>ye||Pe,[ye,Pe]),ke=P.useCallback(Te=>{const{value:ae}=Te.target;g(ge=>({...ge,name:ae}))},[]),ce=P.useCallback(Te=>{const{value:ae}=Te.target;g(ge=>({...ge,description:ae}))},[]),je=P.useCallback(Te=>{g(ae=>({...ae,avatarColor:Te||""}))},[]),He=P.useCallback(async()=>{var Te,ae,ge,oe;if(!(!i||!ye&&!Pe)){if(ye&&!me){v("Dir fehlt die Berechtigung, diese Gruppe zu bearbeiten.");return}if(Pe&&!ee){v("Dir fehlt die Berechtigung, die Gruppenrechte anzupassen.");return}l(!0),v("");try{if(ye){const ve={avatarColor:f.avatarColor};X||(ve.name=f.name,ve.description=f.description);const se=await lt.put(`/api/groups/${i.id}`,ve),ie=Jw(((Te=se.data)==null?void 0:Te.item)||((ae=se.data)==null?void 0:ae.group));if(ie!=null&&ie.id){c(ie);const he=ra(ie);b.current={...he},g(he)}}Pe&&(await lt.put(`/api/groups/${i.id}/permissions`,{values:N}),k(ve=>({...ve,...N})),O({...N})),ye?t({variant:"success",title:"Gruppe gespeichert",description:"Die Änderungen wurden erfolgreich gespeichert."}):Pe&&t({variant:"success",title:"Berechtigungen gespeichert",description:"Die Berechtigungen wurden erfolgreich gespeichert."}),v("")}catch(ve){const se=(oe=(ge=ve.response)==null?void 0:ge.data)==null?void 0:oe.error;let ie="Die Änderungen konnten nicht gespeichert werden.";se==="GROUP_NAME_REQUIRED"?ie="Bitte einen Gruppennamen angeben.":se==="GROUP_NAME_TAKEN"?ie="Der Gruppenname wird bereits verwendet.":se==="INVALID_AVATAR_COLOR"?ie="Bitte eine gültige Avatar-Farbe auswählen.":se==="GROUP_NOT_FOUND"?ie="Die Benutzergruppe wurde nicht gefunden.":se==="GROUP_SUPERUSER_PROTECTED"?ie="Für die Superuser-Gruppe können Berechtigungen nicht angepasst werden.":se==="PERMISSION_INVALID_PAYLOAD"?ie="Ungültige Berechtigungsdaten übermittelt.":se==="PERMISSION_INVALID_LEVEL"?ie="Für mindestens eine Berechtigung wurde ein nicht erlaubter Wert übermittelt.":se==="PERMISSION_UNKNOWN_KEY"&&(ie="Es wurde eine unbekannte Berechtigung übermittelt."),v(ie),t({variant:"error",title:"Speichern fehlgeschlagen",description:ie})}finally{l(!1)}}},[i,ye,Pe,f,t,X,N,me,ee]),qe=P.useMemo(()=>{const Te=(f.name||f.description||"").trim();return Te?Te.charAt(0).toUpperCase():"?"},[f.name,f.description]),Je=P.useMemo(()=>f.avatarColor?f.avatarColor:(i==null?void 0:i.avatarColor)||"",[f.avatarColor,i]),Qe=K||u||!i||Se||!me,Ge=K||u||!i||Se||!me,Xe=f.avatarColor||"",ht=P.useCallback((Te,ae)=>{if(!Te||!ee||X)return;const ge=Dh(Te,ae);k(oe=>{const ve=Te==="maintenance-server-manage"&&ge!=="full";if(!ve&&oe[Te]===ge)return oe;const se={...oe,[Te]:ge};return ve&&(se["maintenance-server-delete"]="none"),se})},[ee,X]),Ve=P.useCallback(Te=>{if(!Te)return null;let ae=null;return Object.prototype.hasOwnProperty.call(N,Te)?ae=N[Te]:Object.prototype.hasOwnProperty.call(A,Te)&&(ae=A[Te]),typeof ae=="string"?Dh(Te,ae):ae},[N,A]),ot=P.useMemo(()=>y.jsx("span",{className:"mx-auto block h-2.5 w-2.5 rounded-full border border-blue-gray-400 bg-black"}),[]),_t=P.useMemo(()=>y.jsx("span",{className:"mx-auto block h-2.5 w-2.5 rounded-full border border-blue-gray-700 bg-gray-900"}),[]),Ne=P.useCallback(Te=>!Te||!Te.key?!1:(Array.isArray(Te.dependencies)?Te.dependencies:[]).every(ge=>{if(!ge||!ge.key)return!0;const oe=Ve(ge.key)??"none",ve=ge.requiredLevel||"!=none";return ve==="!=none"?oe!=="none":ve.startsWith("!=")?oe!==ve.substring(2):ve.startsWith("=")?oe===ve.substring(1):ve?oe===ve:!0}),[Ve]),at=(Te,ae,ge={})=>{if(!Ne(Te))return null;const oe=`permission-${ae}-${Te.key}`,ve=Ve(Te.key)??"none",se=Dh(Te.key,ve),ie=Ve("maintenance-server-manage")??"none",{addTopBorder:he=!0}=ge,Oe=["flex flex-col gap-2.5 px-4 py-4 md:flex-row md:items-center md:gap-6",he?"border-t border-blue-gray-100":""].filter(Boolean).join(" "),Ce=Array.isArray(Te.availableLevels)&&Te.availableLevels.length?Te.availableLevels:Ih.map(Ie=>Ie.value),Ue=new Set(Te.key==="maintenance-server-delete"?Ce.filter(Ie=>Ie==="full"||Ie==="none"):Ce),Fe=Ih;return y.jsxs("div",{className:Oe,children:[y.jsx("div",{className:"text-sm font-medium leading-5 text-blue-gray-600 md:w-1/2",children:Te.label}),y.jsx(H.List,{className:"flex-col gap-1.5 md:ml-auto md:flex-row md:flex-nowrap md:w-1/2 md:items-center md:justify-end md:gap-3",children:Fe.map(Ie=>{const Ee=`${oe}-${Ie.value}`,dt=se===Ie.value,ft=Te.key==="maintenance-server-delete"&&Ie.value==="full"&&(e_[ie]??0)ht(Te.key,Ie.value),disabled:Ft,ripple:!1,className:"h-4 w-4 hover:before:opacity-0",containerProps:{className:"p-0"},icon:ot,checkedIcon:_t})}),y.jsx(H.Typography,{color:"blue-gray",className:`text-sm font-medium leading-5 whitespace-nowrap ${Ft?"text-blue-gray-300":"text-blue-gray-600"}`,children:Ie.label})]})},`${ae}-${Te.key}-${Ie.value}`)})})]},`${ae}-${Te.key}`)};return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"mt-12 flex flex-col gap-12",children:[(Y||z)&&y.jsx("div",{className:"rounded-lg border border-cyan-500/60 bg-cyan-900/30 px-4 py-3 text-sm text-bluegray-100",children:y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("span",{children:["Wartungsmodus aktiv",q?` – ${q}`:z?" – Portainer-Update läuft":"","."]}),z&&y.jsxs("span",{className:"text-xs text-indigo-900",children:["Phase: ",$]})]})}),y.jsx("div",{className:"relative h-72 w-full overflow-hidden rounded-xl bg-[url('/img/background-image.png')] bg-cover\\tbg-center",children:y.jsx("div",{className:"absolute inset-0 h-full w-full bg-gray-900/75"})}),y.jsx(H.Card,{className:"mx-3 -mt-16 mb-6 lg:mx-4 border border-blue-gray-100",children:y.jsxs(H.CardBody,{className:"p-4",children:[y.jsxs("div",{className:"mb-10 flex flex-wrap items-center justify-between gap-6",children:[y.jsxs("div",{className:"flex items-center gap-6",children:[y.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 ${Je}`,"aria-label":f.name||"Gruppenavatar",children:qe}),y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:f.name||"–"}),y.jsxs(H.Typography,{className:"text-xs font-semibold tracking-wide text-stormGrey-400",children:["Gruppen-ID: ",(i==null?void 0:i.id)??"–"]})]})]}),Me&&y.jsx(H.Button,{color:"green",className:"normal-case",onClick:He,disabled:K||u,children:u?"Speichert ...":"Änderungen speichern"})]}),T&&!i&&y.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:[y.jsx(H.Spinner,{className:"h-4 w-4"}),y.jsx("span",{children:"Gruppendaten werden geladen ..."})]}),x&&!T&&y.jsx("div",{className:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:x}),h&&!T&&y.jsx("div",{className:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:h}),y.jsxs("div",{className:"grid-cols-1 mb-12 grid gap-12 px-4 lg:grid-cols-2 xl:grid-cols-3",children:[y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",className:"mb-4",children:"Gruppendaten"}),X&&y.jsxs("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:["Systemgruppe – Name und Beschreibung sind geschützt.",Se&&y.jsx("span",{className:"mt-1 block text-xs text-amber-600",children:"Nur der Superuser darf die Superuser-Gruppe bearbeiten."})]}),y.jsxs("div",{className:"mb-6",children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Gruppenname"}),y.jsx(H.Input,{value:f.name,onChange:ke,placeholder:"Gruppenname",disabled:Qe,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),y.jsxs("div",{className:"mb-6",children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Beschreibung"}),y.jsx(H.Input,{value:f.description,onChange:ce,placeholder:"Beschreibung der Gruppe",disabled:Qe,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),y.jsxs("div",{className:"mb-6",children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Avatar-Farbe"}),y.jsxs(H.Select,{label:"Avatar-Farbe auswählen",variant:"outlined",value:Xe,onChange:je,disabled:Ge,selected:Te=>{var ae;return(ae=Te==null?void 0:Te.props)!=null&&ae.children?Te.props.children:f.avatarColor?f.avatarColor:"Standardfarbe"},children:[y.jsx(H.Option,{value:"",children:y.jsxs("span",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"h-4 w-4 rounded border border-blue-gray-100"}),y.jsx("span",{className:"text-xs",children:"Keine"})]})}),iN.map(Te=>y.jsx(H.Option,{value:Te,children:y.jsxs("span",{className:"flex items-center gap-2",children:[y.jsx("span",{className:`h-4 w-4 rounded border border-blue-gray-100 ${Te}`}),y.jsx("span",{className:"text-xs",children:Te})]})},Te))]})]})]}),y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",className:"mb-4",children:"Mitglieder"}),!i||i.members.length===0?y.jsx(H.Typography,{className:"text-sm text-stormGrey-500",children:"Aktuell sind keine Benutzer dieser Gruppe zugeordnet."}):y.jsx("div",{className:"flex flex-wrap gap-2",children:i.members.map(Te=>y.jsx(H.Chip,{value:Te.username,size:"sm",color:"blue-gray",variant:"ghost"},`${i.id}-${Te.id}-${Te.username}`))}),y.jsx("div",{className:"mt-6 text-xs text-stormGrey-400",children:y.jsxs("p",{children:["Mitglieder insgesamt: ",(i==null?void 0:i.memberCount)??0]})})]}),y.jsx("div",{className:"lg:col-span-2 xl:col-span-3",children:!Y&&!z&&y.jsxs(y.Fragment,{children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",className:"mb-4",children:"Berechtigungen (Ansicht)"}),X?y.jsx("div",{className:"rounded-xl border border-blue-gray-100 bg-white px-4 py-4 text-sm text-blue-gray-600 shadow-sm",children:"Die Superuser-Gruppe besitzt automatisch Vollzugriff auf alle Bereiche. Berechtigungen können hier nicht angepasst werden."}):de?y.jsxs("div",{className:"rounded-xl border border-blue-gray-100 bg-white shadow-sm",children:[D&&y.jsx("div",{className:"border-b border-blue-gray-100 px-4 py-4",children:y.jsxs("div",{className:"flex items-center gap-3 text-sm text-blue-gray-500",children:[y.jsx(H.Spinner,{className:"h-4 w-4"}),y.jsx("span",{children:"Berechtigungen werden geladen ..."})]})}),!D&&B&&y.jsx("div",{className:"border-b border-blue-gray-100 px-4 py-4 text-sm text-red-700",children:B}),!D&&!B&&(w.length===0?y.jsx("div",{className:"border-b border-blue-gray-100 px-4 py-4 text-sm text-blue-gray-500",children:"Für diese Gruppe sind keine Berechtigungen definiert."}):w.map((Te,ae)=>{const ge=Array.isArray(Te.items)?Te.items:[],oe=Array.isArray(Te.groups)?Te.groups:[];return y.jsxs("div",{className:ae===0?"":"border-t border-blue-gray-100",children:[y.jsx("div",{className:"border-b border-blue-gray-100 px-4 py-4",children:y.jsx(H.Typography,{variant:"h6",className:"text-lg font-semibold text-blue-gray-700",children:Te.title})}),ge.map((ve,se)=>at(ve,Te.key||ae,{addTopBorder:se!==0})),oe.map((ve,se)=>{const ie=Array.isArray(ve.items)?ve.items:[];return ie.some(Ne)?y.jsxs("div",{className:"border-t border-blue-gray-100",children:[y.jsx("div",{className:"border-b border-blue-gray-100 px-4 py-3",children:y.jsx(H.Typography,{className:"text-sm font-semibold uppercase tracking-wide text-blue-gray-600",children:ve.title})}),ie.map((Oe,Ce)=>at(Oe,ve.key||`${Te.key||ae}-${se}`,{addTopBorder:Ce!==0}))]},ve.key||`${Te.key||ae}-${se}`):null})]},Te.key||ae)}))]}):null]})})]})]})})]})})}const OV={initializing:"Vorbereitung","activating-maintenance":"Wartungsmodus aktivieren","executing-script":"Skript wird ausgeführt",waiting:"Warte auf Portainer",completed:"Abgeschlossen",failed:"Fehlgeschlagen"},PV=(e=[])=>{if(!Array.isArray(e)||e.length===0)return"";const t=[];for(let r=0;r{if(!Array.isArray(e))return[];const t=[];for(let r=0;rkV(b),[b]),h=P.useCallback(N=>{if(!N)return;const k=new Blob([N],{type:"text/plain;charset=utf-8"}),A=URL.createObjectURL(k),M=document.createElement("a");M.href=A;const D=t!=null&&t.username?`${t.username}-sicherheitsschluessel`:"security-phrase";M.download=`${D}.txt`,document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(A)},[t==null?void 0:t.username]),v=P.useCallback(async()=>{var N,k,A,M,D,L,B,U;c(!0),g("");try{const Y=await lt.get("/api/users/me/security-phrase"),q=Array.isArray((k=(N=Y.data)==null?void 0:N.item)==null?void 0:k.words)?Y.data.item.words:[];if(!q.length)throw new Error("EMPTY_SECURITY_PHRASE");S(q),x(!1)}catch(Y){if(((A=Y==null?void 0:Y.response)==null?void 0:A.status)===409||((D=(M=Y==null?void 0:Y.response)==null?void 0:M.data)==null?void 0:D.error)==="SECURITY_PHRASE_ALREADY_DOWNLOADED"){await n(),e("/dashboard/stacks",{replace:!0});return}if(((L=Y==null?void 0:Y.response)==null?void 0:L.status)===401){await n(),e("/auth/sign-in",{replace:!0});return}const q=((U=(B=Y==null?void 0:Y.response)==null?void 0:B.data)==null?void 0:U.error)||(Y==null?void 0:Y.message)||"Sicherheitsschlüssel konnte nicht geladen werden.";g(q)}finally{c(!1)}},[e,n]);P.useEffect(()=>{if(!t){e("/auth/sign-in",{replace:!0});return}if(!m){e("/dashboard/stacks",{replace:!0});return}v()},[t,m,v,e]);const w=P.useCallback(()=>{v()},[v]),j=P.useCallback(async()=>{var N,k,A,M,D,L;if(!(O||!Array.isArray(b)||b.length===0)){T(!0),g("");try{const B=PV(b);h(B);const U=await lt.post("/api/users/me/security-phrase/downloaded"),Y=((k=(N=U.data)==null?void 0:N.item)==null?void 0:k.downloadedAt)||null,q=(A=U.data)==null?void 0:A.session;q!=null&&q.user?r(q):await n(),x(!!Y),e("/dashboard/stacks",{replace:!0})}catch(B){if(((M=B==null?void 0:B.response)==null?void 0:M.status)===401){await n(),e("/auth/sign-in",{replace:!0});return}const U=((L=(D=B==null?void 0:B.response)==null?void 0:D.data)==null?void 0:L.error)||(B==null?void 0:B.message)||"Download konnte nicht bestätigt werden.";g(U)}finally{T(!1)}}},[b,O,h,n,e,r]);return m?y.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-blue-gray-50/50 px-4 py-10",children:[y.jsxs("div",{className:"mb-6 text-center",children:[y.jsx(H.Typography,{variant:"h2",className:"font-semibold text-blue-gray-800",children:"Sicherheitsschlüssel sichern"}),y.jsx(H.Typography,{color:"blue-gray",className:"mt-2 max-w-3xl text-base",children:"Bitte lade den einmaligen Sicherheitsschlüssel herunter und bewahre ihn sicher auf. Er wird benötigt, um dein Passwort zurückzusetzen. Ohne den Download kannst du die Anwendung nicht weiter nutzen."})]}),y.jsx(H.Card,{className:"w-full max-w-3xl shadow-lg",children:y.jsxs(H.CardBody,{className:"space-y-6",children:[i&&y.jsx("div",{className:"flex items-center justify-center py-10",children:y.jsx(H.Spinner,{className:"h-10 w-10 text-blue-gray-500"})}),!i&&f&&y.jsx(H.Alert,{color:"red",className:"border border-red-200 bg-red-50 text-red-700",icon:y.jsx(zz,{className:"h-5 w-5"}),children:y.jsxs("div",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{children:[y.jsx(H.Typography,{variant:"h6",color:"red",children:"Fehler"}),y.jsx(H.Typography,{color:"red",className:"text-sm",children:f})]}),y.jsx(H.Button,{size:"sm",color:"red",variant:"text",onClick:w,className:"normal-case",children:"Erneut versuchen"})]})}),!i&&!f&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"rounded-lg border border-blue-gray-100 bg-blue-gray-50/60 p-6",children:[y.jsx(H.Typography,{variant:"h5",className:"mb-4 text-blue-gray-800",children:"Deine Sicherheitsphrase"}),y.jsx("div",{className:"space-y-3",children:l.map((N,k)=>y.jsx("div",{className:"flex flex-wrap items-center justify-center gap-4 text-lg font-mono tracking-wide text-blue-gray-900 md:text-xl",children:N.map((A,M)=>y.jsx("span",{className:"uppercase",children:A},`phrase-${k}-${M}`))},`phrase-row-${k}`))})]}),y.jsxs("div",{className:"flex flex-col items-center justify-between gap-4 md:flex-row",children:[y.jsx("div",{className:"text-sm text-blue-gray-600",children:"Der Download startet im TXT-Format. Bewahre die Datei sicher auf – sie kann später nicht erneut angezeigt werden."}),y.jsxs(H.Button,{color:"blue",size:"md",className:"flex items-center gap-2 normal-case",onClick:j,disabled:u||O||C||b.length===0,children:[y.jsx(Dz,{className:"h-5 w-5"}),"Sicherheitsschlüssel herunterladen"]})]})]})]})})]}):null}const EV="/assets/pattern-68ea7609.png";function jV(){const e=So(),{setSession:t,refreshSession:r}=Ur(),[n,o]=P.useState(""),[a,i]=P.useState(""),[c,f]=P.useState(!1),[g,b]=P.useState(null),[S,O]=P.useState(!1);P.useEffect(()=>{let C=!0;const x=new AbortController;return(async()=>{try{const d=await fetch("/api/setup/status",{credentials:"include",signal:x.signal});if(d.ok&&!(await d.json()).setupComplete&&C){e("/setup",{replace:!0});return}const s=await fetch("/api/auth/session",{credentials:"include",signal:x.signal});if(s.ok){const u=await s.json();if(u!=null&&u.user&&t(u),u!=null&&u.user&&C){const l=!!u.user.requiresSecurityPhraseDownload;e(l?"/dashboard/security-phrase":"/dashboard/stacks",{replace:!0});return}}}catch(d){d.name!=="AbortError"&&console.error("⚠️ [Auth] Initiale Prüfung fehlgeschlagen:",d)}finally{C&&O(!0)}})(),()=>{C=!1,x.abort()}},[e,t]);const T=P.useCallback(async C=>{var d,s;if(C.preventDefault(),c)return;b(null);const x=n.trim(),m=a.trim();if(!x||!m){b("Bitte fülle beide Felder aus.");return}f(!0);try{const u=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({identifier:x,password:m})}),l=await u.json().catch(()=>({}));if(!u.ok){if(u.status===401||l.error==="INVALID_CREDENTIALS")b("Ungültige Zugangsdaten.");else if(l.error==="MISSING_CREDENTIALS")b("Bitte fülle beide Felder aus.");else if(l.error==="SETUP_REQUIRED"||l.error==="SUPERUSER_REQUIRED"){e("/setup",{replace:!0});return}else l.error==="USER_INACTIVE"?b("Dieses Konto ist deaktiviert. Bitte wende dich an einen Administrator."):b("Anmeldung fehlgeschlagen. Bitte versuche es erneut.");return}let h=null;if(l!=null&&l.user)t(l),h=l;else{const w=await r();w!=null&&w.ok&&((d=w==null?void 0:w.data)!=null&&d.user)&&(h=w.data)}const v=!!((s=h==null?void 0:h.user)!=null&&s.requiresSecurityPhraseDownload);e(v?"/dashboard/security-phrase":"/dashboard/stacks",{replace:!0})}catch(u){console.error("⚠️ [Auth] Anmeldung fehlgeschlagen:",u),b("Netzwerkfehler – bitte erneut versuchen.")}finally{f(!1)}},[n,a,c,e,r,t]);return S?y.jsxs("section",{className:"m-8 flex gap-4",children:[y.jsxs("div",{className:"w-full lg:w-3/5 mt-24",children:[y.jsxs("div",{className:"text-center",children:[y.jsx(H.Typography,{variant:"h2",className:"font-bold mb-4",children:"Anmelden"}),y.jsx(H.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."})]}),y.jsxs("form",{className:"mt-8 mb-2 mx-auto w-80 max-w-screen-lg lg:w-1/2",onSubmit:T,children:[y.jsxs("div",{className:"mb-1 flex flex-col gap-6",children:[y.jsx(H.Typography,{variant:"small",color:"blue-gray",className:"-mb-3 font-medium",children:"E-Mail oder Benutzername"}),y.jsx(H.Input,{size:"lg",placeholder:"E-Mail oder Benutzername",value:n,onChange:C=>o(C.target.value),required:!0,autoFocus:!0,disabled:c,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}}),y.jsx(H.Typography,{variant:"small",color:"blue-gray",className:"-mb-3 font-medium",children:"Passwort"}),y.jsx(H.Input,{type:"password",size:"lg",placeholder:"********",value:a,onChange:C=>i(C.target.value),required:!0,disabled:c,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),g&&y.jsx(H.Alert,{color:"red",className:"mt-2 border border-red-200 bg-red-50 text-red-700",children:g}),y.jsx(H.Button,{type:"submit",className:"mt-6",fullWidth:!0,disabled:c,children:c?"Anmeldung läuft ...":"Anmelden"}),y.jsx(H.Typography,{as:"button",type:"button",onClick:()=>e("/auth/forgot-password"),className:"mt-4 text-sm font-medium text-blue-600 transition hover:text-blue-800",children:"Passwort vergessen?"})]})]}),y.jsx("div",{className:"w-2/5 h-full hidden lg:block",children:y.jsx("img",{src:EV,className:"h-full w-full object-cover rounded-3xl"})})]}):y.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:y.jsx("span",{className:"text-blue-gray-500",children:"Pruefe Anmeldestatus ..."})})}function AV(){return y.jsxs("section",{className:"m-8 flex",children:[y.jsx("div",{className:"w-2/5 h-full hidden lg:block",children:y.jsx("img",{src:"/img/pattern.png",className:"h-full w-full object-cover rounded-3xl"})}),y.jsxs("div",{className:"w-full lg:w-3/5 flex flex-col items-center justify-center",children:[y.jsxs("div",{className:"text-center",children:[y.jsx(H.Typography,{variant:"h2",className:"font-bold mb-4",children:"Join Us Today"}),y.jsx(H.Typography,{variant:"paragraph",color:"blue-gray",className:"text-lg font-normal",children:"Enter your email and password to register."})]}),y.jsxs("form",{className:"mt-8 mb-2 mx-auto w-80 max-w-screen-lg lg:w-1/2",children:[y.jsxs("div",{className:"mb-1 flex flex-col gap-6",children:[y.jsx(H.Typography,{variant:"small",color:"blue-gray",className:"-mb-3 font-medium",children:"Your email"}),y.jsx(H.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"}})]}),y.jsx(H.Checkbox,{label:y.jsxs(H.Typography,{variant:"small",color:"gray",className:"flex items-center justify-start font-medium",children:["I agree the ",y.jsx("a",{href:"#",className:"font-normal text-black transition-colors hover:text-gray-900 underline",children:"Terms and Conditions"})]}),containerProps:{className:"-ml-2.5"}}),y.jsx(H.Button,{className:"mt-6",fullWidth:!0,children:"Register Now"}),y.jsxs("div",{className:"space-y-4 mt-8",children:[y.jsxs(H.Button,{size:"lg",color:"white",className:"flex items-center gap-2 justify-center shadow-md",fullWidth:!0,children:[y.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[y.jsxs("g",{clipPath:"url(#clip0_1156_824)",children:[y.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"}),y.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"}),y.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"}),y.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"})]}),y.jsx("defs",{children:y.jsx("clipPath",{id:"clip0_1156_824",children:y.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.5)"})})})]}),y.jsx("span",{children:"Sign in With Google"})]}),y.jsxs(H.Button,{size:"lg",color:"white",className:"flex items-center gap-2 justify-center shadow-md",fullWidth:!0,children:[y.jsx("img",{src:"/img/twitter-logo.svg",height:24,width:24,alt:""}),y.jsx("span",{children:"Sign in With Twitter"})]})]}),y.jsxs(H.Typography,{variant:"paragraph",className:"text-center text-blue-gray-500 font-medium mt-4",children:["Already have an account?",y.jsx(Y5,{to:"/auth/sign-in",className:"text-gray-900 ml-1",children:"Sign in"})]})]})]})]})}function sN(){const e=So(),{logout:t}=Ur(),[r,n]=P.useState("abmelden..."),[o,a]=P.useState(null);return P.useEffect(()=>{let i=!1;return(async()=>{try{n("Abmeldung läuft …"),a(null),await t()}catch(f){i||(console.error("⚠️ [Auth] Logout fehlgeschlagen:",f),a("Abmeldung fehlgeschlagen. Bitte versuche es erneut."))}finally{i||e("/auth/sign-in",{replace:!0})}})(),()=>{i=!0}},[t,e]),y.jsx("section",{className:"m-8 flex min-h-[60vh] items-center justify-center",children:y.jsx(H.Card,{className:"w-full max-w-md border border-blue-gray-100 shadow-sm",children:y.jsxs(H.CardBody,{className:"space-y-4 text-center",children:[y.jsxs("div",{className:"flex items-center justify-center gap-3",children:[y.jsx(H.Spinner,{className:"h-5 w-5 text-blue-gray-500"}),y.jsx(H.Typography,{color:"blue-gray",className:"text-sm font-medium",children:r})]}),o&&y.jsx(H.Typography,{color:"red",className:"text-sm",children:o}),y.jsx(H.Typography,{className:"text-xs text-blue-gray-400",children:"Du wirst automatisch weitergeleitet …"})]})})})}sN.displayName="/src/pages/auth/sign-out.jsx";const Pc=8,lN=e=>String(e||"").trim().toLowerCase(),RV=(e="")=>{const t=String(e||"").replace(/[\r\n\t]+/g," ").trim().toLowerCase();return t?t.split(/\s+/).filter(Boolean):[]},MV=(e=[])=>{const t=e.map(lN).filter(Boolean);return{words:t,canonical:t.join("")}};function IV(){const e=So(),{showToast:t}=zs(),{user:r}=Ur(),[n,o]=P.useState(""),[a,i]=P.useState(Array(Pc).fill("")),[c,f]=P.useState(""),[g,b]=P.useState(""),[S,O]=P.useState(""),[T,C]=P.useState(!1),[x,m]=P.useState(""),[d,s]=P.useState(""),[u,l]=P.useState(""),[h,v]=P.useState(!1),[w,j]=P.useState("");P.useEffect(()=>{r&&e("/dashboard/stacks",{replace:!0})},[r,e]);const N=P.useMemo(()=>g.trim()?RV(g):a.map(lN).filter(Boolean),[g,a]),k=P.useCallback((B,U)=>{i(Y=>{const q=[...Y];return q[B]=U,q})},[]),A=P.useCallback(B=>{const[U]=B.target.files||[];if(!U){f(""),b("");return}f(U.name);const Y=new FileReader;Y.onload=q=>{var $;const z=String((($=q.target)==null?void 0:$.result)||"");b(z),i(Array(Pc).fill(""))},Y.onerror=()=>{f(""),b(""),t({variant:"error",title:"Datei konnte nicht gelesen werden",description:"Bitte lade die Datei erneut hoch."})},Y.readAsText(U)},[t]),M=P.useCallback(async()=>{var z,$,K;O(""),m("");const B=n.trim();if(!B){O("Bitte gib deinen Benutzernamen ein.");return}const U=N,Y=!!g.trim();if(!Y&&U.length!==Pc){O("Bitte gib alle acht Wörter des Sicherheitsschlüssels ein.");return}if(Y&&U.length!==Pc){O("Die hochgeladene Datei enthält nicht genau acht Wörter.");return}const q=MV(U);if(!q.canonical){O("Der Sicherheitsschlüssel ist ungültig oder leer.");return}C(!0);try{const te=(z=(await lt.post("/api/auth/recover/verify",{username:B,phrase:q.canonical,words:q.words})).data)==null?void 0:z.token;if(!te)throw new Error("TOKEN_MISSING");m(te),t({variant:"success",title:"Sicherheitsschlüssel bestätigt",description:"Du kannst jetzt ein neues Passwort festlegen."})}catch(X){const te=(K=($=X.response)==null?void 0:$.data)==null?void 0:K.error;O(te==="USER_NOT_FOUND"?"Der angegebene Benutzer wurde nicht gefunden.":te==="PHRASE_MISMATCH"?"Der Sicherheitsschlüssel passt nicht zum Benutzer.":te==="PHRASE_NOT_INITIALIZED"?"Für diesen Benutzer ist aktuell kein Sicherheitsschlüssel hinterlegt.":te==="PHRASE_REQUIRED"?"Bitte gib den Sicherheitsschlüssel ein.":te==="USERNAME_REQUIRED"?"Der Benutzername darf nicht leer sein.":te==="INVALID_PASSWORD"?"Der Sicherheitsschlüssel ist ungültig.":"Die Sicherheitsprüfung ist fehlgeschlagen. Bitte versuche es erneut.")}finally{C(!1)}},[g,N,t,n]),D=P.useCallback(async()=>{var Y,q;if(j(""),!x){j("Bitte bestätige zuerst deinen Sicherheitsschlüssel.");return}const B=d.trim(),U=u.trim();if(!B||!U){j("Bitte gib das neue Passwort zweimal ein.");return}if(B!==U){j("Die Passwörter stimmen nicht überein.");return}v(!0);try{await lt.post("/api/auth/recover/reset",{token:x,password:B,confirmPassword:U}),t({variant:"success",title:"Passwort aktualisiert",description:"Du kannst dich jetzt mit deinem neuen Passwort anmelden."}),e("/auth/sign-in",{replace:!0})}catch(z){const $=(q=(Y=z.response)==null?void 0:Y.data)==null?void 0:q.error;$==="TOKEN_INVALID_OR_EXPIRED"?(j("Die Wiederherstellungssitzung ist abgelaufen. Bitte starte den Vorgang erneut."),m("")):j($==="PASSWORD_TOO_SHORT"?"Das Passwort muss mindestens 8 Zeichen enthalten.":$==="PASSWORD_REQUIRED"?"Bitte gib ein neues Passwort ein.":$==="PASSWORD_MISMATCH"?"Die Passwörter stimmen nicht überein.":"Das Passwort konnte nicht zurückgesetzt werden. Bitte versuche es erneut.")}finally{v(!1)}},[u,e,d,t,x]),L=!!x;return y.jsx("section",{className:"m-8 flex justify-center",children:y.jsxs(H.Card,{className:"w-full max-w-3xl",children:[y.jsxs(H.CardHeader,{floated:!1,shadow:!1,className:"rounded-none border-b border-blue-gray-50 bg-white px-6 py-5",children:[y.jsx(H.Typography,{variant:"h4",color:"blue-gray",className:"font-semibold",children:"Passwort zurücksetzen"}),y.jsx(H.Typography,{color:"blue-gray",className:"mt-1 text-sm",children:"Gib deinen Benutzernamen und den Sicherheitsschlüssel (8 Wörter) ein oder lade die gespeicherte Schlüsseldatei."})]}),y.jsxs(H.CardBody,{className:"space-y-8",children:[y.jsxs("div",{className:"space-y-4",children:[y.jsx(H.Typography,{variant:"h6",color:"blue-gray",children:"Schritt 1: Sicherheitsschlüssel prüfen"}),y.jsxs("div",{children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Benutzername"}),y.jsx(H.Input,{size:"lg",placeholder:"Benutzername",value:n,onChange:B=>o(B.target.value),disabled:L||T,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),y.jsxs("div",{children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Sicherheitsschlüssel eingeben"}),y.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-4 min-w-[20px] [&>div]:!min-w-0",children:a.map((B,U)=>y.jsx(H.Input,{placeholder:`Wort ${U+1}`,value:B,onChange:Y=>k(U,Y.target.value),disabled:L||T||!!g.trim(),className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}},`phrase-input-${U}`))})]}),y.jsxs("div",{children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Alternativ: Schlüsseldatei (.txt) hochladen"}),y.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center",children:[y.jsx("input",{type:"file",accept:".txt",onChange:A,disabled:L||T,className:"block w-full max-w-xs text-sm text-blue-gray-500 file:mr-4 file:rounded-md file:border-0 file:bg-blue-gray-50 file:px-4 file:py-2 file:text-sm file:font-semibold file:text-blue-gray-700 hover:file:bg-blue-gray-100"}),c&&y.jsxs(H.Typography,{className:"text-xs text-blue-gray-500",children:["Ausgewählte Datei: ",y.jsx("span",{className:"font-medium text-blue-gray-700",children:c})]})]})]}),S&&y.jsx(H.Alert,{color:"red",className:"border border-red-200 bg-red-50 text-red-700",children:S}),y.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[y.jsx(H.Button,{color:"blue",className:"normal-case",onClick:M,disabled:T||L,children:T?y.jsxs("span",{className:"flex items-center gap-2",children:[y.jsx(H.Spinner,{className:"h-4 w-4"})," Prüfe Sicherheitsschlüssel ..."]}):"Sicherheitsschlüssel prüfen"}),L&&y.jsx(H.Typography,{className:"text-sm text-blue-gray-500",children:"Die Wiederherstellung bleibt für kurze Zeit aktiv. Bitte setze dein Passwort zeitnah zurück."})]})]}),y.jsxs("div",{className:"space-y-4",children:[y.jsx(H.Typography,{variant:"h6",color:L?"blue-gray":"gray",children:"Schritt 2: Neues Passwort festlegen"}),!L&&y.jsx(H.Typography,{className:"text-sm text-blue-gray-500",children:"Nach erfolgreicher Prüfung des Sicherheitsschlüssels kannst du hier ein neues Passwort vergeben."}),L&&y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Neues Passwort"}),y.jsx(H.Input,{type:"password",size:"lg",placeholder:"Neues Passwort",value:d,onChange:B=>s(B.target.value),disabled:h,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),y.jsxs("div",{children:[y.jsx(H.Typography,{className:"mb-2 block text-xs font-semibold uppercase text-blue-gray-500",children:"Passwort bestätigen"}),y.jsx(H.Input,{type:"password",size:"lg",placeholder:"Passwort bestätigen",value:u,onChange:B=>l(B.target.value),disabled:h,className:" !border-t-blue-gray-200 focus:!border-t-gray-900",labelProps:{className:"before:content-none after:content-none"}})]}),w&&y.jsx(H.Alert,{color:"red",className:"border border-red-200 bg-red-50 text-red-700",children:w}),y.jsx(H.Button,{color:"green",className:"normal-case",onClick:D,disabled:h,children:h?y.jsxs("span",{className:"flex items-center gap-2",children:[y.jsx(H.Spinner,{className:"h-4 w-4"})," Speichere Passwort ..."]}):"Neues Passwort speichern"})]})]}),y.jsx("div",{className:"border-t border-blue-gray-50 pt-4",children:y.jsx(H.Typography,{as:"button",type:"button",onClick:()=>e("/auth/sign-in"),className:"text-sm font-medium text-blue-600 transition hover:text-blue-800",children:"Zurück zur Anmeldung"})})]})]})})}function Xa({permission:e,requiredLevel:t="full",loadingFallback:r=null,children:n}){const{initialized:o,loading:a,hasPermission:i}=Ur();return e?!o||a?r??y.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:y.jsx(H.Typography,{variant:"small",color:"blue-gray",children:"Berechtigungen werden geladen …"})}):i(e,t)?n:y.jsx("div",{className:"mt-12 flex items-center justify-center px-4",children:y.jsx(H.Card,{className:"max-w-xl border border-blue-gray-100 shadow-sm",children:y.jsxs(H.CardBody,{className:"space-y-3 text-center",children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:"Kein Zugriff auf diesen Bereich"}),y.jsxs(H.Typography,{variant:"small",className:"text-blue-gray-500",children:["Für diese Funktion wird die Berechtigung ",y.jsx("code",{children:e})," benötigt."]})]})})}):n}Xa.propTypes={permission:sn.string,requiredLevel:sn.string,loadingFallback:sn.node,children:sn.node.isRequired};const No={className:"w-5 h-5 text-inherit"},mg=[{layout:"dashboard",pages:[{icon:y.jsx(p4,{...No}),name:"stacks",path:"/stacks",element:y.jsx(eV,{}),permission:null},{icon:y.jsx(_4,{...No}),name:"wartung",path:"/maintenance",element:y.jsx(Xa,{permission:"maintenance-access",requiredLevel:"read",children:y.jsx(aV,{})}),permission:{key:"maintenance-access",requiredLevel:"read"}},{icon:y.jsx(o4,{...No}),name:"logs",path:"/logs",element:y.jsx(Xa,{permission:"logs-access",requiredLevel:"full",children:y.jsx(pV,{})}),permission:{key:"logs-access",requiredLevel:"full"}},{icon:y.jsx(y4,{...No}),name:"benutzer",path:"/users",element:y.jsx(Xa,{permission:"users-access",requiredLevel:"read",children:y.jsx(mV,{})}),permission:{key:"users-access",requiredLevel:"read"}},{icon:y.jsx(m4,{...No}),name:"rechtegruppen",path:"/usergroups",element:y.jsx(Xa,{permission:"user-groups-access",requiredLevel:"read",children:y.jsx(vV,{})}),permission:{key:"user-groups-access",requiredLevel:"read"}}]},{title:"auth pages",layout:"auth",pages:[{icon:y.jsx(c4,{...No}),name:"sign in",path:"/sign-in",element:y.jsx(jV,{})},{icon:y.jsx(t4,{...No}),name:"passwort vergessen",path:"/forgot-password",element:y.jsx(IV,{}),hidden:!0},{icon:y.jsx(GI,{...No}),name:"log out",path:"/logout",element:y.jsx(sN,{})},{icon:y.jsx(s4,{...No}),name:"sign up",path:"/sign-up",element:y.jsx(AV,{})}]}];function uN(){const[e,t]=Yf(),{sidenavType:r}=e,n=Ea(),o=So(),[a,i]=P.useState(!1),[c,f]=P.useState(!0),{initialized:g,loading:b,isAuthenticated:S,refreshSession:O,user:T}=Ur(),C=P.useCallback(async()=>{i(!1);try{const m=await fetch("/api/setup/status",{credentials:"include"});if(!m.ok)throw new Error("STATUS_REQUEST_FAILED");const d=await m.json();f(!d.setupComplete)}catch(m){console.error("⚠️ [Setup] Statusprüfung fehlgeschlagen:",m),f(!0)}finally{i(!0)}},[]);if(P.useEffect(()=>{C()},[C]),P.useEffect(()=>{!a||c||g||b||O()},[a,c,g,b,O]),P.useEffect(()=>{if(!a)return;if(c){n.pathname!=="/setup"&&o("/setup",{replace:!0});return}if(!g)return;if(!S){n.pathname!=="/auth/sign-in"&&o("/auth/sign-in",{replace:!0});return}const m=!!(T!=null&&T.requiresSecurityPhraseDownload),d=n.pathname==="/dashboard/security-phrase";if(m&&!d){o("/dashboard/security-phrase",{replace:!0});return}!m&&d&&o("/dashboard/stacks",{replace:!0})},[a,c,g,S,n.pathname,o,T==null?void 0:T.requiresSecurityPhraseDownload]),P.useEffect(()=>{if(!a||c||!g||b)return;if(!S){n.pathname!=="/auth/sign-in"&&o("/auth/sign-in",{replace:!0});return}const m=n.pathname.startsWith("/auth/"),d=n.pathname==="/auth/logout";(n.pathname==="/setup"||m&&!d)&&o("/dashboard/stacks",{replace:!0})},[a,c,g,b,S,n.pathname,o]),!a)return y.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:y.jsx("span",{className:"text-blue-gray-500",children:"Pruefe Systemkonfiguration ..."})});if(c)return y.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:y.jsx("span",{className:"text-blue-gray-500",children:"Setup erforderlich ..."})});if(!g||b)return y.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:y.jsx("span",{className:"text-blue-gray-500",children:"Pruefe Anmeldung ..."})});if(!S)return y.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:y.jsx("span",{className:"text-blue-gray-500",children:"Weiterleitung zur Anmeldung ..."})});const x=n.pathname==="/dashboard/security-phrase";return y.jsxs("div",{className:"min-h-screen bg-blue-gray-50/50",children:[!x&&y.jsx(Qf,{routes:mg,brandImg:r==="dark"?"/img/logo-ct.png":"/img/logo-ct-dark.png"}),y.jsxs("div",{className:x?"":"p-4 xl:ml-80",children:[!x&&y.jsxs(y.Fragment,{children:[y.jsx(Vk,{}),y.jsx(Uk,{}),y.jsx(H.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:()=>Pb(t,!0),children:y.jsx(Q5,{className:"h-5 w-5"})})]}),y.jsxs(_m,{children:[mg.map(({layout:m,pages:d})=>m==="dashboard"&&d.map(({path:s,element:u})=>y.jsx(mo,{exact:!0,path:s,element:u}))),y.jsx(mo,{path:"security-phrase",element:y.jsx(NV,{})}),y.jsx(mo,{path:"users/:userId",element:y.jsx(Xa,{permission:"users-access",requiredLevel:"read",children:y.jsx(SV,{})})}),y.jsx(mo,{path:"usergroups/:groupId",element:y.jsx(Xa,{permission:"user-groups-access",requiredLevel:"read",children:y.jsx(TV,{})})})]}),!x&&y.jsx("div",{className:"text-blue-gray-600",children:y.jsx(Wk,{})})]})]})}uN.displayName="/src/layout/dashboard.jsx";function cN(){return y.jsx("div",{className:"relative min-h-screen w-full",children:y.jsx(_m,{children:mg.map(({layout:e,pages:t})=>e==="auth"&&t.map(({path:r,element:n})=>y.jsx(mo,{exact:!0,path:r,element:n})))})})}cN.displayName="/src/layout/Auth.jsx";const fl=["Willkommen","Superuser","Server & API-Key","Stack auswählen (optional)","Abschluss"],DV=e=>typeof(e==null?void 0:e.Name)=="string"&&e.Name.toLowerCase().includes("stackpulse"),LV={username:"",email:"",password:""},FV={name:"",url:""};function zV(){var Ge,Xe,ht,Ve,ot,_t;const e=So(),[t,r]=P.useState(null),[n,o]=P.useState(!0),[a,i]=P.useState(null),[c,f]=P.useState(LV),[g,b]=P.useState(FV),[S,O]=P.useState(""),[T,C]=P.useState({loading:!1,success:!1,tried:!1,message:""}),[x,m]=P.useState({loading:!1,fetched:!1,error:"",items:[],updatedAt:null}),[d,s]=P.useState(""),[u,l]=P.useState(""),[h,v]=P.useState(0),[w,j]=P.useState(!1),[N,k]=P.useState(null),[A,M]=P.useState(!1);P.useEffect(()=>{let Ne=!0;const at=new AbortController;return(async()=>{var ae,ge,oe;o(!0),i(null);try{const ve=await fetch("/api/setup/status",{signal:at.signal,credentials:"include"});if(!ve.ok)throw new Error("STATUS_REQUEST_FAILED");const se=await ve.json();if(!Ne)return;if(r(se),se.setupComplete){e("/auth/sign-in",{replace:!0});return}f(he=>{var Oe,Ce,Ue,Fe,Ie,Ee;return{username:(Ce=(Oe=se.envDefaults)==null?void 0:Oe.superuserUsername)!=null&&Ce.length?se.envDefaults.superuserUsername:he.username,email:(Fe=(Ue=se.envDefaults)==null?void 0:Ue.superuserEmail)!=null&&Fe.length?se.envDefaults.superuserEmail:he.email,password:(Ee=(Ie=se.envDefaults)==null?void 0:Ie.superuserPassword)!=null&&Ee.length?se.envDefaults.superuserPassword:he.password}}),b(he=>{var Oe,Ce,Ue,Fe;return{name:(Ce=(Oe=se.envDefaults)==null?void 0:Oe.serverName)!=null&&Ce.length?se.envDefaults.serverName:he.name,url:(Fe=(Ue=se.envDefaults)==null?void 0:Ue.serverUrl)!=null&&Fe.length?se.envDefaults.serverUrl:he.url}}),O(he=>{var Oe,Ce;return(Ce=(Oe=se.envDefaults)==null?void 0:Oe.apiKeyValue)!=null&&Ce.length?se.envDefaults.apiKeyValue:he});const ie=((ae=se.selfStack)==null?void 0:ae.current)||((ge=se.envDefaults)==null?void 0:ge.selfStackId)||"";l(ie),s((oe=se.selfStack)!=null&&oe.current?String(se.selfStack.current):""),v(0),C({loading:!1,success:!1,tried:!1,message:""}),m({loading:!1,fetched:!1,error:"",items:[],updatedAt:null}),k(null),M(!1)}catch(ve){if(ve.name==="AbortError")return;console.error("⚠️ [Setup] Status konnte nicht geladen werden:",ve),Ne&&i("Setup-Status konnte nicht geladen werden. Bitte Seite aktualisieren.")}finally{Ne&&o(!1)}})(),()=>{Ne=!1,at.abort()}},[e]);const D=(t==null?void 0:t.envDefaults)||{},L=!!((Ge=t==null?void 0:t.requirements)!=null&&Ge.superuser),B=!!((Xe=t==null?void 0:t.requirements)!=null&&Xe.server),U=!!((ht=t==null?void 0:t.requirements)!=null&&ht.apiKey),Y=!!((Ve=t==null?void 0:t.apiKeys)!=null&&Ve.count),q=!!(D.serverUrl||(ot=t==null?void 0:t.servers)!=null&&ot.envProvided),z=!!(D.apiKeyValue||(_t=t==null?void 0:t.apiKeys)!=null&&_t.envProvided),$=B||q,K=U||!Y||z,X=!!D.superuserUsername,te=!!D.superuserEmail,me=!!D.superuserPassword,de=!!D.serverNameFromEnv,ee=!!D.serverUrl,Se=!!D.apiKeyValue,pe=P.useCallback(()=>{C(Ne=>Ne.loading||!Ne.tried?Ne:{loading:!1,success:!1,tried:!1,message:""})},[]),fe=P.useCallback(Ne=>at=>{const Te=at.target.value;f(ae=>({...ae,[Ne]:Te}))},[]),be=P.useCallback(Ne=>at=>{if(Ne==="name"&&de||Ne==="url"&&ee)return;const Te=at.target.value;b(ae=>({...ae,[Ne]:Te})),pe()},[pe,de,ee]),ye=P.useCallback(Ne=>{Se||(O(Ne.target.value),pe())},[Se,pe]),Pe=P.useCallback(async()=>{const Ne=g.url.trim(),at=S.trim();if(!Ne){C({loading:!1,success:!1,tried:!0,message:"Bitte gib eine Server-URL an."});return}if(!at){C({loading:!1,success:!1,tried:!0,message:"Bitte gib einen API-Key ein."});return}C({loading:!0,success:!1,tried:!0,message:""});try{const Te=await fetch("/api/setup/test-portainer",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({server:{name:g.name.trim()||null,url:Ne},apiKey:at})});if(!Te.ok){const ge=(await Te.json().catch(()=>({}))).message||"Verbindungstest fehlgeschlagen. Bitte Daten prüfen.";throw new Error(ge)}C({loading:!1,success:!0,tried:!0,message:"Verbindung wurde erfolgreich hergestellt."})}catch(Te){console.error("⚠️ [Setup] Verbindungstest fehlgeschlagen:",Te),C({loading:!1,success:!1,tried:!0,message:Te.message||"Verbindungstest fehlgeschlagen."})}},[S,g]),Me=P.useCallback(async({silent:Ne=!1}={})=>{if(!T.success){m(ae=>({...ae,error:"Bitte teste zuerst die Verbindung."}));return}const at=g.url.trim(),Te=S.trim();if(!(!at||!Te)){m(ae=>({...ae,loading:!Ne,error:"",fetched:!0}));try{const ae=await fetch("/api/setup/portainer-stacks",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({server:{name:g.name.trim()||null,url:at},apiKey:Te})});if(!ae.ok){const ie=(await ae.json().catch(()=>({}))).message||"Stacks konnten nicht geladen werden.";throw new Error(ie)}const ge=await ae.json().catch(()=>({stacks:[]})),ve=(Array.isArray(ge.stacks)?ge.stacks:[]).filter(DV);m({loading:!1,fetched:!0,error:ve.length?"":"Es wurden keine passenden Stacks gefunden.",items:ve,updatedAt:new Date})}catch(ae){console.error("⚠️ [Setup] Stack-Abruf fehlgeschlagen:",ae),m({loading:!1,fetched:!0,error:ae.message||"Stacks konnten nicht geladen werden.",items:[],updatedAt:new Date})}}},[S,T.success,g]);P.useEffect(()=>{h===3&&T.success&&!x.loading&&!x.fetched&&Me({silent:!0})},[h,T.success,Me,x.fetched,x.loading]),P.useEffect(()=>{T.success||(m(Ne=>({...Ne,items:[],fetched:!1,error:""})),s(""))},[T.success]);const ke=(d||u||"").trim(),ce=P.useMemo(()=>{switch(h){case 0:return!0;case 1:return L?c.username.trim()&&c.email.trim()&&c.password.trim():!0;case 2:{const Ne=$?!!g.url.trim():!0,at=K?!!S.trim():!0,Te=$||K?T.success:!0;return Ne&&at&&Te}case 3:return!0;case 4:return!0;default:return!1}},[h,S,T.success,L,K,$,c.email,c.password,c.username,g.url]),je=P.useCallback(()=>{h>=fl.length-1||v(Ne=>Math.min(Ne+1,fl.length-1))},[h]),He=P.useCallback(()=>{v(Ne=>Math.max(Ne-1,0))},[]),qe=P.useCallback(async()=>{if(!(!t||w)){k(null),M(!1),j(!0);try{const Ne={};L&&(Ne.superuser={username:c.username.trim(),email:c.email.trim(),password:c.password}),$&&(Ne.server={name:g.name.trim(),url:g.url.trim()}),(K||S.trim())&&(Ne.apiKey={value:S.trim()}),ke&&(Ne.selfStackId=ke);const at=await fetch("/api/setup/complete",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(Ne)});if(!at.ok){const ae=await at.json().catch(()=>({})),ge=(()=>{switch(ae.error){case"SERVER_DETAILS_REQUIRED":return"Bitte gib eine gültige Server-URL an.";case"API_KEY_REQUIRED":return"Bitte gib einen gültigen API-Key an.";case"USERNAME_REQUIRED":return"Benutzername wird benötigt.";case"EMAIL_INVALID":return"Bitte gib eine gültige E-Mail-Adresse an.";case"PASSWORD_TOO_SHORT":return"Passwort muss mindestens 8 Zeichen enthalten.";case"INVALID_PASSWORD":return"Das Passwort ist ungültig.";case"API_KEY_ENCRYPT_FAILED":return"API-Key konnte nicht verschlüsselt werden.";case"SUPERUSER_EXISTS":return"Der Superuser wurde bereits angelegt.";default:return"Setup konnte nicht abgeschlossen werden."}})();throw new Error(ge)}const Te=await at.json().catch(()=>({}));r(Te.status),M(!0),setTimeout(()=>{e("/auth/sign-in",{replace:!0})},1500)}catch(Ne){console.error("⚠️ [Setup] Abschluss fehlgeschlagen:",Ne),k(Ne.message||"Setup fehlgeschlagen.")}finally{j(!1)}}},[S,ke,w,e,L,K,$,t,c.email,c.password,c.username,g.name,g.url]),Je=P.useMemo(()=>x.items,[x.items]),Qe=()=>{switch(h){case 0:return y.jsxs("div",{className:"space-y-6",children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:"Willkommen bei StackPulse"}),y.jsx(H.Typography,{className:"text-sm text-blue-gray-600",children:"Dieser Assistent führt dich durch fünf Schritte:"}),y.jsxs("ol",{className:"list-decimal space-y-2 pl-5 text-sm text-blue-gray-600",children:[y.jsx("li",{children:"Superuser-Zugang anlegen"}),y.jsx("li",{children:"Server-URL und Portainer API-Key hinterlegen und testen"}),y.jsx("li",{children:"Den eigenen Stack in Portainer identifizieren"}),y.jsx("li",{children:"Alle Angaben überprüfen und Setup abschließen"})]}),y.jsx(H.Alert,{color:"blue",className:"bg-blue-50 text-blue-800",children:"Du kannst jederzeit zum vorherigen Schritt zurückkehren. Vorwärts geht es, sobald alle Pflichtangaben eines Schritts erledigt sind."})]});case 1:return L?y.jsxs("div",{className:"space-y-4",children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:"Superuser anlegen"}),y.jsx(H.Typography,{className:"text-sm text-blue-gray-600",children:"Dieser Benutzer hat Zugriff auf alle Funktionen."}),y.jsxs("div",{className:"grid gap-4",children:[y.jsx(H.Input,{label:"Benutzername",value:c.username,onChange:fe("username"),readOnly:X}),y.jsx(H.Input,{label:"E-Mail-Adresse",type:"email",value:c.email,onChange:fe("email"),readOnly:te}),y.jsx(H.Input,{label:"Passwort",type:"password",value:c.password,onChange:fe("password"),readOnly:me})]})]}):y.jsx(H.Alert,{color:"green",className:"bg-green-50 text-green-800",children:"Superuser ist bereits vorhanden. Du kannst direkt zum nächsten Schritt gehen."});case 2:return y.jsxs("div",{className:"space-y-6",children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:"Server und Portainer-Zugriff"}),y.jsx(H.Typography,{className:"text-sm text-blue-gray-600",children:"Gib die URL zu deiner Portainer-Instanz sowie den dazugehörigen Business-API-Key ein und teste anschließend die Verbindung."}),y.jsxs("div",{className:"grid gap-4",children:[y.jsx(H.Input,{label:"Server-Name",value:g.name,onChange:be("name"),readOnly:de}),y.jsx(H.Input,{label:"Server-URL",required:$,value:g.url,onChange:be("url"),readOnly:ee}),y.jsx(H.Input,{label:"Portainer API-Key",type:"password",required:K,value:S,onChange:ye,readOnly:Se}),y.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[y.jsx(H.Button,{color:"blue",onClick:Pe,disabled:T.loading,className:"w-full sm:w-auto",children:T.loading?"Teste Verbindung…":"Verbindung testen"}),T.tried&&y.jsx("span",{className:`text-sm ${T.success?"text-green-600":"text-red-600"}`,children:T.message||(T.success?"Verbindung erfolgreich":"Verbindungstest fehlgeschlagen")})]})]})]});case 3:return y.jsxs("div",{className:"space-y-6",children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:"Eigenen Stack wählen (optional)"}),y.jsx(H.Typography,{className:"text-sm text-blue-gray-600",children:"StackPulse kann deinen eigenen Stack hinterlegen, um spätere Wartungsschritte zu erleichtern. Wir versuchen, passende Stacks automatisch zu finden."}),y.jsx(H.Alert,{color:"blue",className:"bg-blue-50 text-blue-800",children:"Dieser Schritt ist optional. Du kannst die Self-Stack-ID später jederzeit im Bereich „Wartung > Server & API-Keys“ hinterlegen oder anpassen."}),y.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[y.jsx(H.Button,{color:"blue",variant:"outlined",onClick:()=>Me({silent:!1}),disabled:!T.success||x.loading,className:"w-full sm:w-auto",children:x.loading?"Lade…":"Stacks neu laden"}),x.updatedAt&&y.jsxs("span",{className:"text-xs text-blue-gray-500",children:["Stand: ",x.updatedAt.toLocaleTimeString("de-DE")]})]}),x.error&&y.jsx(H.Alert,{color:"red",className:"bg-red-50 text-red-700",children:x.error}),y.jsx("div",{className:"space-y-3",children:Je.length===0&&!x.loading?y.jsx("p",{className:"text-sm text-blue-gray-500",children:'Es wurden keine Stacks gefunden, die "stackpulse" im Namen enthalten. Bitte die ID manuell eingeben oder die Suche erneut ausführen.'}):Je.map(Ne=>y.jsxs("label",{className:"flex cursor-pointer items-center justify-between rounded-md border border-blue-gray-100 p-3",children:[y.jsxs("div",{children:[y.jsx("p",{className:"text-sm font-medium text-blue-gray-900",children:Ne.Name||"Ohne Namen"}),y.jsxs("p",{className:"text-xs text-blue-gray-500",children:["ID: ",Ne.Id]})]}),y.jsx(H.Radio,{name:"stack-selection",value:String(Ne.Id),checked:d===String(Ne.Id),onChange:()=>{s(String(Ne.Id)),l("")},ripple:!1})]},Ne.Id))}),y.jsxs("div",{className:"space-y-2",children:[y.jsx(H.Typography,{className:"text-sm font-semibold text-blue-gray-700",children:"Alternative: Stack-ID manuell eintragen (optional)"}),y.jsx(H.Input,{label:"Stack-ID (optional)",value:u,onChange:Ne=>{l(Ne.target.value),s("")},placeholder:"z. B. 42"})]})]});case 4:return y.jsxs("div",{className:"space-y-6",children:[y.jsx(H.Typography,{variant:"h5",color:"blue-gray",children:"Zusammenfassung"}),y.jsxs("div",{className:"space-y-4 rounded-md border border-blue-gray-100 p-4 text-sm text-blue-gray-700",children:[y.jsxs("div",{children:[y.jsx("p",{className:"font-semibold",children:"Superuser"}),y.jsx("p",{children:L?`${c.username||"-"} (${c.email||"ohne E-Mail"})`:"Bereits vorhanden"})]}),y.jsxs("div",{children:[y.jsx("p",{className:"font-semibold",children:"Server"}),y.jsx("p",{children:g.url||"-"})]}),y.jsxs("div",{children:[y.jsx("p",{className:"font-semibold",children:"API-Key"}),y.jsx("p",{children:S?"(ausgefüllt)":"nicht angegeben"})]}),y.jsxs("div",{children:[y.jsx("p",{className:"font-semibold",children:"Self-Stack-ID"}),y.jsx("p",{children:ke||"nicht ausgewählt"})]})]}),N&&y.jsx(H.Alert,{color:"red",className:"bg-red-50 text-red-700",children:N}),A&&y.jsx(H.Alert,{color:"green",className:"bg-green-50 text-green-800",children:"Setup abgeschlossen. Du wirst zum Login weitergeleitet …"})]});default:return null}};return n?y.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:y.jsx("span",{className:"text-blue-gray-500",children:"Lade Setup-Status …"})}):a?y.jsx("div",{className:"flex min-h-screen items-center justify-center bg-blue-gray-50/50",children:y.jsx(H.Alert,{color:"red",className:"w-full max-w-lg border border-red-200 bg-red-50 text-red-700",children:a})}):t?y.jsx("div",{className:"flex min-h-screen w-full items-center justify-center py-10",children:y.jsxs(H.Card,{className:"w-full max-w-3xl border border-blue-gray-100 shadow-sm",children:[y.jsxs(H.CardHeader,{floated:!1,shadow:!1,className:"grid gap-1 rounded-none bg-transparent p-6 text-left",children:[y.jsx(H.Typography,{variant:"h4",color:"blue-gray",children:"System Setup"}),y.jsx(H.Typography,{color:"gray",className:"text-sm",children:"Folge den Schritten, um StackPulse mit deiner Portainer-Instanz zu verbinden."})]}),y.jsxs(H.CardBody,{className:"pt-0",children:[y.jsx(H.Stepper,{activeStep:h,className:"w-full py-6",children:fl.map((Ne,at)=>y.jsx(H.Step,{onClick:()=>v(at),className:"cursor-pointer",activeClassName:"bg-blue-600 text-white",completedClassName:"bg-blue-600 text-white",children:at+1},Ne))}),y.jsx("div",{className:"mt-4 grid grid-cols-1 gap-2 text-center text-xs font-medium text-blue-gray-600 sm:grid-cols-5",children:fl.map(Ne=>y.jsx("span",{children:Ne},Ne))}),y.jsx("div",{className:"mt-6 min-h-[260px] space-y-6",children:Qe()}),y.jsxs("div",{className:"mt-10 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[y.jsx(H.Button,{variant:"text",color:"blue",onClick:He,disabled:h===0||w,className:"w-full sm:w-auto",children:"Zurück"}),h